Added battery module
This commit is contained in:
10
bin/init.lua
10
bin/init.lua
@ -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\"")
|
||||
|
@ -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) \
|
Reference in New Issue
Block a user