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