dotfiles/home/dot_config/sketchybar/plugins/executable_sound.sh
2025-09-27 16:00:34 +01:00

20 lines
398 B
Bash

#!/usr/bin/env bash
VOLUME=$(osascript -e "output volume of (get volume settings)")
MUTED=$(osascript -e "output muted of (get volume settings)")
if [ "$MUTED" != "false" ]; then
ICON="󰖁"
VOLUME=0
else
case ${VOLUME} in
100) ICON="" ;;
[5-9]*) ICON="" ;;
[0-9]*) ICON="" ;;
*) ICON="" ;;
esac
fi
sketchybar -m \
--set "$NAME" icon=$ICON \
--set "$NAME" label="$VOLUME%"