diff options
| author | filip <“filip.rabiega@gmail.com”> | 2026-02-16 12:37:29 +0100 |
|---|---|---|
| committer | filip <“filip.rabiega@gmail.com”> | 2026-02-16 12:37:29 +0100 |
| commit | d763f6025fb04c4790b1a84854468191932597c9 (patch) | |
| tree | 7c204523fc6f7b73d92db602740e9a3b7570437f /volume | |
| parent | bf54007f62beb5bf889da69574c4fea74bdc59aa (diff) | |
| download | chadscripts-d763f6025fb04c4790b1a84854468191932597c9.tar.gz chadscripts-d763f6025fb04c4790b1a84854468191932597c9.tar.bz2 chadscripts-d763f6025fb04c4790b1a84854468191932597c9.zip | |
add booksplit dwifi getbib rewrite volume
Diffstat (limited to 'volume')
| -rwxr-xr-x | volume | 27 |
1 files changed, 22 insertions, 5 deletions
@@ -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 |
