1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-03-27 21:47:46 +01:00

statusbar: added color for mute, deaf, etc

This commit is contained in:
tiyn 2023-10-17 00:40:43 +02:00
parent 6876ac5a72
commit 9dd7bc87dc
2 changed files with 8 additions and 8 deletions

View File

@ -1,8 +1,8 @@
#!/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"

View File

@ -3,19 +3,19 @@
vol="$(pulsemixer --get-volume | awk '{print $1}')"
if [ "$vol" -eq "0" ]; then
vol_info=" ^d^ $vol%"
vol_info="^c#ff0000^ ^d^ $vol%"
elif [ "$vol" -gt "70" ]; then
vol_info=" ^d^ $vol%"
vol_info="^c#dfdfdf^ ^d^ $vol%"
else
vol_info=" ^d^ $vol%"
vol_info="^c#dfdfdf^ ^d^ $vol%"
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
mic="^b#282828^^c#dfdfdf^  "
else
mic="^b#282828^^c#dfdfdf^  "
mic="^b#282828^^c#ff0000^  "
fi
printf "%s %s %s\\n" "$mic" "$vol_info"