summaryrefslogtreecommitdiff
path: root/volume
diff options
context:
space:
mode:
authorBlake Romero <blake@blkrom.com>2024-11-28 23:37:26 +0000
committerBlake Romero <blake@blkrom.com>2024-11-28 23:37:26 +0000
commit7128f8bfd303e480eb8e02466b67e7094d030704 (patch)
tree89aa49ed616993bef7aaab32da67826edf60d309 /volume
parenta7c24654af07247ab7fffd8199ed1eaf25df31be (diff)
Add custom volume amount & mute option to volume script
Diffstat (limited to 'volume')
-rwxr-xr-xvolume8
1 files changed, 5 insertions, 3 deletions
diff --git a/volume b/volume
index 20a3c15..9cbaaae 100755
--- a/volume
+++ b/volume
@@ -4,6 +4,8 @@
#
id="@DEFAULT_AUDIO_SINK@"
+amount="5%"
+[ -n "$2" ] && amount="$2"
if [ "$#" -eq 0 ]; then
wpctl get-volume "$id" | awk '{print$2}'
@@ -11,16 +13,16 @@ if [ "$#" -eq 0 ]; then
fi
case "$1" in
- "toggle")
+ "toggle"|"mute")
wpctl set-mute "$id" toggle
;;
"up")
wpctl set-mute "$id" 0
- wpctl set-volume --limit 1.0 "$id" 5%+
+ wpctl set-volume --limit 1.0 "$id" "$amount"+
;;
"down")
wpctl set-mute "$id" 0
- wpctl set-volume "$id" 5%-
+ wpctl set-volume "$id" "$amount"-
;;
"reset")
wpctl set-volume "$id" 50%