diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-05-03 18:47:57 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-05-03 18:47:57 -0300 |
commit | b1293b0e0cdd5d84d02045e7fb22350f2863d0fa (patch) | |
tree | 8fe55de3e97ce0c22c53ed8606279665bc944136 /config.dot/awesome.link/battery.lua | |
parent | 7f1dbd27cc2069b49c1c8a2e3f32df2ec36cf258 (diff) | |
download | awesome-b1293b0e0cdd5d84d02045e7fb22350f2863d0fa.tar.gz awesome-b1293b0e0cdd5d84d02045e7fb22350f2863d0fa.tar.bz2 |
Adding battery widget
Diffstat (limited to 'config.dot/awesome.link/battery.lua')
-rw-r--r-- | config.dot/awesome.link/battery.lua | 13 |
1 files changed, 13 insertions, 0 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() |