Files
dotfiles/.config/sketchybar/plugins/volume.sh
2025-12-14 22:40:50 +01:00

29 lines
580 B
Bash
Executable File

#!/bin/sh
# The volume_change event supplies a $INFO variable in which the current volume
# percentage is passed to the script.
if [ "$SENDER" = "volume_change" ]; then
VOLUME="$INFO"
case "$VOLUME" in
[6-9][0-9]|100)
ICON="󰕾"
COLOR="0xff8aadf4"
;;
[3-5][0-9])
ICON="󰖀"
COLOR="0xff8aadf4"
;;
[1-9]|[1-2][0-9])
ICON="󰕿"
COLOR="0xffed8796"
;;
*)
ICON="󰖁"
COLOR="0xffed8796"
esac
sketchybar --set "$NAME" icon.color="$COLOR" icon="$ICON" label.color="$COLOR" label="$VOLUME%"
fi