statusbar: added color for mute, deaf, etc

master
tiyn 1 year ago
parent 6876ac5a72
commit 9dd7bc87dc

@ -1,8 +1,8 @@
#!/usr/bin/env sh #!/usr/bin/env sh
# #
[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon=" ^d^ -%" [ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="^c#ff0000^ ^d^ -%"
[ ! -n "${wifiicon+var}" ] && wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print " ^d^", int($3 * 100 / 70) "%" }') [ ! -n "${wifiicon+var}" ] && wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print "^c#dfdfdf^ ^d^", int($3 * 100 / 70) "%" }')
printf "%s %s\n" "$(cat /sys/class/net/e*/operstate | sed "s/down/^b#282828^^c#dfdfdf^  /;s/up/^b#282828^^c#dfdfdf^ 󰈀 /")" "$wifiicon" printf "%s %s\n" "$(cat /sys/class/net/e*/operstate | sed "s/down/^b#282828^^c#ff0000^  /;s/up/^b#282828^^c#dfdfdf^ 󰈀 /")" "$wifiicon"

@ -3,19 +3,19 @@
vol="$(pulsemixer --get-volume | awk '{print $1}')" vol="$(pulsemixer --get-volume | awk '{print $1}')"
if [ "$vol" -eq "0" ]; then if [ "$vol" -eq "0" ]; then
vol_info=" ^d^ $vol%" vol_info="^c#ff0000^ ^d^ $vol%"
elif [ "$vol" -gt "70" ]; then elif [ "$vol" -gt "70" ]; then
vol_info=" ^d^ $vol%" vol_info="^c#dfdfdf^ ^d^ $vol%"
else else
vol_info=" ^d^ $vol%" vol_info="^c#dfdfdf^ ^d^ $vol%"
fi fi
[ "$(pulsemixer --get-mute)" = "1" ] && vol_info=" ^d^ -%" [ "$(pulsemixer --get-mute)" = "1" ] && vol_info="^c#ff0000^ ^d^ -%"
if amixer get Capture | tail -2 | grep -q '\[on\]'; then if amixer get Capture | tail -2 | grep -q '\[on\]'; then
mic="^b#282828^^c#dfdfdf^  " mic="^b#282828^^c#dfdfdf^  "
else else
mic="^b#282828^^c#dfdfdf^  " mic="^b#282828^^c#ff0000^  "
fi fi
printf "%s %s %s\\n" "$mic" "$vol_info" printf "%s %s %s\\n" "$mic" "$vol_info"

Loading…
Cancel
Save