diff options
| -rw-r--r-- | config/hypr/configs/Keybinds.conf | 2 | ||||
| -rwxr-xr-x | config/hypr/scripts/Volume.sh | 63 |
2 files changed, 42 insertions, 23 deletions
diff --git a/config/hypr/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf index 1ddbc81a..7d0e3fef 100644 --- a/config/hypr/configs/Keybinds.conf +++ b/config/hypr/configs/Keybinds.conf @@ -106,6 +106,8 @@ bindd = ALT, tab, bring active to top, bringactivetotop # Special Keys / Hot Keys bindeld = , xf86audioraisevolume, volume up, exec, $scriptsDir/Volume.sh --inc bindeld = , xf86audiolowervolume, volume down, exec, $scriptsDir/Volume.sh --dec +bindeld = ALT, xf86audioraisevolume, volume up precise, exec, $scriptsDir/Volume.sh --inc-precise +bindeld = ALT, xf86audiolowervolume, volume down precise, exec, $scriptsDir/Volume.sh --dec-precise bindld = , xf86AudioMicMute, toggle mic mute, exec, $scriptsDir/Volume.sh --toggle-mic bindld = , xf86audiomute, toggle mute, exec, $scriptsDir/Volume.sh --toggle bindld = , xf86Sleep, sleep, exec, systemctl suspend 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 |
