-- Notification library
require("naughty")
-require("vicious")
+--require("vicious")
+
+require("obvious.battery")
-- Load Debian menu entries
require("debian.menu")
spacer,
mytextclock,
spacer, separator, spacer,
- mybatterybox,
+ obvious.battery.widget,
+-- mybatterybox,
-- batterywidget,
-- spacer, separator, spacer,
-- cpuwidget.widget,
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() .. " "
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)
---}}}