Files
sway-new-config/volume-notify-sway.sh
2025-07-08 09:36:40 +03:00

14 lines
385 B
Bash
Executable File

#!/bin/bash
# Kill any existing volume notification
pkill -f "notify-send.*Volume"
# Get current volume and mute status
volume=$(pactl get-sink-volume @DEFAULT_SINK@ | head -n1 | awk '{print $5}')
muted=$(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}')
if [ "$muted" = "yes" ]; then
notify-send -t 1000 "Volume" "Muted"
else
notify-send -t 1000 "Volume" "$volume"
fi