2023-01-31 21:16:53 +00:00
|
|
|
#!/bin/sh
|
2023-01-27 17:42:48 +00:00
|
|
|
|
|
|
|
# The volume_change event supplies a $INFO variable in which the current volume
|
2023-01-29 18:12:46 +00:00
|
|
|
# percentage is passed to the script.
|
2023-01-27 17:42:48 +00:00
|
|
|
|
2023-08-22 07:14:00 +00:00
|
|
|
if [ "$SENDER" = "volume_change" ]; then
|
|
|
|
VOLUME=$INFO
|
2023-01-27 17:42:48 +00:00
|
|
|
|
2023-08-22 07:14:00 +00:00
|
|
|
case $VOLUME in
|
2023-10-12 19:06:59 +00:00
|
|
|
[6-9][0-9]|100) ICON=""
|
2023-08-22 07:14:00 +00:00
|
|
|
;;
|
2023-10-12 19:06:59 +00:00
|
|
|
[3-5][0-9]) ICON=""
|
2023-08-22 07:14:00 +00:00
|
|
|
;;
|
2023-10-12 19:06:59 +00:00
|
|
|
[1-9]|[1-2][0-9]) ICON=""
|
2023-08-22 07:14:00 +00:00
|
|
|
;;
|
2023-10-12 19:06:59 +00:00
|
|
|
*) ICON=""
|
2023-08-22 07:14:00 +00:00
|
|
|
esac
|
2023-01-27 17:42:48 +00:00
|
|
|
|
2023-08-22 07:14:00 +00:00
|
|
|
sketchybar --set $NAME icon="$ICON" label="$VOLUME%"
|
|
|
|
fi
|