summaryrefslogtreecommitdiff
path: root/volume
diff options
context:
space:
mode:
authorfilip <“filip.rabiega@gmail.com”>2026-02-16 12:37:29 +0100
committerfilip <“filip.rabiega@gmail.com”>2026-02-16 12:37:29 +0100
commitd763f6025fb04c4790b1a84854468191932597c9 (patch)
tree7c204523fc6f7b73d92db602740e9a3b7570437f /volume
parentbf54007f62beb5bf889da69574c4fea74bdc59aa (diff)
downloadchadscripts-d763f6025fb04c4790b1a84854468191932597c9.tar.gz
chadscripts-d763f6025fb04c4790b1a84854468191932597c9.tar.bz2
chadscripts-d763f6025fb04c4790b1a84854468191932597c9.zip
add booksplit dwifi getbib rewrite volume
Diffstat (limited to 'volume')
-rwxr-xr-xvolume27
1 files changed, 22 insertions, 5 deletions
diff --git a/volume b/volume
index f2a3e4b..0d3c7aa 100755
--- a/volume
+++ b/volume
@@ -1,9 +1,26 @@
#!/bin/sh
-# TODO: see if pulseaudio is running
+# 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 increased by $1%" ;;
+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