From 7a7b0996f2a0cc3fbd662a952cdf2ae9950b30d3 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Fri, 19 Dec 2025 13:48:19 +0800 Subject: [PATCH] feat: niri & hyprland - adjust keybindings Signed-off-by: Ryan Yin --- home/linux/gui/hyprland/conf/keybindings.conf | 10 ++++++---- home/linux/gui/niri/conf/keybindings.kdl | 16 +++++++++++----- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/home/linux/gui/hyprland/conf/keybindings.conf b/home/linux/gui/hyprland/conf/keybindings.conf index 7c7963a9..ee5dff1c 100644 --- a/home/linux/gui/hyprland/conf/keybindings.conf +++ b/home/linux/gui/hyprland/conf/keybindings.conf @@ -30,12 +30,14 @@ bind = $mod, d, exec, anyrun # - Hardware control # BIND MOD KEY DISPATCHER VALUE # https://wiki.archlinux.org/title/WirePlumber -bindel = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ -bindel = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- +bindel = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.01+ --limit 1.0 +bindel = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.01- bindl = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle bindl = , XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle -bind = , XF86MonBrightnessUp, exec, brightnessctl set 5%+ -bind = , XF86MonBrightnessDown, exec, brightnessctl set 5%- +bind = , XF86MonBrightnessUp, exec, brightnessctl --class=backlight set 1%+ +bind = , XF86MonBrightnessDown, exec, brightnessctl --class=backlight set 1%- +bind = , XF86KbdBrightnessUp, exec, brightnessctl --device=kbd_backlight set 10%+ +bind = , XF86KbdBrightnessDown, exec, brightnessctl --device=kbd_backlight set 10%- bind = , XF86AudioPlay, exec, playerctl play-pause bind = , XF86AudioNext, exec, playerctl next bind = , XF86AudioPrev, exec, playerctl previous diff --git a/home/linux/gui/niri/conf/keybindings.kdl b/home/linux/gui/niri/conf/keybindings.kdl index 2eef92f5..1408d5dd 100644 --- a/home/linux/gui/niri/conf/keybindings.kdl +++ b/home/linux/gui/niri/conf/keybindings.kdl @@ -28,8 +28,8 @@ binds { // The allow-when-locked=true property makes them work even when the session is locked. // Using spawn-sh allows to pass multiple arguments together with the command. // "-l 1.0" limits the volume to 100%. - XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+ -l 1.0"; } - XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; } + XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.01+ --limit 1.0"; } + XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.01-"; } XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; } XF86AudioMicMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; } @@ -43,8 +43,14 @@ binds { // Example brightness key mappings for brightnessctl. // You can use regular spawn with multiple arguments too (to avoid going through "sh"), // but you need to manually put each argument in separate "" quotes. - XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+10%"; } - XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "10%-"; } + XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "1%+"; } + XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "1%-"; } + // keyboard backlight + XF86KbdBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--device=kbd_backlight" "set" "10%+"; } + XF86KbdBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--device=kbd_backlight" "set" "10%-"; } + + // for apple-silicon touchbar + XF86Search { spawn "anyrun"; } // Open/close the Overview: a zoomed-out view of workspaces and windows. // You can also move the mouse into the top-left hot corner, @@ -229,7 +235,7 @@ binds { // which ensures niri always processes them, even when an inhibitor is active. Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; } - Mod+Shift+E { wlogout; } + Mod+Shift+E { spawn "wlogout"; } // The quit action will show a confirmation dialog to avoid accidental exits. Ctrl+Alt+Delete { quit; }