From 9ea7cab155cde2d06c96e74178a68b21e7d8ce1b Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Tue, 30 Aug 2011 08:17:57 +0200 Subject: [PATCH 1/1] use obvious battery widget --- .config/awesome/rc.lua | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) 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) ---}}} -- 2.39.5