1 changed files with 10 additions and 2 deletions
@ -1,8 +1,16 @@ |
|||||
#!/bin/sh |
#!/bin/sh |
||||
|
|
||||
bat="$(cat /sys/class/power_supply/BAT1/capacity)%" |
######################################## |
||||
|
# /!\ THIS SCRIPT IS OBSOLETE /!\ # |
||||
|
# Use slstatus instead # |
||||
|
# https://tools.suckless.org/slstatus/ # |
||||
|
######################################## |
||||
|
|
||||
|
bat="$(awk 'BEGIN{c[0]="ff0000";c[1]="ff8800";c[2]="ddff00";c[3]="00ff00";}{print "^r0,7,2,4^^r2,4,22,10^^c#000000^^r3,5,20,8^^c#"c[int(($1-1)/25)]"^^r"3+20-int($1/5)",5,"int($1/5)",8^^f24^^d^"}' /sys/class/power_supply/BAT1/capacity)" |
||||
t="$(date '+%d/%m %T')" |
t="$(date '+%d/%m %T')" |
||||
|
wifi="$(nmcli -f ACTIVE,SIGNAL,BARS dev wifi list | grep "yes")" |
||||
|
wifi_lvl="$(echo $wifi | awk 'BEGIN{c[0]="ff0000";c[1]="ff8800";c[2]="ddff00";c[3]="00ff00";}/yes/{print "^c#"c[int(($2-1)/25)]"^"$3}')" |
||||
|
|
||||
xsetroot -name "$t $bat" |
xsetroot -name "$t $bat $wifi_lvl" |
||||
|
|
||||
sleep 5s |
sleep 5s |
||||
|
|||||
Loading…
Reference in new issue