scripts

shell scripts
git clone git://git.bitsmanent.org/scripts
Log | Files | Refs | README

commit a77c707baba02655f4c2fb281929205a985b8155
parent c99123a7a68b2509aa19f6583730711f03504d4a
Author: clamiax <smoppy@gmail.com>
Date:   Wed, 23 Sep 2015 12:15:37 +0200

Add charge/uncharge indicator

Diffstat:
Mdwmstatus | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dwmstatus b/dwmstatus @@ -6,7 +6,11 @@ getbattery() { vnow=$(cat /sys/class/power_supply/BAT0/voltage_now) r=$(echo "($enow * 100 / $vnow) * 100 / ($efull * 100 / $vnow)" |bc) - echo "${r}%" + acplugged="$(cat $(du -a /sys/devices |grep 'AC0/online' |awk '{print $2}'))" + + r="${r}%" + [ $acplugged -eq 1 ] && r="${r}+" || r="${r}-" + echo "$r" } getiwlink() {