Added battery module

This commit is contained in:
2022-07-16 16:11:20 -07:00
parent 3014105bbf
commit a4f80add9e
7 changed files with 240 additions and 225 deletions

View File

@ -17,16 +17,6 @@ return {
end
},
battery = {
watch = function(timeout, callback, widget)
awful.widget.watch(script_dir .. "battery", timeout, callback, widget)
end,
status = function(callback)
awful.spawn.easy_async(script_dir .. "battery", callback)
end,
},
rofi = {
launcher = function()
awful.spawn("rofi -show drun -theme \"" .. dir .. "/rofi/launcher.rasi\"")

View File

@ -1,8 +0,0 @@
#!/usr/bin/fish
# returns battery percentage and status
# 45%, discharging
# second parameter returns "fully" when fully charged. Since awesome only checks for "discharging," fixing that isn't necessary.
echo \
(upower --show-info /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage | grep -Po "(\d\d?\d?)%"), \
(upower --show-info /org/freedesktop/UPower/devices/battery_BAT1 | grep state | grep -Po "(?<=state:)\s*(\w*)" | xargs) \