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