-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
47 lines (31 loc) · 1021 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
cbatt - text printout for battery usage/time for text-based status bars;
useful for window managers like awesome, wmii, xmonad etc.
Example output:
$ ./cbatt.sh
[+46%/01:05]
'+' AC is connected
'46%' Battery charge status
'01:05' time till charged
$ ./cbatt.sh
[45%/02:13]
no '+' AC not connected
'45%' Battery charge status
'02:13' time till uncharged
Call cbatt with the parameter "color" to get coloring for awesome.
Edit the color in cbatt.sh as needed (defaults to red).
#### Awesome configuration
-- battery monitoring
mybattmon = widget({ type = "textbox", name = "mybattmon", align = "right" })
function battery_status ()
local fd=io.popen("/home/you/cbatt.sh", "r")
local line=fd:read()
return line
end
mybattmon.text = " " .. battery_status() .. " "
my_battmon_timer=timer({timeout=10})
my_battmon_timer:add_signal("timeout", function()
mybattmon.text = " " .. battery_status() .. " "
end)
my_battmon_timer:start()
--
In mywibox[s].widgets = { ... }, add mybattmon.