SketchyBar/plugins/volume.sh

21 lines
405 B
Bash
Raw Normal View History

2023-01-31 21:16:53 +00:00
#!/bin/sh
# The volume_change event supplies a $INFO variable in which the current volume
# percentage is passed to the script.
2023-08-22 07:14:00 +00:00
if [ "$SENDER" = "volume_change" ]; then
VOLUME=$INFO
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-08-22 07:14:00 +00:00
sketchybar --set $NAME icon="$ICON" label="$VOLUME%"
fi