From: martin f. krafft Date: Tue, 30 Aug 2011 06:17:57 +0000 (+0200) Subject: use obvious battery widget X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/9ea7cab155cde2d06c96e74178a68b21e7d8ce1b?hp=b59a7f90ee1105ec98b70dfce54edf885703670e use obvious battery widget --- diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 37855d1..5d69445 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -9,6 +9,8 @@ require("naughty") --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, @@ -589,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) ---}}}