Skip to content

Commit

Permalink
Added additional options to audio-ctrl script
Browse files Browse the repository at this point in the history
Signed-off-by: Kajus Naujokaitis <[email protected]>
  • Loading branch information
kajusnau authored and brianmcgillion committed Oct 3, 2024
1 parent 35859ae commit 5bdde3a
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion packages/audio-ctrl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,34 @@ writeShellApplication {
case "$1" in
inc)
# Increase volume by 5%
pamixer -i 5
;;
dec)
# Decrease volume by 5%
pamixer -d 5
;;
mut)
# Toggle mute
if [ "$(pamixer --get-mute)" = "false" ]; then
pamixer -m
else
pamixer -u
fi
;;
esac
get)
# Get current volume level
pamixer --get-volume
;;
set)
# Set volume to a specific level
if [ -n "$2" ]; then
pamixer --set-volume "$2"
fi
;;
*)
echo "Usage: $0 {inc|dec|mut|get|set <volume>}"
;;
esac
'';
}

0 comments on commit 5bdde3a

Please sign in to comment.