diff options
Diffstat (limited to 'config.dot')
-rw-r--r-- | config.dot/awesome.link/battery.lua | 13 | ||||
-rw-r--r-- | config.dot/awesome.link/rc.lua | 3 |
2 files changed, 15 insertions, 1 deletions
diff --git a/config.dot/awesome.link/battery.lua b/config.dot/awesome.link/battery.lua new file mode 100644 index 0000000..6461b56 --- /dev/null +++ b/config.dot/awesome.link/battery.lua @@ -0,0 +1,13 @@ +-- See http://blog.lick-me.org/2013/08/yet-another-battery-widget-awesome-3-5-1/ +battery_widget = widget({ type = "textbox", name = "battery", align = "right" }) + +function getBatteryStatus(widget) + local fd= io.popen(homedir .. "/apps/scripts/battery") + local status = fd:read() + fd:close() + widget.text = status +end + +batteryTimer = timer({ timeout = 1 }) +batteryTimer:add_signal("timeout", function () getBatteryStatus(battery_widget) end) +batteryTimer:start() diff --git a/config.dot/awesome.link/rc.lua b/config.dot/awesome.link/rc.lua index e5fe3bb..6b7df95 100644 --- a/config.dot/awesome.link/rc.lua +++ b/config.dot/awesome.link/rc.lua @@ -57,9 +57,9 @@ dofile(configdir .. "/functions.lua") -- }}} -- {{{ Widgets --- Leds dofile(configdir .. "/leds.lua") dofile(configdir .. "/volume.lua") +dofile(configdir .. "/battery.lua") if file_exists(homedir .. "/.custom/awesome/awesompd.lua") then awesompd = true @@ -173,6 +173,7 @@ for s = 1, screen.count() do mytextclock, s == 1 and mysystray or nil, volume_widget, + battery_widget, myledbox, awesompd and musicwidget.widget or nil, mytasklist[s], |