aboutsummaryrefslogtreecommitdiff
path: root/config.dot/awesome.link/widgets/leds.lua
diff options
context:
space:
mode:
Diffstat (limited to 'config.dot/awesome.link/widgets/leds.lua')
-rw-r--r--config.dot/awesome.link/widgets/leds.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/config.dot/awesome.link/widgets/leds.lua b/config.dot/awesome.link/widgets/leds.lua
new file mode 100644
index 0000000..382abdd
--- /dev/null
+++ b/config.dot/awesome.link/widgets/leds.lua
@@ -0,0 +1,13 @@
+-- See https://bbs.archlinux.org/viewtopic.php?id=68511
+myledbox = widget({ type = "textbox" })
+
+function run_leds()
+ local filedescripter = io.popen('leds')
+ local value = filedescripter:read()
+ filedescripter:close()
+ return value
+end
+
+mytimer = timer({ timeout = 1 })
+mytimer:add_signal("timeout", function() myledbox.text = run_leds() end)
+mytimer:start()