hyprland: Add mute script for microphone

This commit is contained in:
Donovan Glover 2024-07-05 15:41:49 -04:00
parent ad58ee22a6
commit 5378f4c927
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -11,6 +11,7 @@ let
raiseVolumeScript = "hypr/raise-volume.fish";
lowerVolumeScript = "hypr/lower-volume.fish";
muteScript = "hypr/mute.fish";
gapsScript = "hypr/gaps.sh";
randomBackgroundScript = "hypr/random-bg.fish";
swapBackgroundScript = "hypr/swap-bg.fish";
@ -251,9 +252,10 @@ in
];
bindl = [
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && notify-send -t 2000 \"Muted\" \"$(wpctl get-volume @DEFAULT_AUDIO_SINK@)\""
", XF86AudioMute, exec, ~/.config/${muteScript} Volume @DEFAULT_AUDIO_SINK@"
", XF86AudioRaiseVolume, exec, ~/.config/${raiseVolumeScript}"
", XF86AudioLowerVolume, exec, ~/.config/${lowerVolumeScript}"
", XF86AudioMicMute, exec, ~/.config/${muteScript} Microphone @DEFAULT_AUDIO_SOURCE@"
", XF86MonBrightnessDown, exec, brightnessctl set 5%- && notify-send -t 2000 \"Decreased brightness to\" \"$(brightnessctl get)\""
", XF86MonBrightnessUp, exec, brightnessctl set +5% && notify-send -t 2000 \"Increased brightness to\" \"$(brightnessctl get)\""
];
@ -304,6 +306,23 @@ in
'';
};
xdg.configFile.${muteScript} = {
executable = true;
text = /* fish */ ''
#!/usr/bin/env fish
wpctl set-mute "$argv[2]" toggle
set SINK $(wpctl get-volume "$argv[2]")
if test -n "$(echo $SINK | choose 2)"
notify-send -t 2000 "$argv[1]" "Muted"
else
notify-send -t 2000 "$argv[1]" "$(math "$(echo $SINK | choose 1) * 100")%"
end
'';
};
xdg.configFile.${setBackgroundScript} = {
executable = true;
text = /* fish */ ''