X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/530d9c995480d7de8440d85b19df487447db7042..9ea7cab155cde2d06c96e74178a68b21e7d8ce1b:/.config/awesome/rc.lua diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 79e5cd2..5d69445 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -7,7 +7,9 @@ require("beautiful") -- Notification library require("naughty") -require("vicious") +--require("vicious") + +require("obvious.battery") -- Load Debian menu entries require("debian.menu") @@ -285,7 +287,8 @@ for s = 1, screen.count() do spacer, mytextclock, spacer, separator, spacer, - mybatterybox, + obvious.battery.widget, +-- mybatterybox, -- batterywidget, -- spacer, separator, spacer, -- cpuwidget.widget, @@ -534,6 +537,18 @@ end) client.add_signal("focus", function(c) c.border_color = beautiful.border_focus end) client.add_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) +function clear_urgency_flag(c) + print("property::urgent received for client: ", c) + io.flush () +-- if c.urgent then +-- c.urgent = false +-- end +end + +client.add_signal("new", function (c) + c:add_signal("property::urgent", clear_urgency_flag) +end) + -- Hook called every sixty seconds function hook_battery() mybatterybox.text = " " .. get_acpibatt() .. " " @@ -577,26 +592,10 @@ function get_acpibatt() return ''; end end -t = timer({ timeout = 20 }) -t:add_signal('timeout', hook_battery) -t:start() -hook_battery() +--t = timer({ timeout = 20 }) +--t:add_signal('timeout', hook_battery) +--t:start() +--hook_battery() +--bashets.register_lua(mybatterybox, get_acpibatt, '%1', 30) +--bashets.start() -- }}} - ---{{{ batt hook -local function get_bat() - local a = io.open("/sys/class/power_supply/BAT1/charge_full") - for line in a:lines() do - full = line - end - a:close() - local b = io.open("/sys/class/power_supply/BAT1/charge_now") - for line in b:lines() do - now = line - end - b:close() - batt=math.floor(now*100/full) - batterywidget:bar_data_add("bat",batt ) -end --- awful.hooks.timer.register(5, get_bat) ---}}}