diff options
| author | Martin Fischer <martin@push-f.com> | 2026-10-02 18:26:19 +0200 |
|---|---|---|
| committer | Martin Fischer <martin@push-f.com> | 2026-10-07 19:33:00 +0200 |
| commit | 49afa138aa61252de9162478493e672a0afc9431 (patch) | |
| tree | 214f7c218ada4d10cbc9db7b779f3752f7bf199d | |
| parent | 646ed1c5739e6500afd54a44e36b3a8edbb0e320 (diff) | |
tweak(workstation): use niri instead of sway
| -rw-r--r-- | nixos/profiles/workstation/default.nix | 1 | ||||
| -rw-r--r-- | nixos/profiles/workstation/graphical.nix | 13 | ||||
| -rw-r--r-- | user/i3bar-river/config.toml | 17 | ||||
| -rw-r--r-- | user/niri/config.kdl | 178 | ||||
| -rw-r--r-- | user/sway/config | 2 |
5 files changed, 109 insertions, 102 deletions
diff --git a/nixos/profiles/workstation/default.nix b/nixos/profiles/workstation/default.nix index 67e5a8d..8529ec9 100644 --- a/nixos/profiles/workstation/default.nix +++ b/nixos/profiles/workstation/default.nix @@ -38,6 +38,7 @@ in "networkmanager" "dialout" "wireshark" + "video" # allow brightnessctl to write backlight brightness via udev rule ]; }; diff --git a/nixos/profiles/workstation/graphical.nix b/nixos/profiles/workstation/graphical.nix index 8336159..756bcf2 100644 --- a/nixos/profiles/workstation/graphical.nix +++ b/nixos/profiles/workstation/graphical.nix @@ -13,6 +13,7 @@ hardware.bluetooth.enable = true; services.upower.enable = true; + services.udev.packages = [pkgs.brightnessctl]; systemd.user.services.serve = { after = ["network.target"]; @@ -28,21 +29,29 @@ # Packages + programs.niri.enable = true; + # The niri module enables the gnome keyring by default. + services.gnome.gnome-keyring.enable = false; + xdg.portal.config.niri."org.freedesktop.impl.portal.Secret" = pkgs.lib.mkForce "none"; + + # I'm still keeping sway around because niri doesn't support device-specific input config. + # (https://github.com/niri-wm/niri/issues/371) programs.sway = { enable = true; extraPackages = []; # Execute sway with required environment variables for GTK apps. wrapperFeatures.gtk = true; }; + programs.ssh.startAgent = true; - # without dbus-run-session opening links in Zed fails with "No Apps available" environment.loginShellInit = '' - [[ "$(tty)" == /dev/tty1 ]] && exec dbus-run-session sway + [[ "$(tty)" == /dev/tty1 ]] && exec niri-session -l ''; environment.systemPackages = with pkgs; [ wmenu + i3bar-river swayidle swaylock diff --git a/user/i3bar-river/config.toml b/user/i3bar-river/config.toml new file mode 100644 index 0000000..e0d93b3 --- /dev/null +++ b/user/i3bar-river/config.toml @@ -0,0 +1,17 @@ +command = "i3status-rs" +position = "bottom" +layer = "top" + +background = "#323232ff" +color = "#ffffffff" +separator = "#5c5c5cff" +tags_padding = 10.0 + +tag_fg = "#ffffffff" +tag_bg = "#32323200" +tag_focused_fg = "#ffffffff" +tag_focused_bg = "#285577ff" +tag_urgent_fg = "#ffffffff" +tag_urgent_bg = "#cc241dff" +tag_inactive_fg = "#5c5c5cff" +tag_inactive_bg = "#32323200" diff --git a/user/niri/config.kdl b/user/niri/config.kdl index ccad1ac..750d5f3 100644 --- a/user/niri/config.kdl +++ b/user/niri/config.kdl @@ -9,16 +9,7 @@ input { keyboard { xkb { - // You can set rules, model, layout, variant and options. - // For more information, see xkeyboard-config(7). - - // For example: - // layout "us,ru" - // options "grp:win_space_toggle,compose:ralt,ctrl:nocaps" - - // If this section is empty, niri will fetch xkb settings - // from org.freedesktop.locale1. You can control these using - // localectl set-x11-keymap. + file "~/config/colematik/colematik.xkb" } // Enable numlock on startup, omitting this setting disables it. @@ -35,7 +26,7 @@ input { // dwtp // drag false // drag-lock - natural-scroll + // natural-scroll // accel-speed 0.2 // accel-profile "flat" // scroll-method "two-finger" @@ -69,11 +60,22 @@ input { // focus-follows-mouse max-scroll-amount="0%" } +cursor { + xcursor-theme "Capitaine Cursors (Gruvbox)" + xcursor-size 24 +} + // You can configure outputs by their name, which you can find // by running `niri msg outputs` while inside a niri instance. // The built-in laptop monitor is usually called "eDP-1". // Find more information on the wiki: // https://niri-wm.github.io/niri/Configuration:-Outputs + +// Active laptop display configuration. +output "eDP-1" { + scale 1 +} + // Remember to uncomment the node by removing "/-"! /-output "eDP-1" { // Uncomment this line to disable this output. @@ -267,15 +269,21 @@ layout { // which may be more convenient to use. // See the binds section below for more spawn examples. -// This line starts waybar, a commonly used bar for Wayland compositors. -spawn-at-startup "waybar" +// Start the bar. +spawn-at-startup "i3bar-river" + +// Show power/battery notifications. +spawn-at-startup "poweralertd" + +// Lock the screen before the system goes to sleep. +spawn-at-startup "swayidle" "-w" "before-sleep" "swaylock -f" // To run a shell command (with variables, pipes, etc.), use spawn-sh-at-startup: // spawn-sh-at-startup "qs -c ~/source/qs/MyAwesomeShell" hotkey-overlay { - // Uncomment this line to disable the "Important Hotkeys" pop-up at startup. - // skip-at-startup + // Disable the "Important Hotkeys" pop-up at startup. + skip-at-startup } // Uncomment this line to ask the clients to omit their client-side decorations if possible. @@ -283,7 +291,7 @@ hotkey-overlay { // Additionally, clients will be informed that they are tiled, removing some client-side rounded corners. // This option will also fix border/focus ring drawing behind some semitransparent windows. // After enabling or disabling this, you need to restart the apps for this to take effect. -// prefer-no-csd +prefer-no-csd // You can change the path where screenshots are saved. // A ~ at the front will be expanded to the home directory. @@ -362,9 +370,9 @@ binds { Mod+Shift+Slash { show-hotkey-overlay; } // Suggested binds for running programs: terminal, app launcher, screen locker. - Mod+T hotkey-overlay-title="Open a Terminal: alacritty" { spawn "alacritty"; } - Mod+D hotkey-overlay-title="Run an Application: fuzzel" { spawn "fuzzel"; } - Super+Alt+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn "swaylock"; } + Mod+Return hotkey-overlay-title="Open a Terminal" { spawn "foot"; } + Mod+D hotkey-overlay-title="Run an Application" { spawn "wmenu-run"; } + Super+Alt+L hotkey-overlay-title="Lock the Screen" { spawn "swaylock"; } // Use spawn-sh to run a shell command. Do this if you need pipes, multiple commands, etc. // Note: the entire command goes as a single argument. It's passed verbatim to `sh -c`. @@ -404,49 +412,44 @@ binds { Mod+Down { focus-window-down; } Mod+Up { focus-window-up; } Mod+Right { focus-column-right; } - Mod+H { focus-column-left; } - Mod+J { focus-window-down; } - Mod+K { focus-window-up; } - Mod+L { focus-column-right; } + Mod+K { focus-column-left; } + Mod+N { focus-window-down; } + Mod+E { focus-window-up; } + Mod+I { focus-column-right; } - Mod+Ctrl+Left { move-column-left; } - Mod+Ctrl+Down { move-window-down; } - Mod+Ctrl+Up { move-window-up; } - Mod+Ctrl+Right { move-column-right; } - Mod+Ctrl+H { move-column-left; } - Mod+Ctrl+J { move-window-down; } - Mod+Ctrl+K { move-window-up; } - Mod+Ctrl+L { move-column-right; } + Mod+Shift+Left { move-column-left; } + Mod+Shift+Down { move-window-down; } + Mod+Shift+Up { move-window-up; } + Mod+Shift+Right { move-column-right; } + Mod+Shift+K { move-column-left; } + Mod+Shift+N { move-window-down; } + Mod+Shift+E { move-window-up; } + Mod+Shift+I { move-column-right; } // Alternative commands that move across workspaces when reaching // the first or last window in a column. - // Mod+J { focus-window-or-workspace-down; } - // Mod+K { focus-window-or-workspace-up; } - // Mod+Ctrl+J { move-window-down-or-to-workspace-down; } - // Mod+Ctrl+K { move-window-up-or-to-workspace-up; } + // Mod+N { focus-window-or-workspace-down; } + // Mod+E { focus-window-or-workspace-up; } + // Mod+Shift+N { move-window-down-or-to-workspace-down; } + // Mod+Shift+E { move-window-up-or-to-workspace-up; } - 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+H { focus-monitor-left; } - Mod+Shift+J { focus-monitor-down; } - Mod+Shift+K { focus-monitor-up; } - Mod+Shift+L { focus-monitor-right; } + Mod+Ctrl+Left { focus-monitor-left; } + Mod+Ctrl+Down { focus-monitor-down; } + Mod+Ctrl+Up { focus-monitor-up; } + Mod+Ctrl+Right { focus-monitor-right; } + Mod+Ctrl+K { focus-monitor-left; } + Mod+Ctrl+N { focus-monitor-down; } + Mod+Ctrl+E { focus-monitor-up; } + Mod+Ctrl+I { 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; } - Mod+Shift+Ctrl+H { move-column-to-monitor-left; } - Mod+Shift+Ctrl+J { move-column-to-monitor-down; } - Mod+Shift+Ctrl+K { move-column-to-monitor-up; } - Mod+Shift+Ctrl+L { move-column-to-monitor-right; } + Mod+Shift+Ctrl+K { move-column-to-monitor-left; } + Mod+Shift+Ctrl+N { move-column-to-monitor-down; } + Mod+Shift+Ctrl+E { move-column-to-monitor-up; } + Mod+Shift+Ctrl+I { move-column-to-monitor-right; } // Alternatively, there are commands to move just a single window: // Mod+Shift+Ctrl+Left { move-window-to-monitor-left; } @@ -456,48 +459,25 @@ binds { // Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; } // ... - Mod+Page_Down { focus-workspace-down; } - Mod+Page_Up { focus-workspace-up; } - Mod+U { focus-workspace-down; } - Mod+I { focus-workspace-up; } - Mod+Ctrl+Page_Down { move-column-to-workspace-down; } - Mod+Ctrl+Page_Up { move-column-to-workspace-up; } - Mod+Ctrl+U { move-column-to-workspace-down; } - Mod+Ctrl+I { move-column-to-workspace-up; } + Mod+Page_Down { focus-workspace-down; } + Mod+Page_Up { focus-workspace-up; } + Mod+L { focus-workspace-down; } + Mod+U { focus-workspace-up; } + Mod+Shift+Page_Down { move-column-to-workspace-down; } + Mod+Shift+Page_Up { move-column-to-workspace-up; } + Mod+Shift+L { move-column-to-workspace-down; } + Mod+Shift+U { 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-window-to-workspace-down; } // ... - Mod+Shift+Page_Down { move-workspace-down; } - Mod+Shift+Page_Up { move-workspace-up; } - Mod+Shift+U { move-workspace-down; } - Mod+Shift+I { move-workspace-up; } - - // You can bind mouse wheel scroll ticks using the following syntax. - // These binds will change direction based on the natural-scroll setting. - // - // To avoid scrolling through workspaces really fast, you can use - // the cooldown-ms property. The bind will be rate-limited to this value. - // You can set a cooldown on any bind, but it's most useful for the wheel. - 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; } + Mod+Ctrl+Shift+Page_Down { move-workspace-down; } + Mod+Ctrl+Shift+Page_Up { move-workspace-up; } + Mod+Ctrl+Shift+L { move-workspace-down; } + Mod+Ctrl+Shift+U { move-workspace-up; } - // Similarly, you can bind touchpad scroll "ticks". + // You can bind touchpad scroll "ticks". // Touchpad scrolling is continuous, so for these binds it is split into // discrete intervals. // These binds are also affected by touchpad's natural-scroll, so these @@ -523,15 +503,15 @@ binds { Mod+7 { focus-workspace 7; } Mod+8 { focus-workspace 8; } Mod+9 { focus-workspace 9; } - Mod+Ctrl+1 { move-column-to-workspace 1; } - Mod+Ctrl+2 { move-column-to-workspace 2; } - Mod+Ctrl+3 { move-column-to-workspace 3; } - Mod+Ctrl+4 { move-column-to-workspace 4; } - Mod+Ctrl+5 { move-column-to-workspace 5; } - Mod+Ctrl+6 { move-column-to-workspace 6; } - Mod+Ctrl+7 { move-column-to-workspace 7; } - Mod+Ctrl+8 { move-column-to-workspace 8; } - Mod+Ctrl+9 { move-column-to-workspace 9; } + Mod+Shift+1 { move-column-to-workspace 1; } + Mod+Shift+2 { move-column-to-workspace 2; } + Mod+Shift+3 { move-column-to-workspace 3; } + Mod+Shift+4 { move-column-to-workspace 4; } + Mod+Shift+5 { move-column-to-workspace 5; } + Mod+Shift+6 { move-column-to-workspace 6; } + Mod+Shift+7 { move-column-to-workspace 7; } + Mod+Shift+8 { move-column-to-workspace 8; } + Mod+Shift+9 { move-column-to-workspace 9; } // Alternatively, there are commands to move just a single window: // Mod+Ctrl+1 { move-window-to-workspace 1; } @@ -623,7 +603,7 @@ binds { 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; } + Mod+Shift+Q { quit; } Ctrl+Alt+Delete { quit; } // Powers off the monitors. To turn them back on, do any input like diff --git a/user/sway/config b/user/sway/config index 6f50677..a5d09a4 100644 --- a/user/sway/config +++ b/user/sway/config @@ -77,7 +77,7 @@ input "10429:514:Hanvon_Ugee_Shortcut_Remote_Keyboard" { bindsym $mod+Return exec $term # Kill focused window - bindsym $mod+Shift+c kill + bindsym $mod+q kill # Start your launcher bindsym $mod+d exec $menu |
