From 33f8e11557edc534812688d19e966860e9c292e6 Mon Sep 17 00:00:00 2001 From: Roland Schneider Date: Thu, 29 Jul 2021 14:24:17 +0200 Subject: [PATCH] batter widget --- .gitignore | 1 + autorun.sh | 8 ++++++++ install-deps.sh | 2 ++ rc.lua | 35 +++++++++++++++++++++-------------- 4 files changed, 32 insertions(+), 14 deletions(-) create mode 100644 .gitignore create mode 100644 install-deps.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..486fb59 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +battery-widget diff --git a/autorun.sh b/autorun.sh index d6d8d11..a874fdd 100755 --- a/autorun.sh +++ b/autorun.sh @@ -7,6 +7,14 @@ function run { fi } +# utilities in top bar +# network manager +run /usr/bin/nm-applet +# bluetooth indicator +run /usr/bin/blueman-manager +# screenshot utility +run /usr/bin/shutter + # tag 1 run /usr/local/bin/idea # tag 2 diff --git a/install-deps.sh b/install-deps.sh new file mode 100644 index 0000000..ae4a34e --- /dev/null +++ b/install-deps.sh @@ -0,0 +1,2 @@ +git clone https://github.com/deficient/battery-widget.git +sudo apt-get install acpid diff --git a/rc.lua b/rc.lua index f6c4310..91b5eec 100644 --- a/rc.lua +++ b/rc.lua @@ -13,6 +13,7 @@ local hotkeys_popup = require("awful.hotkeys_popup").widget -- Enable hotkeys help widget for VIM and other apps -- when client with a matching name is opened: require("awful.hotkeys_popup.keys") +local battery_widget = require("battery-widget") -- Load Debian menu entries local debian = require("debian.menu") @@ -20,6 +21,20 @@ local has_fdo, freedesktop = pcall(require, "freedesktop") local KEY_ALT = "Mod1" +local tag1 = "1:idea" +local tag2 = "2:brow" +local tag3 = "3:term" +local tag4 = "4:code" +local tag5 = "5:zoom" +local tag6 = "6:chat" +local tag7 = "7:pass" +local tag8 = "8" +local tag9 = "9" + +local tags = { + tag1,tag2,tag3,tag4,tag5,tag6,tag7,tag8,tag9 +} + -- {{{ Error handling -- Check if awesome encountered an error during startup and fell back to -- another config (This code will only ever execute for the fallback config) @@ -48,6 +63,7 @@ end -- {{{ Variable definitions -- Themes define colours, icons, font and wallpapers. beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua") +beautiful.font = "DejaVu Sans 12" -- This is used later as the default terminal and editor to run. terminal = "x-terminal-emulator" @@ -138,7 +154,10 @@ mykeyboardlayout = awful.widget.keyboardlayout() -- {{{ Wibar -- Create a textclock widget -mytextclock = wibox.widget.textclock() +-- mytextclock = wibox.widget.textclock() +mytextclock = wibox.widget.textclock("%Y-%m-%d, %a, %H:%M:%S",1) + +mybatterywidget = battery_widget { adapter = "BAT0", ac = "AC" } -- Create a wibox for each screen and add it local taglist_buttons = gears.table.join( @@ -198,19 +217,6 @@ end -- Re-set wallpaper when a screen's geometry changes (e.g. different resolution) screen.connect_signal("property::geometry", set_wallpaper) -local tag1 = "1:idea" -local tag2 = "2:brow" -local tag3 = "3:term" -local tag4 = "4:code" -local tag5 = "5:zoom" -local tag6 = "6:chat" -local tag7 = "7:pass" -local tag8 = "8" -local tag9 = "9" - -local tags = { - tag1,tag2,tag3,tag4,tag5,tag6,tag7,tag8,tag9 -} awful.screen.connect_for_each_screen(function(s) -- Wallpaper @@ -260,6 +266,7 @@ end mykeyboardlayout, wibox.widget.systray(), mytextclock, + mybatterywidget, s.mylayoutbox, }, }