diff options
| author | Ryan Garofano <ryan@ryangarofano.ca> | 2025-12-22 18:05:31 -0800 |
|---|---|---|
| committer | Ryan Garofano <ryan@ryangarofano.ca> | 2025-12-22 18:05:31 -0800 |
| commit | 2d2f6198a92278a141c333926a94d8e82de0570d (patch) | |
| tree | 5b501914f2a0f2f1c30f37edf5bbff97f91a5122 /config/hypr/scripts | |
| parent | 10a6c5250619c89542e39b4c8b4d1f468e72d41f (diff) | |
feat: Add precise volume adjustment
Diffstat (limited to 'config/hypr/scripts')
| -rwxr-xr-x | config/hypr/scripts/Volume.sh | 63 |
1 files changed, 40 insertions, 23 deletions
diff --git a/config/hypr/scripts/Volume.sh b/config/hypr/scripts/Volume.sh index 4c82f543..d870519c 100755 --- a/config/hypr/scripts/Volume.sh +++ b/config/hypr/scripts/Volume.sh @@ -44,7 +44,7 @@ inc_volume() { if [ "$(pamixer --get-mute)" == "true" ]; then toggle_mute else - pamixer -i 5 --allow-boost --set-limit 150 && notify_user + pamixer -i "$1" --allow-boost --set-limit 150 && notify_user fi } @@ -53,7 +53,7 @@ dec_volume() { if [ "$(pamixer --get-mute)" == "true" ]; then toggle_mute else - pamixer -d 5 && notify_user + pamixer -d "$1" && notify_user fi } @@ -120,24 +120,41 @@ dec_mic_volume() { } # Execute accordingly -if [[ "$1" == "--get" ]]; then - get_volume -elif [[ "$1" == "--inc" ]]; then - inc_volume -elif [[ "$1" == "--dec" ]]; then - dec_volume -elif [[ "$1" == "--toggle" ]]; then - toggle_mute -elif [[ "$1" == "--toggle-mic" ]]; then - toggle_mic -elif [[ "$1" == "--get-icon" ]]; then - get_icon -elif [[ "$1" == "--get-mic-icon" ]]; then - get_mic_icon -elif [[ "$1" == "--mic-inc" ]]; then - inc_mic_volume -elif [[ "$1" == "--mic-dec" ]]; then - dec_mic_volume -else - get_volume -fi
\ No newline at end of file +case "$1" in +"--get") + get_volume + ;; +"--inc") + inc_volume 5 + ;; +"--inc-precise") + inc_volume 1 + ;; +"--dec") + dec_volume 5 + ;; +"--dec-precise") + dec_volume 1 + ;; +"--toggle") + toggle_mute + ;; +"--toggle-mic") + toggle_mic + ;; +"--get-icon") + get_icon + ;; +"--get-mic-icon") + get_mic_icon + ;; +"--mic-inc") + inc_mic_volume + ;; +"--mic-dec") + dec_mic_volume + ;; +*) + get_volume + ;; +esac |
