blob: 0d3c7aa28e31d15e301ec142c172e0d52abbda5b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#!/bin/sh
# Check if PulseAudio (or PipeWire pulse server) is running
if ! pactl info >/dev/null 2>&1; then
notify-send "Volume control failed" "PulseAudio is not running."
exit 1
fi
case "$1" in
up)
pactl set-sink-volume @DEFAULT_SINK@ "+5%" &&
notify-send "Volume increased by 5%"
;;
down)
pactl set-sink-volume @DEFAULT_SINK@ "-5%" &&
notify-send "Volume decreased by 5%"
;;
mute)
pactl set-sink-mute @DEFAULT_SINK@ toggle &&
notify-send "Volume muted/unmuted"
;;
*)
pactl set-sink-volume @DEFAULT_SINK@ "$1" &&
notify-send "Volume changed to $1%"
;;
esac
|