Commit 75ace48b6c79
Changed files (2)
dots
.config
niri
dots/.config/niri/config.kdl
@@ -0,0 +1,356 @@
+// Vincent Demeester niri configuration.
+// This config is in the KDL format: https://kdl.dev
+// "/-" comments out the following node.
+// Check the wiki for a full description of the configuration:
+// https://github.com/YaLTeR/niri/wiki/Configuration:-Introduction
+
+input {
+ keyboard {
+ xkb {
+ layout "us,fr,fr"
+ variant "intl,bepo,ergol"
+ options "grp:menu_toggle,grp_led:caps,compose:caps"
+ }
+ numlock
+ }
+ touchpad {
+ tap
+ natural-scroll
+ }
+}
+
+output "eDP-1" {
+ mode "1920x1080@120.030"
+ scale 1
+ transform "normal"
+ position x=0 y=1440
+}
+
+output "LG Electronics LG ULTRAWIDE 0x0005D10C" {
+ mode "3440x1440@59.973"
+ scale 1
+ transform "normal"
+ position x=0 y=0
+}
+
+hotkey-overlay {
+ skip-at-startup
+}
+
+layout {
+ gaps 6
+ center-focused-column "never"
+
+ preset-column-widths {
+ // The default preset widths are 1/3, 1/2 and 2/3 of the output.
+ proportion 0.33333
+ proportion 0.5
+ proportion 0.66667
+ }
+
+ default-column-width { proportion 0.5; }
+
+ focus-ring {
+ off
+ width 2
+ active-color "#7fc8ff"
+ inactive-color "#505050"
+ }
+
+ border {
+ width 2
+ active-color "#ffc87f"
+ inactive-color "#505050"
+ urgent-color "#9b0000"
+ }
+ // Struts shrink the area occupied by windows, similarly to layer-shell panels.
+ // You can think of them as a kind of outer gaps. They are set in logical pixels.
+ // Left and right struts will cause the next window to the side to always be visible.
+ // Top and bottom struts will simply add outer gaps in addition to the area occupied by
+ // layer-shell panels and regular gaps.
+ struts {
+ left 6
+ right 6
+ // top 12
+ // bottom 12
+ }
+}
+
+spawn-at-startup "dbus-update-activation-environment" "--systemd" "WAYLAND_DISPLAY" "DISPLAY" "DBUS_SESSION_BUS_ADDRESS" "SWAYSOCK" "XDG_SESSION_TYPE" "XDG_SESSION_DESKTOP" "XDG_CURRENT_DESKTOP"
+spawn-at-startup "dbus-update-activation-environment" "--systemd" "--all"
+spawn-at-startup "emacs" "--fg-daemon"
+spawn-at-startup "battery-monitor"
+spawn-at-startup "waybar"
+// FIXME should be through systemd
+spawn-at-startup "yubikey-agent" "-l" "/run/user/1000/yubikey-agent/yubikey-agent.sock"
+spawn-at-startup "swaybg" "-i" "/home/vincent/desktop/pictures/lockscreen"
+
+prefer-no-csd
+
+// screenshot-path "~/desktop/pictures/screenshots/$(hostname)/%Y-%m-%d-%H%M%S.png"
+screenshot-path "~/desktop/pictures/screenshots/kyushu/%Y-%m-%d-%H%M%S.png"
+
+animations {
+ // Uncomment to turn off all animations.
+ // off
+
+ // Slow down all animations by this factor. Values below 1 speed them up instead.
+ // slowdown 3.0
+}
+
+window-rule {
+ // This regular expression is intentionally made as specific as possible,
+ // since this is the default config, and we want no false positives.
+ // You can get away with just app-id="wezterm" if you want.
+ match app-id=r#"^org\.wezfurlong\.wezterm$"#
+ default-column-width {}
+}
+
+// Open the Firefox picture-in-picture player as floating by default.
+window-rule {
+ // This app-id regular expression will work for both:
+ // - host Firefox (app-id is "firefox")
+ // - Flatpak Firefox (app-id is "org.mozilla.firefox")
+ match app-id=r#"firefox$"# title="^Picture-in-Picture$"
+ open-floating true
+}
+
+window-rule {
+ match is-floating=true
+ shadow {
+ on
+ }
+}
+
+// Example: block out two password managers from screen capture.
+// (This example rule is commented out with a "/-" in front.)
+/-window-rule {
+ match app-id=r#"^org\.keepassxc\.KeePassXC$"#
+ match app-id=r#"^org\.gnome\.World\.Secrets$"#
+
+ block-out-from "screen-capture"
+
+ // Use this instead if you want them visible on third-party screenshot tools.
+ // block-out-from "screencast"
+}
+
+// Example: enable rounded corners for all windows.
+// (This example rule is commented out with a "/-" in front.)
+window-rule {
+ geometry-corner-radius 6
+ clip-to-geometry true
+}
+
+binds {
+ // Keys consist of modifiers separated by + signs, followed by an XKB key name
+ // in the end. To find an XKB name for a particular key, you may use a program
+ // like wev.
+ //
+ // "Mod" is a special modifier equal to Super when running on a TTY, and to Alt
+ // when running as a winit window.
+ //
+ // Most actions that you can bind here can also be invoked programmatically with
+ // `niri msg action do-something`.
+
+ Mod+Shift+Slash { show-hotkey-overlay; }
+
+ // Mod+T hotkey-overlay-title="Open a Terminal: kitty" { spawn "kitty"; }
+ Mod+M { spawn "kitten" "quick-access-terminal"; }
+ Mod+Return hotkey-overlay-title="Open a Terminal" { spawn "kitty"; }
+ Mod+Shift+Return hotkey-overlay-title="Open Emacs (client)" { spawn "emacsclient" "-c"; }
+ Mod+Control+Return hotkey-overlay-title="Open Emacs" { spawn "emacs"; }
+ Mod+Control+Alt+Return hotkey-overlay-title="Open Emacs Anywhere" { spawn "emacsclient" "-eval" "(vde/type)"; }
+ Mod+D hotkey-overlay-title="Run an Application" { spawn "fuzzel"; }
+ Mod+Shift+D hotkey-overlay-title="Run Raffi" { spawn "raffi" "-I"; }
+ // FIXME do not use nix run, but needs niri configuration
+ Mod+Control+D hotkey-overlay-title="Emoji picker" { spawn "rofimoji" "--selector" "fuzzel" "--clipboarder" "wl-copy" "--typer" "wtype" "--action" "type" "copy"; }
+ Super+Alt+L hotkey-overlay-title="Lock the Screen" { spawn "swaylock" "-m" "fill" "-i" "/home/vincent/desktop/pictures/lockscreen"; }
+
+ // You can also use a shell. Do this if you need pipes, multiple commands, etc.
+ // Note: the entire command goes as a single argument in the end.
+ // Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; }
+ // bindcode ${mod}+42 exec wl-kbptr -o modes=floating','click -o mode_floating.source=detect
+ // bindcode ${mod}+Shift+42 mode Mouse
+ Mod+E hotkey-overlay-title="Mouse click" { spawn "wl-kbptr" "-o" "modes=floating,click" "-o" "mode_floating.source=detect";}
+
+ Mod+T { spawn "bash" "-c" "notify-send --icon=clock --category=info --urgency=critical \"$(date +\"%I:%M\")\""; }
+ Mod+B { spawn "bash" "-c" "notify-send --icon=battery --category=info --urgency=critical \"$(acpi)\""; }
+
+ Mod+Shift+B { spawn "pkill" "-USR1" "waybar"; }
+
+ // Example volume keys mappings for PipeWire & WirePlumber.
+ // The allow-when-locked=true property makes them work even when the session is locked.
+ XF86AudioRaiseVolume allow-when-locked=true { spawn "volumectl" "-u" "up"; }
+ XF86AudioLowerVolume allow-when-locked=true { spawn "volumectl" "-u" "down"; }
+ XF86AudioMute allow-when-locked=true { spawn "volumectl" "toggle-mute"; }
+
+ XF86AudioMicMute allow-when-locked=true { spawn "volumectl" "-m" "toggle-mute"; }
+ Ctrl+XF86AudioRaiseVolume allow-when-locked=true { spawn "volumectl" "-u" "-m" "up"; }
+ Ctrl+XF86AudioLowerVolume allow-when-locked=true { spawn "volumectl" "-u" "-m" "down"; }
+
+ XF86AudioPlay allow-when-locked=true { spawn "playerctl" "play-pause"; }
+ XF86Messenger allow-when-locked=true { spawn "playerctl" "play-pause"; }
+ XF86Favorites allow-when-locked=true { spawn "playerctl" "play-pause"; }
+ XF86AudioNext allow-when-locked=true { spawn "playerctl" "next"; }
+ XF86Go allow-when-locked=true { spawn "playerctl" "next"; }
+ XF86AudioPrev allow-when-locked=true { spawn "playerctl" "previous"; }
+ Cancel allow-when-locked=true { spawn "playerctl" "previous"; }
+
+ XF86MonBrightnessUp allow-when-locked=true { spawn "lightctl" "up"; }
+ XF86MonBrightnessDown allow-when-locked=true { spawn "lightctl" "down"; }
+ // Shift+XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "set" "1%+"; }
+ // Shift+XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "set" "1%-"; }
+
+ // Open/close the Overview: a zoomed-out view of workspaces and windows.
+ // You can also move the mouse into the top-left hot corner,
+ // or do a four-finger swipe up on a touchpad.
+ Mod+O repeat=false { toggle-overview; }
+
+ Mod+Q { close-window; }
+ Mod+Shift+Q { spawn "wlogout"; }
+
+ Mod+Left { focus-column-left; }
+ Mod+Down { focus-window-or-workspace-down; }
+ Mod+Up { focus-window-or-workspace-up; }
+ // Mod+Down { focus-window-down; }
+ // Mod+Up { focus-window-up; }
+ Mod+Right { focus-column-right; }
+
+ Mod+Ctrl+Left { move-column-left; }
+ // Mod+Ctrl+Down { move-window-down; }
+ // Mod+Ctrl+Up { move-window-up; }
+ Mod+Ctrl+Down { move-window-down-or-to-workspace-down; }
+ Mod+Ctrl+Up { move-window-up-or-to-workspace-up; }
+ Mod+Ctrl+Right { move-column-right; }
+
+ Mod+Home { focus-column-first; }
+ Mod+End { focus-column-last; }
+ Mod+Ctrl+Home { move-column-to-first; }
+ Mod+Ctrl+End { move-column-to-last; }
+
+ Mod+Shift+Left { focus-monitor-left; }
+ Mod+Shift+Down { focus-monitor-down; }
+ Mod+Shift+Up { focus-monitor-up; }
+ Mod+Shift+Right { focus-monitor-right; }
+
+ Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
+ Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
+ Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
+ Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
+
+ // Alternatively, there are commands to move just a single window:
+ // Mod+Shift+Ctrl+Left { move-window-to-monitor-left; }
+ // ...
+
+ // And you can also move a whole workspace to another monitor:
+ // Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; }
+ // ...
+ Mod+Page_Down { move-workspace-to-monitor-next; }
+ Mod+Page_Up { move-workspace-to-monitor-previous; }
+
+ // Mod+Page_Down { focus-workspace-down; }
+ // Mod+Page_Up { focus-workspace-up; }
+ Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
+ Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
+
+ // Alternatively, there are commands to move just a single window:
+ // Mod+Ctrl+Page_Down { move-window-to-workspace-down; }
+ // ...
+
+ Mod+Shift+Page_Down { move-workspace-down; }
+ Mod+Shift+Page_Up { move-workspace-up; }
+
+ Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
+ Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
+ Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
+ Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
+
+ Mod+WheelScrollRight { focus-column-right; }
+ Mod+WheelScrollLeft { focus-column-left; }
+ Mod+Ctrl+WheelScrollRight { move-column-right; }
+ Mod+Ctrl+WheelScrollLeft { move-column-left; }
+
+ // Usually scrolling up and down with Shift in applications results in
+ // horizontal scrolling; these binds replicate that.
+ Mod+Shift+WheelScrollDown { focus-column-right; }
+ Mod+Shift+WheelScrollUp { focus-column-left; }
+ Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
+ Mod+Ctrl+Shift+WheelScrollUp { move-column-left; }
+
+ // The following binds move the focused window in and out of a column.
+ // If the window is alone, they will consume it into the nearby column to the side.
+ // If the window is already in a column, they will expel it out.
+ Mod+BracketLeft { consume-or-expel-window-left; }
+ Mod+BracketRight { consume-or-expel-window-right; }
+
+ // Consume one window from the right to the bottom of the focused column.
+ Mod+Comma { consume-window-into-column; }
+ // Expel the bottom window from the focused column to the right.
+ Mod+Period { expel-window-from-column; }
+
+ Mod+R { switch-preset-column-width; }
+ Mod+Shift+R { switch-preset-window-height; }
+ Mod+Ctrl+R { reset-window-height; }
+ Mod+F { maximize-column; }
+ Mod+Shift+F { fullscreen-window; }
+
+ // Expand the focused column to space not taken up by other fully visible columns.
+ // Makes the column "fill the rest of the space".
+ Mod+Ctrl+F { expand-column-to-available-width; }
+
+ Mod+C { center-column; }
+
+ // Center all fully visible columns on screen.
+ Mod+Ctrl+C { center-visible-columns; }
+
+ // Finer width adjustments.
+ // This command can also:
+ // * set width in pixels: "1000"
+ // * adjust width in pixels: "-5" or "+5"
+ // * set width as a percentage of screen width: "25%"
+ // * adjust width as a percentage of screen width: "-10%" or "+10%"
+ // Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0,
+ // set-column-width "100" will make the column occupy 200 physical screen pixels.
+ Mod+Minus { set-column-width "-10%"; }
+ Mod+Equal { set-column-width "+10%"; }
+
+ // Finer height adjustments when in column with other windows.
+ Mod+Shift+Minus { set-window-height "-10%"; }
+ Mod+Shift+Equal { set-window-height "+10%"; }
+
+ // Move the focused window between the floating and the tiling layout.
+ Mod+V { toggle-window-floating; }
+ Mod+Shift+V { switch-focus-between-floating-and-tiling; }
+
+ // Toggle tabbed column display mode.
+ // Windows in this column will appear as vertical tabs,
+ // rather than stacked on top of each other.
+ Mod+W { toggle-column-tabbed-display; }
+
+ // Actions to switch layouts.
+ Mod+Space { switch-layout "next"; }
+ Mod+Shift+Space { switch-layout "prev"; }
+
+ XF86SelectiveScreenshot { screenshot; }
+ Print { screenshot-screen; }
+ Ctrl+Print { screenshot; }
+ Alt+Print { screenshot-window; }
+
+ // Applications such as rEmote-desktop clients and software KVM switches may
+ // request that niri stops processing the keyboard shortcuts defined here
+ // so they may, for example, forward the key presses as-is to a remote machine.
+ // It's a good idea to bind an escape hatch to toggle the inhibitor,
+ // so a buggy application can't hold your session hostage.
+ //
+ // The allow-inhibiting=false property can be applied to other binds as well,
+ // which ensures niri always processes them, even when an inhibitor is active.
+ Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
+
+ // The quit action will show a confirmation dialog to avoid accidental exits.
+ Mod+Shift+E { quit; }
+ Ctrl+Alt+Delete { quit; }
+
+ // Powers off the monitors. To turn them back on, do any input like
+ // moving the mousg or pressing any other key.
+ Mod+Shift+P { power-off-monitors; }
+}
dots/Makefile
@@ -0,0 +1,38 @@
+makefile := $(abspath $(lastword $(MAKEFILE_LIST)))
+dotfiles := $(abspath $(dir $(makefile)))
+
+~ := $(abspath $(dotfiles))
+
+force:
+
+define rule.template
+$(1)/% : $(2)/% force
+ @echo "๐ Copying $$< โ $$@"
+ @mkdir -p $$(@D)
+ @cp -f $$< $$@
+endef
+
+rule.define = $(eval $(call rule.template,$(1),$(2)))
+
+
+$(call rule.define,~,$(~))
+
+all += niri
+niri : ~/.config/niri/config.kdl
+
+# Example: Override default rule to generate content instead of copying
+# Uncomment and customize this pattern for files that should be generated:
+#
+# ~/.config/example/generated.conf : force
+# @echo "โ๏ธ Generating $$@"
+# @mkdir -p $(@D)
+# @echo "# Generated on $$(date)" > $@
+# @echo "setting1=value1" >> $@
+# @echo "setting2=value2" >> $@
+
+all : $(all)
+ @echo "โ
All dotfiles installed!"
+
+.PHONY: all $(all)
+.DEFAULT_GOAL := all
+