linux-utils/dwmstatus

17 lines
725 B
Text
Raw Normal View History

2017-06-15 19:48:22 +00:00
#!/bin/sh
########################################
# /!\ 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)"
2017-06-15 19:48:22 +00:00
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}')"
2017-06-15 19:48:22 +00:00
xsetroot -name "$t $bat $wifi_lvl"
2017-06-15 19:48:22 +00:00
sleep 5s