framework: niri brightness and quit keys

This commit is contained in:
Tristan 2025-07-18 09:40:34 +01:00
parent 76306f2caf
commit f7307329ab
2 changed files with 29 additions and 3 deletions

View file

@ -16,6 +16,8 @@
services.hyprpaper.enable = true;
systemd.user.services.hyprpaper.Unit.WantedBy = ["niri.service"];
home.packages = with pkgs; [brightnessctl];
services.mako.enable = true;
programs.niri = {
settings = {
@ -62,6 +64,8 @@
"Mod+Q".action = close-window;
"Mod+Shift+Escape".action = quit;
"Mod+WheelScrollDown".action = focus-workspace-down;
"Mod+WheelScrollUp".action = focus-workspace-up;
"Mod+Ctrl+WheelScrollDown".action = move-column-to-workspace-down;
@ -71,6 +75,15 @@
"Mod+G".action = toggle-window-floating;
"Print".action = screenshot;
"XF86AudioRaiseVolume".action.spawn = ["raise-volume"];
"XF86AudioLowerVolume".action.spawn = ["lower-volume"];
"XF86AudioMute".action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"];
"XF86AudioMicMute".action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"];
"XF86MonBrightnessUp".action.spawn = ["brightness" "+10%"];
"XF86MonBrightnessDown".action.spawn = ["brightness" "10%-"];
};
};
};

View file

@ -187,7 +187,8 @@ in {
{
name = "raise-volume";
text = ''
${my-deps.amixer} sset Master 5%+ && ${my-deps.amixer} sset Master unmute
wpctl "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+" -l 1.0
notify-volume
'';
hotkeys = [
{key = "bracketright";}
@ -196,12 +197,24 @@ in {
key = "XF86AudioRaiseVolume";
}
];
install = false;
install = true;
}
{
name = "notify-volume";
text = ''
vol=$(wpctl get-volume "@DEFAULT_AUDIO_SINK@" | cut -d"." -f2)
${my-deps.notify-send} "Volume" -h "int:value:$vol" -h string:x-canonical-private-synchronous:volume -t 3000
'';
hotkeys = [];
install = true;
}
{
name = "lower-volume";
text = ''
${my-deps.amixer} sset Master 5%-
notify-volume
'';
hotkeys = [
{key = "bracketleft";}
@ -210,7 +223,7 @@ in {
key = "XF86AudioLowerVolume";
}
];
install = false;
install = true;
}
{
name = "skip-track";