Added sound scripts

This commit is contained in:
Alexandre 2026-02-07 17:13:36 +01:00
parent bc348fa7f7
commit 1afa1d9a11
2 changed files with 31 additions and 2 deletions

View File

@ -94,14 +94,17 @@ in
bindl = [
", XF86AudioPause, exec, playerctl play-pause"
", XF86AudioPlay, exec, playerctl play-pause"
", XF86AudioRaiseVolume, exec, wpctl set-sink volume @DEFAULT_SINK@ +5%"
", XF86AudioLowerVolume, exec, wpctl set-sink volume @DEFAULT_SINK@ -5%"
", XF86AudioRaiseVolume, exec, VolumeManager up"
", XF86AudioLowerVolume, exec, VolumeManager down"
", XF866AudioMute, exec, VolumeManager mute"
];
};
};
home.packages = with pkgs; [
# Custom scripts
(import ./scripts.nix { inherit pkgs; })
# Hyprland related (rice, etc...)
wofi
alacritty

View File

@ -0,0 +1,26 @@
{pkgs, ...}:
pkgs.writeShellApplication {
name = "VolumeManager";
runtinmeInputs = [
pkgs.wireplumber
];
text = ''
case "$1" in
up)
wpctl set-volume @DEFAULT_SINK@ 0.05+
;;
down)
wpctl set-volume @DEFAULT_SINK@ 0.05-
;;
mute)
wpctl set-mute @DEFAULT_SINK@ toggle
;;
*)
echo "Usage: volume {up|down\mute}"
exit 1
;;
esac
'';
}