diff options
Diffstat (limited to '')
| -rw-r--r-- | .config/niri/binds.kdl | 276 |
1 files changed, 276 insertions, 0 deletions
diff --git a/.config/niri/binds.kdl b/.config/niri/binds.kdl new file mode 100644 index 0000000..4a641e6 --- /dev/null +++ b/.config/niri/binds.kdl | |||
| @@ -0,0 +1,276 @@ | |||
| 1 | binds { | ||
| 2 | // Keys consist of modifiers separated by + signs, followed by an XKB key name | ||
| 3 | // in the end. To find an XKB name for a particular key, you may use a program | ||
| 4 | // like wev. | ||
| 5 | // | ||
| 6 | // "Mod" is a special modifier equal to Super when running on a TTY, and to Alt | ||
| 7 | // when running as a winit window. | ||
| 8 | // | ||
| 9 | // Most actions that you can bind here can also be invoked programmatically with | ||
| 10 | // `niri msg action do-something`. | ||
| 11 | |||
| 12 | // Mod-Shift-/, which is usually the same as Mod-?, | ||
| 13 | // shows a list of important hotkeys. | ||
| 14 | Mod+Shift+Slash { show-hotkey-overlay; } | ||
| 15 | |||
| 16 | // Suggested binds for running programs: terminal, app launcher, screen locker. | ||
| 17 | Mod+T hotkey-overlay-title="Open a Terminal: alacritty" { spawn "alacritty"; } | ||
| 18 | Mod+D hotkey-overlay-title="Run an Application: fuzzel" { spawn "fuzzel"; } | ||
| 19 | Super+Alt+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn "swaylock"; } | ||
| 20 | |||
| 21 | // Use spawn-sh to run a shell command. Do this if you need pipes, multiple commands, etc. | ||
| 22 | // Note: the entire command goes as a single argument. It's passed verbatim to `sh -c`. | ||
| 23 | // For example, this is a standard bind to toggle the screen reader (orca). | ||
| 24 | Super+Alt+S allow-when-locked=true hotkey-overlay-title=null { spawn-sh "pkill orca || exec orca"; } | ||
| 25 | |||
| 26 | // Example volume keys mappings for PipeWire & WirePlumber. | ||
| 27 | // The allow-when-locked=true property makes them work even when the session is locked. | ||
| 28 | // Using spawn-sh allows to pass multiple arguments together with the command. | ||
| 29 | // "-l 1.0" limits the volume to 100%. | ||
| 30 | XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+ -l 1.0"; } | ||
| 31 | XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; } | ||
| 32 | XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; } | ||
| 33 | XF86AudioMicMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; } | ||
| 34 | |||
| 35 | // Example media keys mapping using playerctl. | ||
| 36 | // This will work with any MPRIS-enabled media player. | ||
| 37 | XF86AudioPlay allow-when-locked=true { spawn-sh "playerctl play-pause"; } | ||
| 38 | XF86AudioStop allow-when-locked=true { spawn-sh "playerctl stop"; } | ||
| 39 | XF86AudioPrev allow-when-locked=true { spawn-sh "playerctl previous"; } | ||
| 40 | XF86AudioNext allow-when-locked=true { spawn-sh "playerctl next"; } | ||
| 41 | |||
| 42 | // Example brightness key mappings for brightnessctl. | ||
| 43 | // You can use regular spawn with multiple arguments too (to avoid going through "sh"), | ||
| 44 | // but you need to manually put each argument in separate "" quotes. | ||
| 45 | XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+10%"; } | ||
| 46 | XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "10%-"; } | ||
| 47 | |||
| 48 | // Open/close the Overview: a zoomed-out view of workspaces and windows. | ||
| 49 | // You can also move the mouse into the top-left hot corner, | ||
| 50 | // or do a four-finger swipe up on a touchpad. | ||
| 51 | Mod+O repeat=false { toggle-overview; } | ||
| 52 | |||
| 53 | Mod+Q repeat=false { close-window; } | ||
| 54 | |||
| 55 | Mod+Left { focus-column-left; } | ||
| 56 | Mod+Down { focus-window-down; } | ||
| 57 | Mod+Up { focus-window-up; } | ||
| 58 | Mod+Right { focus-column-right; } | ||
| 59 | Mod+H { focus-column-left; } | ||
| 60 | Mod+J { focus-window-down; } | ||
| 61 | Mod+K { focus-window-up; } | ||
| 62 | Mod+L { focus-column-right; } | ||
| 63 | |||
| 64 | Mod+Ctrl+Left { move-column-left; } | ||
| 65 | Mod+Ctrl+Down { move-window-down; } | ||
| 66 | Mod+Ctrl+Up { move-window-up; } | ||
| 67 | Mod+Ctrl+Right { move-column-right; } | ||
| 68 | Mod+Ctrl+H { move-column-left; } | ||
| 69 | Mod+Ctrl+J { move-window-down; } | ||
| 70 | Mod+Ctrl+K { move-window-up; } | ||
| 71 | Mod+Ctrl+L { move-column-right; } | ||
| 72 | |||
| 73 | // Alternative commands that move across workspaces when reaching | ||
| 74 | // the first or last window in a column. | ||
| 75 | // Mod+J { focus-window-or-workspace-down; } | ||
| 76 | // Mod+K { focus-window-or-workspace-up; } | ||
| 77 | // Mod+Ctrl+J { move-window-down-or-to-workspace-down; } | ||
| 78 | // Mod+Ctrl+K { move-window-up-or-to-workspace-up; } | ||
| 79 | |||
| 80 | Mod+Home { focus-column-first; } | ||
| 81 | Mod+End { focus-column-last; } | ||
| 82 | Mod+Ctrl+Home { move-column-to-first; } | ||
| 83 | Mod+Ctrl+End { move-column-to-last; } | ||
| 84 | |||
| 85 | Mod+Shift+Left { focus-monitor-left; } | ||
| 86 | Mod+Shift+Down { focus-monitor-down; } | ||
| 87 | Mod+Shift+Up { focus-monitor-up; } | ||
| 88 | Mod+Shift+Right { focus-monitor-right; } | ||
| 89 | Mod+Shift+H { focus-monitor-left; } | ||
| 90 | Mod+Shift+J { focus-monitor-down; } | ||
| 91 | Mod+Shift+K { focus-monitor-up; } | ||
| 92 | Mod+Shift+L { focus-monitor-right; } | ||
| 93 | |||
| 94 | Mod+Shift+Ctrl+Left { move-column-to-monitor-left; } | ||
| 95 | Mod+Shift+Ctrl+Down { move-column-to-monitor-down; } | ||
| 96 | Mod+Shift+Ctrl+Up { move-column-to-monitor-up; } | ||
| 97 | Mod+Shift+Ctrl+Right { move-column-to-monitor-right; } | ||
| 98 | Mod+Shift+Ctrl+H { move-column-to-monitor-left; } | ||
| 99 | Mod+Shift+Ctrl+J { move-column-to-monitor-down; } | ||
| 100 | Mod+Shift+Ctrl+K { move-column-to-monitor-up; } | ||
| 101 | Mod+Shift+Ctrl+L { move-column-to-monitor-right; } | ||
| 102 | |||
| 103 | // Alternatively, there are commands to move just a single window: | ||
| 104 | // Mod+Shift+Ctrl+Left { move-window-to-monitor-left; } | ||
| 105 | // ... | ||
| 106 | |||
| 107 | // And you can also move a whole workspace to another monitor: | ||
| 108 | // Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; } | ||
| 109 | // ... | ||
| 110 | |||
| 111 | Mod+Page_Down { focus-workspace-down; } | ||
| 112 | Mod+Page_Up { focus-workspace-up; } | ||
| 113 | Mod+U { focus-workspace-down; } | ||
| 114 | Mod+I { focus-workspace-up; } | ||
| 115 | Mod+Ctrl+Page_Down { move-column-to-workspace-down; } | ||
| 116 | Mod+Ctrl+Page_Up { move-column-to-workspace-up; } | ||
| 117 | Mod+Ctrl+U { move-column-to-workspace-down; } | ||
| 118 | Mod+Ctrl+I { move-column-to-workspace-up; } | ||
| 119 | |||
| 120 | // Alternatively, there are commands to move just a single window: | ||
| 121 | // Mod+Ctrl+Page_Down { move-window-to-workspace-down; } | ||
| 122 | // ... | ||
| 123 | |||
| 124 | Mod+Shift+Page_Down { move-workspace-down; } | ||
| 125 | Mod+Shift+Page_Up { move-workspace-up; } | ||
| 126 | Mod+Shift+U { move-workspace-down; } | ||
| 127 | Mod+Shift+I { move-workspace-up; } | ||
| 128 | |||
| 129 | // You can bind mouse wheel scroll ticks using the following syntax. | ||
| 130 | // These binds will change direction based on the natural-scroll setting. | ||
| 131 | // | ||
| 132 | // To avoid scrolling through workspaces really fast, you can use | ||
| 133 | // the cooldown-ms property. The bind will be rate-limited to this value. | ||
| 134 | // You can set a cooldown on any bind, but it's most useful for the wheel. | ||
| 135 | Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; } | ||
| 136 | Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; } | ||
| 137 | Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; } | ||
| 138 | Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; } | ||
| 139 | |||
| 140 | Mod+WheelScrollRight { focus-column-right; } | ||
| 141 | Mod+WheelScrollLeft { focus-column-left; } | ||
| 142 | Mod+Ctrl+WheelScrollRight { move-column-right; } | ||
| 143 | Mod+Ctrl+WheelScrollLeft { move-column-left; } | ||
| 144 | |||
| 145 | // Usually scrolling up and down with Shift in applications results in | ||
| 146 | // horizontal scrolling; these binds replicate that. | ||
| 147 | Mod+Shift+WheelScrollDown { focus-column-right; } | ||
| 148 | Mod+Shift+WheelScrollUp { focus-column-left; } | ||
| 149 | Mod+Ctrl+Shift+WheelScrollDown { move-column-right; } | ||
| 150 | Mod+Ctrl+Shift+WheelScrollUp { move-column-left; } | ||
| 151 | |||
| 152 | // Similarly, you can bind touchpad scroll "ticks". | ||
| 153 | // Touchpad scrolling is continuous, so for these binds it is split into | ||
| 154 | // discrete intervals. | ||
| 155 | // These binds are also affected by touchpad's natural-scroll, so these | ||
| 156 | // example binds are "inverted", since we have natural-scroll enabled for | ||
| 157 | // touchpads by default. | ||
| 158 | // Mod+TouchpadScrollDown { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.02+"; } | ||
| 159 | // Mod+TouchpadScrollUp { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.02-"; } | ||
| 160 | |||
| 161 | // You can refer to workspaces by index. However, keep in mind that | ||
| 162 | // niri is a dynamic workspace system, so these commands are kind of | ||
| 163 | // "best effort". Trying to refer to a workspace index bigger than | ||
| 164 | // the current workspace count will instead refer to the bottommost | ||
| 165 | // (empty) workspace. | ||
| 166 | // | ||
| 167 | // For example, with 2 workspaces + 1 empty, indices 3, 4, 5 and so on | ||
| 168 | // will all refer to the 3rd workspace. | ||
| 169 | Mod+1 { focus-workspace 1; } | ||
| 170 | Mod+2 { focus-workspace 2; } | ||
| 171 | Mod+3 { focus-workspace 3; } | ||
| 172 | Mod+4 { focus-workspace 4; } | ||
| 173 | Mod+5 { focus-workspace 5; } | ||
| 174 | Mod+6 { focus-workspace 6; } | ||
| 175 | Mod+7 { focus-workspace 7; } | ||
| 176 | Mod+8 { focus-workspace 8; } | ||
| 177 | Mod+9 { focus-workspace 9; } | ||
| 178 | Mod+Ctrl+1 { move-column-to-workspace 1; } | ||
| 179 | Mod+Ctrl+2 { move-column-to-workspace 2; } | ||
| 180 | Mod+Ctrl+3 { move-column-to-workspace 3; } | ||
| 181 | Mod+Ctrl+4 { move-column-to-workspace 4; } | ||
| 182 | Mod+Ctrl+5 { move-column-to-workspace 5; } | ||
| 183 | Mod+Ctrl+6 { move-column-to-workspace 6; } | ||
| 184 | Mod+Ctrl+7 { move-column-to-workspace 7; } | ||
| 185 | Mod+Ctrl+8 { move-column-to-workspace 8; } | ||
| 186 | Mod+Ctrl+9 { move-column-to-workspace 9; } | ||
| 187 | |||
| 188 | // Alternatively, there are commands to move just a single window: | ||
| 189 | // Mod+Ctrl+1 { move-window-to-workspace 1; } | ||
| 190 | |||
| 191 | // Switches focus between the current and the previous workspace. | ||
| 192 | // Mod+Tab { focus-workspace-previous; } | ||
| 193 | |||
| 194 | // The following binds move the focused window in and out of a column. | ||
| 195 | // If the window is alone, they will consume it into the nearby column to the side. | ||
| 196 | // If the window is already in a column, they will expel it out. | ||
| 197 | Mod+BracketLeft { consume-or-expel-window-left; } | ||
| 198 | Mod+BracketRight { consume-or-expel-window-right; } | ||
| 199 | |||
| 200 | // Consume one window from the right to the bottom of the focused column. | ||
| 201 | Mod+Comma { consume-window-into-column; } | ||
| 202 | // Expel the bottom window from the focused column to the right. | ||
| 203 | Mod+Period { expel-window-from-column; } | ||
| 204 | |||
| 205 | Mod+R { switch-preset-column-width; } | ||
| 206 | // Cycling through the presets in reverse order is also possible. | ||
| 207 | // Mod+R { switch-preset-column-width-back; } | ||
| 208 | Mod+Shift+R { switch-preset-window-height; } | ||
| 209 | Mod+Ctrl+R { reset-window-height; } | ||
| 210 | Mod+F { maximize-column; } | ||
| 211 | Mod+Shift+F { fullscreen-window; } | ||
| 212 | |||
| 213 | // Expand the focused column to space not taken up by other fully visible columns. | ||
| 214 | // Makes the column "fill the rest of the space". | ||
| 215 | Mod+Ctrl+F { expand-column-to-available-width; } | ||
| 216 | |||
| 217 | Mod+C { center-column; } | ||
| 218 | |||
| 219 | // Center all fully visible columns on screen. | ||
| 220 | Mod+Ctrl+C { center-visible-columns; } | ||
| 221 | |||
| 222 | // Finer width adjustments. | ||
| 223 | // This command can also: | ||
| 224 | // * set width in pixels: "1000" | ||
| 225 | // * adjust width in pixels: "-5" or "+5" | ||
| 226 | // * set width as a percentage of screen width: "25%" | ||
| 227 | // * adjust width as a percentage of screen width: "-10%" or "+10%" | ||
| 228 | // Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0, | ||
| 229 | // set-column-width "100" will make the column occupy 200 physical screen pixels. | ||
| 230 | Mod+Minus { set-column-width "-10%"; } | ||
| 231 | Mod+Equal { set-column-width "+10%"; } | ||
| 232 | |||
| 233 | // Finer height adjustments when in column with other windows. | ||
| 234 | Mod+Shift+Minus { set-window-height "-10%"; } | ||
| 235 | Mod+Shift+Equal { set-window-height "+10%"; } | ||
| 236 | |||
| 237 | // Move the focused window between the floating and the tiling layout. | ||
| 238 | Mod+V { toggle-window-floating; } | ||
| 239 | Mod+Shift+V { switch-focus-between-floating-and-tiling; } | ||
| 240 | |||
| 241 | // Toggle tabbed column display mode. | ||
| 242 | // Windows in this column will appear as vertical tabs, | ||
| 243 | // rather than stacked on top of each other. | ||
| 244 | Mod+W { toggle-column-tabbed-display; } | ||
| 245 | |||
| 246 | // Actions to switch layouts. | ||
| 247 | // Note: if you uncomment these, make sure you do NOT have | ||
| 248 | // a matching layout switch hotkey configured in xkb options above. | ||
| 249 | // Having both at once on the same hotkey will break the switching, | ||
| 250 | // since it will switch twice upon pressing the hotkey (once by xkb, once by niri). | ||
| 251 | // Mod+Space { switch-layout "next"; } | ||
| 252 | // Mod+Shift+Space { switch-layout "prev"; } | ||
| 253 | |||
| 254 | Print { screenshot; } | ||
| 255 | Ctrl+Print { screenshot-screen; } | ||
| 256 | Alt+Print { screenshot-window; } | ||
| 257 | |||
| 258 | // Applications such as remote-desktop clients and software KVM switches may | ||
| 259 | // request that niri stops processing the keyboard shortcuts defined here | ||
| 260 | // so they may, for example, forward the key presses as-is to a remote machine. | ||
| 261 | // It's a good idea to bind an escape hatch to toggle the inhibitor, | ||
| 262 | // so a buggy application can't hold your session hostage. | ||
| 263 | // | ||
| 264 | // The allow-inhibiting=false property can be applied to other binds as well, | ||
| 265 | // which ensures niri always processes them, even when an inhibitor is active. | ||
| 266 | Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; } | ||
| 267 | |||
| 268 | // The quit action will show a confirmation dialog to avoid accidental exits. | ||
| 269 | Mod+Shift+E { quit; } | ||
| 270 | Ctrl+Alt+Delete { quit; } | ||
| 271 | |||
| 272 | // Powers off the monitors. To turn them back on, do any input like | ||
| 273 | // moving the mouse or pressing any other key. | ||
| 274 | Mod+Shift+P { power-off-monitors; } | ||
| 275 | } | ||
| 276 | |||
