flake-update-20260201
  1// Vincent Demeester niri configuration.
  2// This config is in the KDL format: https://kdl.dev
  3// "/-" comments out the following node.
  4// Check the wiki for a full description of the configuration:
  5// https://github.com/YaLTeR/niri/wiki/Configuration:-Introduction
  6
  7input {
  8    keyboard {
  9        xkb {
 10            layout "us,fr,fr"
 11	    variant "intl,bepo,ergol"
 12	    options "grp:menu_toggle,grp_led:caps,compose:caps"
 13        }
 14        numlock
 15    }
 16    touchpad {
 17        tap
 18        natural-scroll
 19    }
 20}
 21
 22output "eDP-1" {
 23    mode "1920x1080@120.030"
 24    scale 1
 25    transform "normal"
 26    position x=0 y=1440
 27}
 28
 29output "LG Electronics LG ULTRAWIDE 0x0005D10C" {
 30    mode "3440x1440@59.973"
 31    scale 1
 32    transform "normal"
 33    position x=0 y=0
 34}
 35
 36hotkey-overlay {
 37    skip-at-startup
 38}
 39
 40layout {
 41    gaps 6
 42    center-focused-column "never"
 43
 44    preset-column-widths {
 45        // The default preset widths are 1/3, 1/2 and 2/3 of the output.
 46        proportion 0.33333
 47        proportion 0.5
 48        proportion 0.66667
 49    }
 50
 51    default-column-width { proportion 0.5; }
 52
 53    focus-ring {
 54        off
 55        width 2
 56        active-color "#7fc8ff"
 57        inactive-color "#505050"
 58    }
 59
 60    border {
 61        width 2
 62        active-color "#ffc87f"
 63        inactive-color "#505050"
 64        urgent-color "#9b0000"
 65    }
 66    // Struts shrink the area occupied by windows, similarly to layer-shell panels.
 67    // You can think of them as a kind of outer gaps. They are set in logical pixels.
 68    // Left and right struts will cause the next window to the side to always be visible.
 69    // Top and bottom struts will simply add outer gaps in addition to the area occupied by
 70    // layer-shell panels and regular gaps.
 71    struts {
 72        left 6
 73        right 6
 74        // top 12
 75        // bottom 12
 76    }
 77}
 78
 79spawn-at-startup "dbus-update-activation-environment" "--systemd" "WAYLAND_DISPLAY" "DISPLAY" "DBUS_SESSION_BUS_ADDRESS" "SWAYSOCK" "XDG_SESSION_TYPE" "XDG_SESSION_DESKTOP" "XDG_CURRENT_DESKTOP"
 80spawn-at-startup "dbus-update-activation-environment" "--systemd" "--all"
 81spawn-at-startup "emacs" "--fg-daemon"
 82spawn-at-startup "battery-monitor"
 83spawn-at-startup "waybar"
 84// Disabled - using FIDO2 keys with ssh-agent instead of PIV with yubikey-agent
 85// spawn-at-startup "yubikey-agent" "-l" "/run/user/1000/yubikey-agent/yubikey-agent.sock"
 86spawn-at-startup "swaybg" "-i" "/home/vincent/desktop/pictures/lockscreen"
 87
 88prefer-no-csd
 89
 90// screenshot-path "~/desktop/pictures/screenshots/$(hostname)/%Y-%m-%d-%H%M%S.png"
 91screenshot-path "~/desktop/pictures/screenshots/kyushu/%Y-%m-%d-%H%M%S.png"
 92
 93animations {
 94    // Uncomment to turn off all animations.
 95    // off
 96
 97    // Slow down all animations by this factor. Values below 1 speed them up instead.
 98    // slowdown 3.0
 99}
100
101window-rule {
102    // This regular expression is intentionally made as specific as possible,
103    // since this is the default config, and we want no false positives.
104    // You can get away with just app-id="wezterm" if you want.
105    match app-id=r#"^org\.wezfurlong\.wezterm$"#
106    default-column-width {}
107}
108
109// Open the Firefox picture-in-picture player as floating by default.
110window-rule {
111    // This app-id regular expression will work for both:
112    // - host Firefox (app-id is "firefox")
113    // - Flatpak Firefox (app-id is "org.mozilla.firefox")
114    match app-id=r#"firefox$"# title="^Picture-in-Picture$"
115    open-floating true
116}
117
118window-rule {
119    match is-floating=true
120    shadow {
121        on
122    }
123}
124
125// Example: block out two password managers from screen capture.
126// (This example rule is commented out with a "/-" in front.)
127/-window-rule {
128    match app-id=r#"^org\.keepassxc\.KeePassXC$"#
129    match app-id=r#"^org\.gnome\.World\.Secrets$"#
130
131    block-out-from "screen-capture"
132
133    // Use this instead if you want them visible on third-party screenshot tools.
134    // block-out-from "screencast"
135}
136
137// All window have rounde corners and open "big"
138window-rule {
139    geometry-corner-radius 6
140    clip-to-geometry true
141    default-column-width { proportion 0.75; }
142}
143
144window-rule {
145    match is-window-cast-target=true
146
147    focus-ring {
148        active-color "#f38ba8"
149        inactive-color "#7d0d2d"
150    }
151
152    border {
153        inactive-color "#7d0d2d"
154    }
155
156    shadow {
157        color "#7d0d2d70"
158    }
159
160    tab-indicator {
161        active-color "#f38ba8"
162        inactive-color "#7d0d2d"
163    }
164}
165
166binds {
167    // Keys consist of modifiers separated by + signs, followed by an XKB key name
168    // in the end. To find an XKB name for a particular key, you may use a program
169    // like wev.
170    //
171    // "Mod" is a special modifier equal to Super when running on a TTY, and to Alt
172    // when running as a winit window.
173    //
174    // Most actions that you can bind here can also be invoked programmatically with
175    // `niri msg action do-something`.
176
177    Mod+Shift+Slash { show-hotkey-overlay; }
178
179    // Mod+T hotkey-overlay-title="Open a Terminal: kitty" { spawn "kitty"; }
180    Mod+M { spawn "kitten" "quick-access-terminal"; }
181    Mod+Return hotkey-overlay-title="Open a Terminal" { spawn "kitty-launch"; }
182    Mod+Shift+Return hotkey-overlay-title="Open Emacs (client)" { spawn "emacsclient" "-c"; }
183    Mod+Control+Return hotkey-overlay-title="Open Emacs" { spawn "emacs"; }
184    Mod+Control+Alt+Return hotkey-overlay-title="Open Emacs Anywhere" { spawn "emacsclient" "-eval" "(vde/type)"; }
185    Mod+D hotkey-overlay-title="Run an Application" { spawn "fuzzel"; }
186    Mod+Shift+D hotkey-overlay-title="Run Raffi" { spawn "raffi" "-I"; }
187    Mod+F3 hotkey-overlay-title="Voice-to-text (Push-to-talk)" { spawn "voxtype" "record" "toggle"; }
188    // FIXME do not use nix run, but needs niri configuration
189    Mod+Control+D hotkey-overlay-title="Emoji picker" { spawn "rofimoji" "--selector" "fuzzel" "--clipboarder" "wl-copy" "--typer" "wtype" "--action" "type" "copy"; }
190    Mod+Control+V hotkey-overlay-title="Clipboard History" { spawn "bash" "-c" "cliphist list | fuzzel --dmenu --width=100 --lines=20 | cliphist decode | wl-copy"; }
191    Mod+Control+Shift+V hotkey-overlay-title="Delete Clipboard Entry" { spawn "bash" "-c" "cliphist list | fuzzel --dmenu --width=100 --lines=20 | cliphist delete"; }
192    Super+Alt+L hotkey-overlay-title="Lock the Screen" { spawn "swaylock" "-m" "fill" "-i" "/home/vincent/desktop/pictures/lockscreen"; }
193
194    // You can also use a shell. Do this if you need pipes, multiple commands, etc.
195    // Note: the entire command goes as a single argument in the end.
196    // Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; }
197    // bindcode ${mod}+42 exec wl-kbptr -o modes=floating','click -o mode_floating.source=detect
198    //  bindcode ${mod}+Shift+42 mode Mouse
199    Mod+E hotkey-overlay-title="Mouse click" { spawn "wl-kbptr" "-o" "modes=floating,click" "-o" "mode_floating.source=detect";}
200
201    Mod+T { spawn "bash" "-c" "notify-send --icon=clock --category=info --urgency=critical \"$(date +\"%I:%M\")\""; }
202    Mod+B { spawn "bash" "-c" "notify-send --icon=battery --category=info --urgency=critical \"$(acpi)\""; }
203    Mod+Shift+T hotkey-overlay-title="Toggle Color Scheme" { spawn "toggle-color-scheme"; }
204
205    Mod+Shift+B { spawn "pkill" "-USR1" "waybar"; }
206
207    // Example volume keys mappings for PipeWire & WirePlumber.
208    // The allow-when-locked=true property makes them work even when the session is locked.
209    XF86AudioRaiseVolume allow-when-locked=true { spawn "volumectl" "-u" "up"; }
210    XF86AudioLowerVolume allow-when-locked=true { spawn "volumectl" "-u" "down"; }
211    XF86AudioMute        allow-when-locked=true { spawn "volumectl" "toggle-mute"; }
212    
213    XF86AudioMicMute     allow-when-locked=true { spawn "volumectl" "-m" "toggle-mute"; }
214    Ctrl+XF86AudioRaiseVolume allow-when-locked=true { spawn "volumectl" "-u" "-m" "up"; }
215    Ctrl+XF86AudioLowerVolume allow-when-locked=true { spawn "volumectl" "-u" "-m" "down"; }
216    
217    XF86AudioPlay allow-when-locked=true { spawn "playerctl" "play-pause"; }
218    XF86Messenger allow-when-locked=true { spawn "playerctl" "play-pause"; }
219    XF86Favorites allow-when-locked=true { spawn "playerctl" "play-pause"; }
220    XF86AudioNext allow-when-locked=true { spawn "playerctl" "next"; }
221    XF86Go allow-when-locked=true { spawn "playerctl" "next"; }
222    XF86AudioPrev allow-when-locked=true { spawn "playerctl" "previous"; }
223    Cancel allow-when-locked=true { spawn "playerctl" "previous"; }
224
225    XF86MonBrightnessUp allow-when-locked=true { spawn "lightctl" "up"; }
226    XF86MonBrightnessDown allow-when-locked=true { spawn "lightctl" "down"; }
227    // Shift+XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "set" "1%+"; }
228    // Shift+XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "set" "1%-"; }
229
230    // Open/close the Overview: a zoomed-out view of workspaces and windows.
231    // You can also move the mouse into the top-left hot corner,
232    // or do a four-finger swipe up on a touchpad.
233    Mod+O repeat=false { toggle-overview; }
234
235    Mod+Q { close-window; }
236    Mod+Shift+Q { spawn "wlogout"; }
237
238    Mod+Left  { focus-column-left; }
239    Mod+Down  { focus-window-or-workspace-down; }
240    Mod+Up    { focus-window-or-workspace-up; }
241    // Mod+Down  { focus-window-down; }
242    // Mod+Up    { focus-window-up; }
243    Mod+Right { focus-column-right; }
244
245    Mod+Ctrl+Left  { move-column-left; }
246    // Mod+Ctrl+Down  { move-window-down; }
247    // Mod+Ctrl+Up    { move-window-up; }
248    Mod+Ctrl+Down  { move-window-down-or-to-workspace-down; }
249    Mod+Ctrl+Up    { move-window-up-or-to-workspace-up; }
250    Mod+Ctrl+Right { move-column-right; }
251
252    Mod+Home { focus-column-first; }
253    Mod+End  { focus-column-last; }
254    Mod+Ctrl+Home { move-column-to-first; }
255    Mod+Ctrl+End  { move-column-to-last; }
256
257    Mod+Shift+Left  { focus-monitor-left; }
258    Mod+Shift+Down  { focus-monitor-down; }
259    Mod+Shift+Up    { focus-monitor-up; }
260    Mod+Shift+Right { focus-monitor-right; }
261
262    Mod+Shift+Ctrl+Left  { move-column-to-monitor-left; }
263    Mod+Shift+Ctrl+Down  { move-column-to-monitor-down; }
264    Mod+Shift+Ctrl+Up    { move-column-to-monitor-up; }
265    Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
266
267    // Alternatively, there are commands to move just a single window:
268    // Mod+Shift+Ctrl+Left  { move-window-to-monitor-left; }
269    // ...
270
271    // And you can also move a whole workspace to another monitor:
272    // Mod+Shift+Ctrl+Left  { move-workspace-to-monitor-left; }
273    // ...
274    Mod+Page_Down      { move-workspace-to-monitor-next; }
275    Mod+Page_Up        { move-workspace-to-monitor-previous; }
276
277    // Mod+Page_Down      { focus-workspace-down; }
278    // Mod+Page_Up        { focus-workspace-up; }
279    Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
280    Mod+Ctrl+Page_Up   { move-column-to-workspace-up; }
281
282    // Alternatively, there are commands to move just a single window:
283    // Mod+Ctrl+Page_Down { move-window-to-workspace-down; }
284    // ...
285
286    Mod+Shift+Page_Down { move-workspace-down; }
287    Mod+Shift+Page_Up   { move-workspace-up; }
288
289    Mod+WheelScrollDown      cooldown-ms=150 { focus-workspace-down; }
290    Mod+WheelScrollUp        cooldown-ms=150 { focus-workspace-up; }
291    Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
292    Mod+Ctrl+WheelScrollUp   cooldown-ms=150 { move-column-to-workspace-up; }
293
294    Mod+WheelScrollRight      { focus-column-right; }
295    Mod+WheelScrollLeft       { focus-column-left; }
296    Mod+Ctrl+WheelScrollRight { move-column-right; }
297    Mod+Ctrl+WheelScrollLeft  { move-column-left; }
298
299    // Usually scrolling up and down with Shift in applications results in
300    // horizontal scrolling; these binds replicate that.
301    Mod+Shift+WheelScrollDown      { focus-column-right; }
302    Mod+Shift+WheelScrollUp        { focus-column-left; }
303    Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
304    Mod+Ctrl+Shift+WheelScrollUp   { move-column-left; }
305
306    // The following binds move the focused window in and out of a column.
307    // If the window is alone, they will consume it into the nearby column to the side.
308    // If the window is already in a column, they will expel it out.
309    Mod+BracketLeft  { consume-or-expel-window-left; }
310    Mod+BracketRight { consume-or-expel-window-right; }
311
312    // Consume one window from the right to the bottom of the focused column.
313    Mod+Comma  { consume-window-into-column; }
314    // Expel the bottom window from the focused column to the right.
315    Mod+Period { expel-window-from-column; }
316
317    Mod+R { switch-preset-column-width; }
318    Mod+Shift+R { switch-preset-window-height; }
319    Mod+Ctrl+R { reset-window-height; }
320    Mod+F { maximize-column; }
321    Mod+Shift+F { fullscreen-window; }
322
323    // Expand the focused column to space not taken up by other fully visible columns.
324    // Makes the column "fill the rest of the space".
325    Mod+Ctrl+F { expand-column-to-available-width; }
326
327    Mod+C { center-column; }
328
329    // Center all fully visible columns on screen.
330    Mod+Ctrl+C { center-visible-columns; }
331
332    // Finer width adjustments.
333    // This command can also:
334    // * set width in pixels: "1000"
335    // * adjust width in pixels: "-5" or "+5"
336    // * set width as a percentage of screen width: "25%"
337    // * adjust width as a percentage of screen width: "-10%" or "+10%"
338    // Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0,
339    // set-column-width "100" will make the column occupy 200 physical screen pixels.
340    Mod+Minus { set-column-width "-10%"; }
341    Mod+Equal { set-column-width "+10%"; }
342
343    // Finer height adjustments when in column with other windows.
344    Mod+Shift+Minus { set-window-height "-10%"; }
345    Mod+Shift+Equal { set-window-height "+10%"; }
346
347    // Move the focused window between the floating and the tiling layout.
348    Mod+V       { toggle-window-floating; }
349    Mod+Shift+V { switch-focus-between-floating-and-tiling; }
350
351    // Toggle tabbed column display mode.
352    // Windows in this column will appear as vertical tabs,
353    // rather than stacked on top of each other.
354    Mod+W { toggle-column-tabbed-display; }
355
356    // Actions to switch layouts.
357    Mod+Space       { switch-layout "next"; }
358    Mod+Shift+Space { switch-layout "prev"; }
359
360    XF86SelectiveScreenshot { screenshot; }
361    Print { screenshot-screen; }
362    Ctrl+Print { screenshot; }
363    Alt+Print { screenshot-window; }
364
365    // Applications such as rEmote-desktop clients and software KVM switches may
366    // request that niri stops processing the keyboard shortcuts defined here
367    // so they may, for example, forward the key presses as-is to a remote machine.
368    // It's a good idea to bind an escape hatch to toggle the inhibitor,
369    // so a buggy application can't hold your session hostage.
370    //
371    // The allow-inhibiting=false property can be applied to other binds as well,
372    // which ensures niri always processes them, even when an inhibitor is active.
373    Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
374
375    // The quit action will show a confirmation dialog to avoid accidental exits.
376    Mod+Shift+E { quit; }
377    Ctrl+Alt+Delete { quit; }
378
379    // Powers off the monitors. To turn them back on, do any input like
380    // moving the mousg or pressing any other key.
381    Mod+Shift+P { power-off-monitors; }
382}