From cb723167a6621a037fd51ed403c4579c60e300f9 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 21 Feb 2013 19:41:17 -0300 Subject: Adding leds widget --- modules/awesome/config.dot/awesome.link/.leds.lua.swp | Bin 0 -> 12288 bytes modules/awesome/config.dot/awesome.link/leds.lua | 13 +++++++++++++ modules/awesome/config.dot/awesome.link/rc.lua | 13 ++++++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 modules/awesome/config.dot/awesome.link/.leds.lua.swp create mode 100644 modules/awesome/config.dot/awesome.link/leds.lua diff --git a/modules/awesome/config.dot/awesome.link/.leds.lua.swp b/modules/awesome/config.dot/awesome.link/.leds.lua.swp new file mode 100644 index 0000000..87879b1 Binary files /dev/null and b/modules/awesome/config.dot/awesome.link/.leds.lua.swp differ diff --git a/modules/awesome/config.dot/awesome.link/leds.lua b/modules/awesome/config.dot/awesome.link/leds.lua new file mode 100644 index 0000000..382abdd --- /dev/null +++ b/modules/awesome/config.dot/awesome.link/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() diff --git a/modules/awesome/config.dot/awesome.link/rc.lua b/modules/awesome/config.dot/awesome.link/rc.lua index 767ddbe..0fbe0ed 100644 --- a/modules/awesome/config.dot/awesome.link/rc.lua +++ b/modules/awesome/config.dot/awesome.link/rc.lua @@ -2,11 +2,16 @@ require("awful") require("awful.autofocus") require("awful.rules") + -- Theme handling library require("beautiful") + -- Notification library require("naughty") +-- Widget libraries +require("vicious") + -- Load Debian menu entries require("debian.menu") @@ -47,6 +52,11 @@ layouts = } -- }}} +-- {{{ Widgets +-- Leds +dofile(configdir .. "/leds.lua") +-- }}} + -- {{{ Tags -- Define a tag table which hold all screen tags. tags = {} @@ -152,6 +162,7 @@ for s = 1, screen.count() do mylayoutbox[s], mytextclock, s == 1 and mysystray or nil, + myledbox, mytasklist[s], layout = awful.widget.layout.horizontal.rightleft } @@ -361,7 +372,7 @@ client.add_signal("focus", function(c) c.border_color = beautiful.border_focus e client.add_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) -- }}} --- Custom +-- Key mappings dofile(configdir .. "/keys.lua") -- Startup commands -- cgit v1.2.3