niri.md (9120B)
1 # niri — Niri + Noctalia, every key and command 2 3 Niri **26.04** (scrolling columns: windows sit in columns on an endless strip, workspaces stack vertically) with 4 **Noctalia 4.7.7** as bar, launcher, notifications, lock screen and wallpaper. Both are wrapped packages built from 5 `modules/features/desktop/niri.nix` and `noctalia.nix`; Rosé Pine Main throughout. 6 Terminal card: **`niri-cheat`** — sections `model apps shell windows move resize workspaces media screenshots ipc msg wallpaper settings session fix`. 7 `Mod` = **Super** in a real login, **Alt** when nested via `nix run ~/NixDaemon#niri`. 8 9 ## model — columns, windows, workspaces 10 11 ```text 12 workspace one per row; Mod+1..9 or the mouse wheel moves between them. Always one empty one at the bottom. 13 column the unit you scroll through left/right. New windows open as a new column to the right. 14 window a column holds one or more windows stacked vertically (Mod+J/K moves between them). 15 overview Mod+O zooms out over every workspace; click or arrow to pick, Mod+O again to leave. 16 ``` 17 18 - Nothing is ever "off screen" in a bad way: the strip just scrolls. Mod+H/L to walk it. 19 - Column widths come from presets (⅓, ½, ⅔); Mod+F maximises one column, Mod+G is true fullscreen. 20 21 ## apps — launch 22 23 ```text 24 Mod+Return kitty 25 Mod+Shift+Return firefox Mod+Shift+B firefox 26 Mod+Shift+Alt+B firefox private window 27 Mod+Shift+F nautilus (new window) 28 Mod+Shift+O obsidian 29 Mod+Shift+N kitty running $EDITOR (nano if unset) 30 ``` 31 32 ## shell — Noctalia keys 33 34 ```text 35 Mod+Space launcher (apps; type > for commands) Mod+Alt+Space same 36 Mod+Ctrl+V launcher → clipboard history (cliphist) 37 Mod+A control centre (wifi, bluetooth, volume, settings gear) 38 Mod+Escape session menu (lock / suspend / logout / reboot / shutdown) Mod+Ctrl+P same 39 Mod+Shift+Escape lock now 40 Mod+Comma clear notifications 41 Mod+Ctrl+Space wallpaper picker 42 right-click the bar Noctalia settings 43 the blue snowflake left end = launcher, right end = control centre (the NixOS logo, set in noctalia.nix) 44 ``` 45 46 ## windows — focus and state 47 48 ```text 49 Mod+H / Mod+Left focus column left 50 Mod+L / Mod+Right focus column right 51 Mod+J / Mod+Down focus window below (same column) 52 Mod+K / Mod+Up focus window above 53 Mod+Q close window 54 Mod+F maximise column (toggle) 55 Mod+G fullscreen window (toggle) 56 Mod+Shift+V toggle floating 57 Mod+O overview 58 Mod+Shift+/ niri's own hotkey overlay (the full live list) 59 ``` 60 61 Focus follows the mouse. 62 63 ## move — rearrange 64 65 ```text 66 Mod+Shift+H / Shift+Left move column left 67 Mod+Shift+L / Shift+Right move column right 68 Mod+Shift+J / Shift+Down move window down (within / out of the column) 69 Mod+Shift+K / Shift+Up move window up 70 Mod+Shift+1..9 move column to workspace N 71 Mod+[ stack window into the column on the left (under it) 72 Mod+] stack window into the column on the right (under it) 73 (pressed on a stacked window: pops it back out to its own column) 74 Mod+. pop the bottom window out of the column 75 Mod+W column as tabs (toggle) 76 ``` 77 78 Stacking two windows: focus the right one, `Mod+[` — it slides under the left one. 79 Inside a column, `Mod+Shift+J/K` reorders them. 80 81 ## resize — width and height 82 83 ```text 84 Mod+Ctrl+H column width −5% Mod+Ctrl+L column width +5% 85 Mod+Ctrl+J window height −5% Mod+Ctrl+K window height +5% 86 ``` 87 88 ```text 89 Mod+R cycle column width ⅓ → ½ → ⅔ 90 Mod+Shift+R cycle window height ⅓ → ½ → ⅔ 91 Mod+= column width ½ (do it on two columns → even side by side) 92 Mod+Ctrl+R reset window height (do it on each stacked window → even split) 93 Mod+Ctrl+F stretch column into the free space on screen 94 Mod+C centre column 95 ``` 96 97 ## workspaces 98 99 ```text 100 Mod+1..9 focus workspace N 101 Mod+Shift+1..9 move focused column to workspace N 102 Mod+WheelDown / Up next / previous workspace (150 ms cooldown) 103 ``` 104 105 ## media — hardware keys (also work on the lock screen) 106 107 ```text 108 XF86AudioRaiseVolume / Lower volume ±5% (cap 140%) XF86AudioMute / MicMute toggle 109 XF86MonBrightnessUp / Down brightness ±5% 110 XF86AudioPlay / Pause play-pause XF86AudioNext / Prev track 111 ``` 112 113 ## screenshots 114 115 ```text 116 Print select a region → clipboard (grim + slurp) 117 Shift+Print whole screen → clipboard 118 ``` 119 120 Save the clipboard to a file: `wl-paste > ~/Pictures/shot.png`. 121 122 ## ipc — drive Noctalia from a shell 123 124 The wrapped Noctalia is not on PATH yet, so go through the flake: 125 126 ```sh 127 noct() { nix run ~/NixDaemon#noctalia -- ipc call "$@"; } # put in a zsh file to keep it 128 129 noct settings toggle # settings window noct settings openTab <tab> 130 noct launcher toggle # also: clipboard emoji windows command 131 noct controlCenter toggle 132 noct sessionMenu toggle # also: lock lockAndSuspend 133 noct lockScreen lock 134 noct notifications toggleHistory # also: toggleDND clear dismissAll 135 noct idleInhibitor toggle # keep the screen awake enableFor 3600 136 noct nightLight toggle 137 noct darkMode toggle # setDark / setLight 138 noct volume increase # decrease muteOutput muteInput togglePanel 139 noct brightness set 50 140 noct wifi toggle # bluetooth toggle airplaneMode toggle 141 noct powerProfile cycle # set performance|balanced|power-saver 142 noct media playPause # next previous seekRelative 10 143 noct bar toggle # hideBar / showBar 144 noct systemMonitor toggle 145 noct calendar toggle 146 noct state all # dump the shell's live state (JSON) 147 ``` 148 149 ## msg — drive Niri from a shell 150 151 ```sh 152 niri msg outputs # monitors, modes, scale 153 niri msg workspaces # list, with the focused one marked 154 niri msg windows # every window: id, app-id, title, workspace 155 niri msg focused-window 156 niri msg pick-window # click a window, get its details (for window rules) 157 niri msg action <action> [args] # any bindable action, e.g. 158 niri msg action focus-workspace 3 159 niri msg action set-column-width 50% 160 niri msg action switch-preset-column-width 161 niri msg action spawn -- kitty 162 niri msg -j windows | jq # JSON output for scripts 163 niri validate -c file.kdl # check a config file 164 ``` 165 166 ## wallpaper — Rosé Pine 167 168 Wallpapers are in `~/Pictures/Wallpapers/{rose-pine,rose-pine-dark,rose-pine-mid-walls}`. 169 Noctalia's picker (Mod+Ctrl+Space) and Caelestia's on Hyprland both read that folder and its subfolders 170 (`wallpaper.directory` in `noctalia.nix`, `wallpaperDir` in `caelestia.nix`). 171 172 ```sh 173 noct wallpaper toggle # the picker 174 noct wallpaper random "" # random from the configured folder 175 noct wallpaper set ~/Pictures/Wallpapers/rose-pine/koi-fish.png "" # any file ("" = all screens) 176 noct wallpaper get "" 177 ``` 178 179 ## settings — making a change stick 180 181 - **A Niri bind or option**: `modules/features/desktop/niri.nix` → `settings` (validated at build; a typo fails `nix build .#niri`). 182 - **A Noctalia setting**: change it in the GUI (lasts the session only; settings live in the store), 183 run `dump-noctalia-shell`, paste the differing keys into `noctalia.nix` → `settings`. 184 - Then `nh os switch`. A running Niri keeps its old config until re-login, or reload it now: 185 186 ```sh 187 niri msg action load-config-file --path "$(nix eval --raw ~/NixDaemon#niri)/niri-config.kdl" 188 ``` 189 190 ## session — logging in and out 191 192 ```text 193 tuigreet: F2 → session list → "niri" (it remembers the last one) 194 Mod+Escape → Logout or Mod+Shift+E (niri asks to confirm) 195 back to Hyprland: log out, pick "Hyprland (UWSM)" 196 nix run ~/NixDaemon#niri nested test inside another desktop (Alt = Mod) 197 ``` 198 199 Caelestia never starts under Niri (its unit is tied to the Hyprland session). Idle: lock at 10 min, screen off at 20, never suspends. 200 201 ## fix — when something is off 202 203 ```sh 204 systemctl --user list-units --state=active --no-legend | grep -E 'caelestia|polkit|cliphist|udiskie' 205 # expect polkit, cliphist, udiskie — and NO caelestia 206 pkill -f noctalia; niri msg action spawn -- $(nix build --no-link --print-out-paths ~/NixDaemon#noctalia)/bin/noctalia-shell 207 # restart a crashed/hung bar 208 journalctl --user -b | grep -i niri # niri's log for this boot 209 Ctrl+Alt+F2 → log in → nh os rollback # can't log in at all 210 ``` 211 212 - "What's new" panel on first login: Noctalia's changelog, dismiss once and it's remembered (`~/.cache/noctalia/shell-state.json`).