From 3fc49d8f7fc408509eb2a17afe11aa1a9c86c8f5 Mon Sep 17 00:00:00 2001 From: Andre Ramnitz Date: Fri, 6 Sep 2024 03:44:31 +0200 Subject: [PATCH] hypr: add script to mute or unmute --- config/dot-config/hypr/hyprland.conf | 16 ++++++++-------- config/dot-config/hypr/scripts/muteorunmute.sh | 8 ++++++++ 2 files changed, 16 insertions(+), 8 deletions(-) create mode 100755 config/dot-config/hypr/scripts/muteorunmute.sh diff --git a/config/dot-config/hypr/hyprland.conf b/config/dot-config/hypr/hyprland.conf index 8494e19c..abd43d06 100644 --- a/config/dot-config/hypr/hyprland.conf +++ b/config/dot-config/hypr/hyprland.conf @@ -269,7 +269,7 @@ bind = $suremod, M, exit, bind = $suremod, F, fullscreen,0 bind = $suremod, Return, exec, konsole # backup terminal app bind = $suremod, D, denywindowfromgroup, toggle -bind = $suremod, G, exec, ~/dotfiles/config/hypr/scripts/gamemode.sh +bind = ALT SHIFT, F12, exec, ~/.config/hypr/scripts/gamemode.sh # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more bind = $mainmod, Return, exec, footclient @@ -371,13 +371,13 @@ bindm = $mainmod, mouse:272, movewindow bindm = $mainmod, mouse:273, resizewindow # media keys -bind = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ -bind = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- -bind = , XF86AudioMute, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0% -bind = , XF86AudioPlay, exec, playerctl play-pause -bind = , XF86AudioNext, exec, playerctl next -bind = , XF86AudioPrev, exec, playerctl previous -bind = , XF86audiostop, exec, playerctl stop +bindl = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ +bindl = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- +bindl = , XF86AudioMute, exec, ~/.config/hypr/scripts/muteorunmute.sh +bindl = , XF86AudioPlay, exec, playerctl play-pause +bindl = , XF86AudioNext, exec, playerctl next +bindl = , XF86AudioPrev, exec, playerctl previous +bindl = , XF86audiostop, exec, playerctl stop # printscr bind = $mainmod, Print, exec, grim -g "$(slurp)" - | swappy -f - diff --git a/config/dot-config/hypr/scripts/muteorunmute.sh b/config/dot-config/hypr/scripts/muteorunmute.sh new file mode 100755 index 00000000..afac5737 --- /dev/null +++ b/config/dot-config/hypr/scripts/muteorunmute.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +curvol=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | cut -f2 -d' ') + +test "$curvol" = "0.00" \ + && wpctl set-volume @DEFAULT_AUDIO_SINK@ 70% \ + || wpctl set-volume @DEFAULT_AUDIO_SINK@ 0% + -- 2.51.2