From 8406a181daaacb36b92835dde4773061836d1354 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Mon, 23 Mar 2009 08:23:09 +0100 Subject: [PATCH] reformat battery indicator --- .config/awesome/rc.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index dd330da..c7cd405 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -559,7 +559,7 @@ function get_acpibatt() -- Battery 0: Full, 100% -- so find the first bit first and then go look for the time local st, en, status, percent = string.find(s, '%a+%s%d:%s(%a+),%s(%d+%%)'); - local st, en, time = string.find(s, ',%s(%d+:%d+:%d+)%s%a+', en); + local st, en, time = string.find(s, ',%s(%d+:%d+):%d+%s%a+', en); if not status or not percent then -- time can be empty if we're full return "couldn't parse line " .. s @@ -570,14 +570,15 @@ function get_acpibatt() end if status == 'Charging' then - status = 'c'; - elseif status == 'Discarching' then - status = 'd'; - else + status = '+'; + elseif status == 'Discharging' then status = '-'; + else + status = 'x'; end - return percent; -- .. ' (' .. status .. ')'; -- .. ' ' .. time .. ' left'; + return status .. ' ' .. time; + -- return percent .. ' (' .. status .. ')'; -- .. ' ' .. time .. ' left'; end -- }}} -- 2.39.2