forge
Explore
Log in

Don't you dare go Hollow

Strip comments from hypr/niri configs and scripts

Browse files at this commit

78691e8a466f47bb1a34533a52471c6d0ad5556cAhmet Kaan GümüşParent: fe65316
  • style
    • strip comments from hypr/niri configs and scripts
Show full message
style: strip comments from hypr/niri configs and scripts

Two things are deliberately kept, because they are not documentation:

- `// WALLUST-GRADIENT` in config.kdl. wallust_niri_colors.sh replaces the
  line immediately after it on every wallpaper change; without the marker
  the border colors freeze. Verified by running the script — it still
  finds the marker and rewrites the line.
- jq's `//` alternative operator in workspace_startup.sh and
  show_desktop.sh (`.idx // empty`), which a naive strip reads as a
  comment and silently truncates.

Shebangs kept. monitors.sh has none by design, it is sourced.
niri validate passes; every script passes bash -n.
.config/hypr/hyprland.confmodified+8 -51
@@ -1,48 +1,28 @@
11 monitor=,preferred,auto,auto
2-# monitor = eDP-1, 2880x1800@90, 0x1080, 2
3-# monitor = DP-1, 2560x1440@180, 0x0, 1, bitdepth, 10, cm, srgb, sdrbrightness, 1.65, sdrsaturation, 1.0
42 monitor = DP-1, 2560x1440@180, 0x0, 1, bitdepth, 10
53 monitor = HDMI-A-1, 1920x1080@75, 2560x0, 1, bitdepth, 10
6-# monitor = eDP-1, disable
7-# monitor = HDMI-A-1, disable
8-# monitor = DP-1, disable
9-# bindl = , switch:on:Lid Switch, exec, hyprctl keyword monitor "eDP-1, disable"
10-# bindl = , switch:off:Lid Switch, exec, hyprctl keyword monitor "eDP-1, enable"
11-# bindl = , switch:on:Lid Switch, exec, hyprctl keyword input:touchdevice:enabled false
12-# bindl = , switch:off:Lid Switch, exec, hyprctl keyword input:touchdevice:enabled false
13-# bindl = , switch:off:Lid Switch, exec, hyprctl reload && hyprctl keyword input:touchdevice:enabled false
14-# bindl = , switch:off:Lid Switch, exec, hyprctl keyword monitor "eDP-1, 2880x1800@90, 0x1080, 2" monitor = HDMI-A-1, disable
154
165 exec-once = hyprpm reload -n
176 exec-once = sleep 1 && /usr/libexec/polkit-mate-authentication-agent-1
187 exec-once = bash ~/.config/scripts/shared/song_detail_writer.sh
198 exec-once = sleep 1 && waybar
20-# exec-once = sleep 1 && eww daemon
21-# exec-once = sleep 1 && eww open main
229 exec-once = sleep 2 && nm-applet
2310 exec-once = sleep 2 && blueman-applet
2411 exec-once = sleep 2 && kdeconnect-indicator
2512 exec-once = sleep 2 && hyprpaper
2613 exec-once = sleep 3 && /opt/Mullvad\ VPN/mullvad-vpn
27-# exec-once = sleep 3 && hyprctl keyword input:touchdevice:enabled false
2814 exec-once = sleep 3 && swaync-client -dn
29-exec-once = sleep 3 && wl-paste --type text --watch cliphist store # Stores only text data
30-exec-once = sleep 3 && wl-paste --type image --watch cliphist store # Stores only image data
15+exec-once = sleep 3 && wl-paste --type text --watch cliphist store
16+exec-once = sleep 3 && wl-paste --type image --watch cliphist store
3117 exec-once = sleep 4 && rfkill unblock bluetooth && bluetoothctl power on
3218 exec-once = sudo /usr/local/bin/asus-receiver-rebind
3319
34-# exec = gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark" # for GTK3 apps
35-# exec = gsettings set org.gnome.desktop.interface color-scheme "prefer-dark" # for GTK4 apps
36-# exec = gsettings set org.gnome.desktop.interface icon-theme 'papirus-dark'
37-
3820 env = QT_QPA_PLATFORMTHEME,gtk3
3921 env = XCURSOR_SIZE,24
4022 env = HYPRCURSOR_SIZE,24
4123 env = PATH, $HOME/.cargo/bin/:$HOME/.local/bin/:$PATH
4224 env = XDG_CURRENT_SESSION, Hyprland
4325
44-# render:explicit_sync = true # legacy command it's deprecated in 0.50 and now it's always enable
45-
4626 $terminal = wezterm start --always-new-process
4727 $fileManager = nautilus --new-window
4828 $active_menu = rofi -show
@@ -61,11 +41,6 @@ $my_trigger = Alt
6141 $monitor_left = DP-1
6242 $monitor_right = HDMI-A-1
6343
64-# bind = $my_trigger, 0, exec, bluetoothctl disconnect 00:00:00:00:00:00 && bluetoothctl connect 00:00:00:00:00:00
65-# bind = $my_trigger, 1, exec, playerctl previous
66-# bind = $my_trigger, 2, exec, playerctl play-pause
67-# bind = $my_trigger, 3, exec, playerctl next
68-
6944 bind = $my_trigger, T, exec, $terminal
7045 bind = $my_trigger, Q, exec, $fileManager
7146 bind = Alt, F1, exec, $active_menu
@@ -118,14 +93,12 @@ bind = $mainMod SHIFT, Y, movetoworkspace, 204
11893 bind = $mainMod SHIFT, P, movetoworkspace, 205
11994 bind = $mainMod SHIFT, N, movetoworkspace, 206
12095
121-# bind = $mainMod, D, workspace, 999
12296 bind = $mainMod, D, exec, ~/.config/scripts/hyprland/show_desktop.sh
12397
12498 bind = Alt, F4, killactive,
12599 bind = Alt, 4, killactive,
126100 bind = $mainMod $my_trigger, F4, exit,
127101 bind = $mainMod, H, exec, pkill -SIGUSR1 waybar
128-# bind = $mainMod, H, exec, ~/.config/scripts/system/toggle_eww.sh
129102 binds {
130103 allow_workspace_cycles = true
131104 }
@@ -133,8 +106,8 @@ bindr = $mainMod, Tab, bringactivetotop
133106 bind = $mainMod, Tab, cyclenext
134107 bind = Alt, Tab, workspace, previous_per_monitor
135108 bind = $mainMod SHIFT, Tab, split:swapactiveworkspaces, $monitor_left $monitor_right
136-bind = $mainMod, P, pseudo, # dwindle
137-bind = $mainMod, J, layoutmsg, togglesplit # dwindle
109+bind = $mainMod, P, pseudo,
110+bind = $mainMod, J, layoutmsg, togglesplit
138111 bind = $mainMod, F, togglefloating,
139112 bind = $mainMod, Q, focusmonitor, $monitor_left
140113 bind = $mainMod, E, focusmonitor, $monitor_right
@@ -202,11 +175,9 @@ bindl = , XF86AudioPrev, exec, playerctl previous
202175 windowrule = match:class .*, suppress_event maximize
203176 windowrule = match:class ^$, match:title ^$, match:xwayland 1, match:float 1, match:fullscreen 0, match:pin 0, no_focus on
204177 windowrule = match:class kitty, opacity 0.8
205-# windowrule = match:class dev.zed.Zed, opacity 0.6
206178 windowrule = match:class .*wezterm.*, opacity 0.8
207179 windowrule = match:class .*dev.heppen.webapps.*, tile on
208180
209-# Gaming: enable tearing for fullscreen games
210181 windowrule = match:fullscreen 1, immediate on
211182 windowrule = match:class dev.zed.Zed, immediate off
212183
@@ -259,7 +230,7 @@ animations {
259230 }
260231
261232 dwindle {
262- preserve_split = true # You probably want this
233+ preserve_split = true
263234 }
264235
265236 master {
@@ -267,29 +238,17 @@ master {
267238 }
268239
269240 misc {
270- force_default_wallpaper = 0 # Set to 0 or 1 to disable the anime mascot wallpapers
271- disable_hyprland_logo = true # If true disables the random hyprland logo / anime girl background. :(
241+ force_default_wallpaper = 0
242+ disable_hyprland_logo = true
272243 vrr = 0
273244 mouse_move_focuses_monitor = false
274245 }
275246
276247 debug {
277- # Logging was enabled 2026-04-24 for the hard-freeze hunt. That turned out to be a
278- # Hyprland bug, fixed upstream — closed 2026-07-29, so back to the default (logs off).
279- # hyprland.log was growing ~1.2MB/hr into /run/user/1000 (tmpfs = RAM).
280- # Flip to false again if you ever need to capture compositor state.
281248 disable_logs = true
282249 enable_stdout_logs = false
283250 }
284251
285-# ===================================
286-# Power Management
287-# ===================================
288-# Super + Escape: Open power menu
289-# Super + Shift + Q: Quick suspend
290-# Super + Shift + R: Quick reboot
291-# Super + Shift + S: Quick shutdown
292-
293252 input {
294253 kb_layout = tr
295254 kb_variant =
@@ -301,15 +260,13 @@ input {
301260 mouse_refocus = false
302261 accel_profile = flat
303262
304- sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
263+ sensitivity = 0
305264
306265 touchpad {
307266 natural_scroll = true
308267 }
309268 }
310269
311-# Example per-device config
312-# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
313270 device {
314271 name = epic-mouse-v1
315272 sensitivity = 0
.config/hypr/hyprlock.confmodified+0 -7
@@ -1,12 +1,8 @@
1-# Hyprlock Configuration
2-# Lock screen with date/time display, password authentication, and music info
31
4-# Background image
52 background {
63 path = ~/Pictures/Wallpapers/ryunosuke-kikuno-VXp-9HwN1eg-unsplash.jpg
74 }
85
9-# Date label - displays current date in center
106 label {
117 monitor =
128 text = cmd[update:1000] echo -e "$(LC_TIME=en_GB.UTF-8 date +"%A, %B %d")"
@@ -18,7 +14,6 @@ label {
1814 valign = center
1915 }
2016
21-# Time label - displays current time in large format at center
2217 label {
2318 monitor =
2419 text = cmd[update:1000] echo "<span>$(date +"%H:%M:%S")</span>"
@@ -30,7 +25,6 @@ label {
3025 valign = center
3126 }
3227
33-# Password input field with authentication status feedback
3428 input-field {
3529 monitor =
3630 size = 280, 55
@@ -53,7 +47,6 @@ input-field {
5347 fail_text = <i>Authentication Failed</i>
5448 }
5549
56-# Music info label - reads single-source file maintained by song_detail_writer.sh
5750 label {
5851 monitor =
5952 text = cmd[update:1000] cat /tmp/song_detail_last 2>/dev/null
.config/niri/config.kdlmodified+0 -121
@@ -1,15 +1,5 @@
1-// niri config — ported from ~/.config/hypr/hyprland.conf, both kept working.
2-// Docs: https://niri-wm.github.io/niri/ • check edits with `niri validate`
3-//
4-// MONITORS: DP-1 = left/primary (2560x1440@180), HDMI-A-1 = right (1920x1080@75).
5-// KDL has no variables, so those names are literal. They appear ONLY in the
6-// `output` blocks and the four monitor binds below. Scripts read them from
7-// ~/.config/scripts/niri/monitors.sh instead.
8-//
9-// Mod = Super. Alt is the app-launcher trigger, matching Hyprland's $my_trigger.
101
112 hotkey-overlay {
12- // Do not pop the keybind cheat sheet on login. Mod+Shift+Slash still shows it.
133 skip-at-startup
144 }
155
@@ -26,7 +16,6 @@ input {
2616 natural-scroll
2717 }
2818
29- // Hyprland: accel_profile = flat (raw input, no acceleration curve).
3019 mouse {
3120 accel-profile "flat"
3221 }
@@ -34,24 +23,16 @@ input {
3423 trackpoint {
3524 }
3625
37- // focus-follows-mouse stays off, matching Hyprland's follow_mouse = 0.
38- // No niri equivalent for mouse_move_focuses_monitor = false: moving the
39- // cursor to the other output does make it the focused one.
4026 }
4127
42-// Ask every client to skip its own decorations, so niri's border is the only
43-// frame. Kills the CSD titlebar that showed the page/document title (Hyprland
44-// never had one because it sends server-side decorations by default).
4528 prefer-no-csd
4629
4730 gestures {
48- // No overview/workspace switch when the pointer hits a screen corner.
4931 hot-corners {
5032 off
5133 }
5234 }
5335
54-// Hyprland had `bitdepth 10`; niri 26.04 has no bit-depth or hdr output key.
5536 output "DP-1" {
5637 mode "2560x1440@180"
5738 scale 1
@@ -60,7 +41,6 @@ output "DP-1" {
6041 focus-at-startup
6142 }
6243
63-// Mode string must be exact: 75.003, not 75.
6444 output "HDMI-A-1" {
6545 mode "1920x1080@75.003"
6646 scale 1
@@ -69,7 +49,6 @@ output "HDMI-A-1" {
6949 }
7050
7151 layout {
72- // Hyprland gaps_in = 3; the remaining 7 to reach gaps_out = 10 is in struts.
7352 gaps 3
7453 struts {
7554 left 7
@@ -80,21 +59,8 @@ layout {
8059
8160 center-focused-column "never"
8261
83- // Puts a plain workspace at index 1 on every output, above the declared
84- // named block — so the workspace waybar labels on HDMI-A-1 is 1, not 9.
85- //
86- // This is NOT a replacement for workspace_startup.sh, which was tested:
87- // alone it still logs in with the first NAMED workspace active, because it
88- // only creates the workspace, it never focuses it. The two go together —
89- // this one supplies index 1, the script focuses it.
90- //
91- // Cost, accepted knowingly: every Mod+<N> shifts by one, since
92- // workspace_nav.sh indexes plain workspaces and this adds one at the top.
9362 empty-workspace-above-first
9463
95- // New windows take the whole working area — the closest thing to dwindle
96- // handing a new window all the free space. 1.0 is in the preset cycle too,
97- // otherwise one Mod+R drops a window to 1/3 with no way back to full.
9864 default-column-width { proportion 1.0; }
9965 preset-column-widths {
10066 proportion 0.33333
@@ -103,19 +69,13 @@ layout {
10369 proportion 1.0
10470 }
10571
106- // Hyprland had one border concept, mapped to `border` below.
10772 focus-ring {
10873 off
10974 }
11075
11176 border {
112- // Hyprland general:border_size = 2
11377 width 2
11478
115- // The line after the marker is REWRITTEN IN PLACE by
116- // ~/.config/scripts/niri/wallust_niri_colors.sh on every wallpaper
117- // change. niri has no `include`, so generated colors cannot live in a
118- // separate file. Keep the marker directly above it, all on one line.
11979 // WALLUST-GRADIENT
12080 active-gradient from="#4D0830" to="#7E420A" angle=90 in="oklch"
12181
@@ -123,9 +83,6 @@ layout {
12383 urgent-color "#9b0000"
12484 }
12585
126- // Shadows and rounding are left off (Hyprland had rounding = 0, blur off).
127- // Rounded corners come from the window rule below instead, only so the
128- // border traces the curve GTK4 apps draw themselves.
12986 }
13087
13188 environment {
@@ -133,15 +90,8 @@ environment {
13390 XCURSOR_SIZE "24"
13491 }
13592
136-// Startup. The polkit agent, nm-applet and blueman-applet are deliberately
137-// absent: niri runs xdg-desktop-autostart.target and /etc/xdg/autostart already
138-// starts them. Hyprland ignored that target, which is why it needed exec-once.
139-// The sleeps preserve Hyprland's ordering (tray applets after waybar).
14093 spawn-at-startup "sh" "-c" "bash ~/.config/scripts/niri/wallpaper_restore.sh"
14194 spawn-at-startup "sh" "-c" "bash ~/.config/scripts/shared/song_detail_writer.sh"
142-// waybar needs its own config here: the shared one uses hyprland/workspaces
143-// and hyprland/window, which do nothing under niri. config-niri swaps those
144-// for niri/workspaces and niri/window.
14595 spawn-at-startup "sh" "-c" "sleep 1 && waybar -c ~/.config/waybar/config-niri"
14696 spawn-at-startup "sh" "-c" "sleep 2 && kdeconnect-indicator"
14797 spawn-at-startup "sh" "-c" "sleep 3 && /opt/Mullvad\\ VPN/mullvad-vpn"
@@ -150,29 +100,19 @@ spawn-at-startup "sh" "-c" "sleep 3 && wl-paste --type text --watch cliphist sto
150100 spawn-at-startup "sh" "-c" "sleep 3 && wl-paste --type image --watch cliphist store"
151101 spawn-at-startup "sh" "-c" "sleep 4 && rfkill unblock bluetooth && bluetoothctl power on"
152102
153-// The declared app workspaces below all get created on the first output niri
154-// connects (HDMI-A-1), so that monitor logs in showing "code". This puts every
155-// output back on a plain workspace. Early on purpose: it must finish before the
156-// sleep-3/sleep-4 apps map their windows, or one lands on the wrong monitor.
157103 spawn-at-startup "sh" "-c" "sleep 1 && bash ~/.config/scripts/niri/workspace_startup.sh"
158104
159105 screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
160106
161-// Animations stay at niri's defaults (on), unlike Hyprland where they were off.
162107 animations {
163108 }
164109
165-// Every window: draw the border AROUND the window, not behind it. niri uses the
166-// border as the window background by default, which is invisible behind an
167-// opaque window — the border simply never showed up. The corner radius makes it
168-// follow the rounding GTK4/libadwaita apps apply to themselves.
169110 window-rule {
170111 draw-border-with-background false
171112 geometry-corner-radius 12
172113 clip-to-geometry true
173114 }
174115
175-// Hyprland: windowrule = match:class .*wezterm.*, opacity 0.8
176116 window-rule {
177117 match app-id=r#"^org\.wezfurlong\.wezterm$"#
178118 opacity 0.8
@@ -184,20 +124,6 @@ window-rule {
184124 open-floating true
185125 }
186126
187-// The app workspaces. A declared `workspace "name"` node is immortal — which is
188-// exactly the point: nothing has to create, name or clean them up, so there is
189-// no reaper daemon and no marker files. They were briefly named at runtime
190-// instead, and the reaper that un-named them died mid-session (niri dropped its
191-// IPC event stream for "reading events too slowly") leaving empty named
192-// workspaces behind — the failure this replaces.
193-//
194-// The empties are only visible in the overview: workspace_nav.sh filters on
195-// `.name == null`, so number and directional navigation skip them, and waybar
196-// runs niri/workspaces with current-only.
197-//
198-// No open-on-output on purpose — KDL has no variables and monitor names are kept
199-// to the `output` blocks and the monitor binds. They start on the first output
200-// and workspace_app.sh pulls an empty one to the monitor in use on launch.
201127 workspace "code"
202128 workspace "github"
203129 workspace "whatsapp"
@@ -208,8 +134,6 @@ workspace "mail"
208134 workspace "signal"
209135
210136 binds {
211- // ─── launchers (Alt trigger, Hyprland $my_trigger) ───────────────────────
212- // F-key and number-row variants both bound, as in Hyprland.
213137 Alt+T hotkey-overlay-title="Terminal: wezterm" { spawn-sh "wezterm start --always-new-process"; }
214138 Alt+Q hotkey-overlay-title="Files: nautilus" { spawn-sh "nautilus --new-window"; }
215139
@@ -225,13 +149,6 @@ binds {
225149 Alt+F hotkey-overlay-title="Browser" { spawn-sh "flatpak run io.github.ungoogled_software.ungoogled_chromium --enable-features=MiddleClickAutoscroll"; }
226150 Shift+Alt+F hotkey-overlay-title="Browser (incognito, outside VPN)" { spawn-sh "mullvad-exclude flatpak run org.chromium.Chromium --incognito --enable-features=MiddleClickAutoscroll,AllowLegacyMV2Extensions --disable-features=ExtensionManifestV2Unsupported,ExtensionManifestV2Disabled,ExtensionsManifestV3Only"; }
227151
228- // ─── app workspaces ─────────────────────────────────────────────────────
229- // workspace_app.sh emulates Hyprland's on-created-empty, which niri lacks.
230- // The workspaces are declared above, so "is the app running" is just "does
231- // its workspace hold a window". Empty -> the workspace moves to the monitor
232- // you are on and the app launches there; holding windows -> the key only
233- // moves focus to it, leaving it on its own monitor. webapp.sh builds the
234- // Chromium web-app command from a URL + profile id.
235152 Alt+C hotkey-overlay-title="Workspace: code" { spawn-sh "~/.config/scripts/niri/workspace_app.sh code zed"; }
236153 Alt+G hotkey-overlay-title="Workspace: github" { spawn-sh "~/.config/scripts/niri/workspace_app.sh github ~/.config/scripts/shared/webapp.sh https://github.com/ FCF18Wmt"; }
237154 Alt+W hotkey-overlay-title="Workspace: whatsapp" { spawn-sh "~/.config/scripts/niri/workspace_app.sh whatsapp ~/.config/scripts/shared/webapp.sh --mullvad https://web.whatsapp.com/ aW2IMaZ8"; }
@@ -250,28 +167,21 @@ binds {
250167 Mod+Shift+P { spawn-sh "~/.config/scripts/niri/workspace_app.sh --move mail"; }
251168 Mod+Shift+N { spawn-sh "~/.config/scripts/niri/workspace_app.sh --move signal"; }
252169
253- // ─── session / system ───────────────────────────────────────────────────
254- // hyprlock works here: ext-session-lock-v1, no Hyprland IPC dependency.
255170 Super+L hotkey-overlay-title="Lock: hyprlock" { spawn "hyprlock"; }
256171 Mod+Escape hotkey-overlay-title="Power menu" { spawn-sh "bash ~/.config/scripts/system/power_menu.sh"; }
257172 Mod+D hotkey-overlay-title="Show desktop" { spawn-sh "~/.config/scripts/niri/show_desktop.sh"; }
258173 Mod+H hotkey-overlay-title="Toggle waybar" { spawn-sh "pkill -SIGUSR1 waybar"; }
259174 Mod+W hotkey-overlay-title="Wallpaper picker" { spawn-sh "~/.config/scripts/niri/wallpaper_picker.sh"; }
260175
261- // Exit is Super+Alt+F4 only, as in Hyprland. The stock Mod+Shift+E and
262- // Ctrl+Alt+Delete quit binds are removed on purpose.
263176 Alt+4 repeat=false { close-window; }
264177 Alt+F4 repeat=false { close-window; }
265178 Mod+Alt+F4 { quit; }
266179
267- // Mod+Escape is the power menu, so the shortcut-inhibitor escape hatch
268- // lives on Mod+Shift+Escape.
269180 Mod+Shift+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
270181 Mod+Shift+Slash { show-hotkey-overlay; }
271182 Mod+O repeat=false { toggle-overview; }
272183 Super+Alt+S allow-when-locked=true hotkey-overlay-title=null { spawn-sh "pkill orca || exec orca"; }
273184
274- // ─── media / brightness ─────────────────────────────────────────────────
275185 XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+ -l 1.0"; }
276186 XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; }
277187 XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; }
@@ -283,35 +193,19 @@ binds {
283193 XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+10%"; }
284194 XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "10%-"; }
285195
286- // ─── screenshots ────────────────────────────────────────────────────────
287- // grim, not niri's built-ins: the Hyprland bind captured ALL outputs into
288- // one image, while screenshot-screen only grabs the focused output.
289196 Print { spawn-sh "grim -t png - | tee \"$HOME/Pictures/Screenshots/$(date '+%y%m%d_%H-%M-%S').png\" | wl-copy -t image/png"; }
290197 Shift+Print { spawn-sh "grim -t png -g \"$(slurp)\" - | wl-copy -t image/png"; }
291198 Ctrl+Print { screenshot-screen; }
292199 Alt+Print { screenshot-window; }
293200
294- // ─── monitors (the only place output names appear outside `output`) ──────
295- // Addressed by name, like Hyprland's $monitor_left / $monitor_right. The
296- // stock directional focus-monitor-* binds are dropped as redundant.
297201 Mod+Q { focus-monitor "DP-1"; }
298202 Mod+E { focus-monitor "HDMI-A-1"; }
299203 Mod+Shift+Q { move-column-to-monitor "DP-1"; }
300204 Mod+Shift+E { move-column-to-monitor "HDMI-A-1"; }
301205
302- // toggle_monitors.sh keeps Hyprland's Super+M menu / Super+Shift+M all-on,
303- // so maximize sits on Mod+Ctrl+M.
304206 Mod+M hotkey-overlay-title="Monitor menu" { spawn-sh "~/.config/scripts/niri/toggle_monitors.sh"; }
305207 Mod+Shift+M hotkey-overlay-title="All monitors on" { spawn-sh "~/.config/scripts/niri/toggle_monitors.sh on"; }
306208
307- // ─── focus ──────────────────────────────────────────────────────────────
308- // Mod+H is the waybar toggle and Mod+L is the locker, so the stock vim-nav
309- // binds for those two are gone; arrows still navigate.
310- //
311- // Left/Right move between columns. Up/Down are vertical in niri's sense:
312- // the next window in the column when the column has one, otherwise the
313- // workspace above/below (workspaces stack vertically). Mod+J/K stay
314- // strictly in-column.
315209 Mod+Left { focus-column-left; }
316210 Mod+Right { focus-column-right; }
317211 Mod+Up { spawn-sh "~/.config/scripts/niri/workspace_nav.sh up"; }
@@ -323,7 +217,6 @@ binds {
323217 Mod+Tab { focus-window-previous; }
324218 Alt+Tab { focus-workspace-previous; }
325219
326- // ─── move windows ───────────────────────────────────────────────────────
327220 Mod+Ctrl+Left { move-column-left; }
328221 Mod+Ctrl+Right { move-column-right; }
329222 Mod+Ctrl+Up { spawn-sh "~/.config/scripts/niri/workspace_nav.sh move-up"; }
@@ -335,16 +228,6 @@ binds {
335228 Mod+Ctrl+Home { move-column-to-first; }
336229 Mod+Ctrl+End { move-column-to-last; }
337230
338- // ─── workspaces ─────────────────────────────────────────────────────────
339- // niri workspaces are per-monitor already, which is what hyprsplit gave
340- // Hyprland. Mod+Shift+N is Hyprland's send-to-workspace; the stock
341- // Mod+Ctrl+N binds do the same and are kept as well.
342- //
343- // All of these go through workspace_nav.sh rather than niri's own
344- // focus-workspace: niri numbers are indices into each output's live
345- // workspace list, and the named app workspaces live in that same list, so
346- // Mod+3 could land on "discord". The script indexes the PLAIN workspaces
347- // only. N past the end clamps to the last one.
348231 Mod+1 { spawn-sh "~/.config/scripts/niri/workspace_nav.sh focus 1"; }
349232 Mod+2 { spawn-sh "~/.config/scripts/niri/workspace_nav.sh focus 2"; }
350233 Mod+3 { spawn-sh "~/.config/scripts/niri/workspace_nav.sh focus 3"; }
@@ -390,7 +273,6 @@ binds {
390273 Mod+Shift+U { move-workspace-down; }
391274 Mod+Shift+I { move-workspace-up; }
392275
393- // ─── scroll wheel ───────────────────────────────────────────────────────
394276 Mod+WheelScrollDown cooldown-ms=150 { spawn-sh "~/.config/scripts/niri/workspace_nav.sh next"; }
395277 Mod+WheelScrollUp cooldown-ms=150 { spawn-sh "~/.config/scripts/niri/workspace_nav.sh prev"; }
396278 Mod+Ctrl+WheelScrollDown cooldown-ms=150 { spawn-sh "~/.config/scripts/niri/workspace_nav.sh move-next"; }
@@ -404,9 +286,6 @@ binds {
404286 Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
405287 Mod+Ctrl+Shift+WheelScrollUp { move-column-left; }
406288
407- // ─── size / layout ──────────────────────────────────────────────────────
408- // Mod+F is floating (Hyprland togglefloating), so maximize is Mod+Ctrl+M.
409- // Mod+Shift+arrows are Hyprland's resizeactive 30 / -30, in logical pixels.
410289 Mod+F { toggle-window-floating; }
411290 Mod+Shift+F { fullscreen-window; }
412291 Mod+Ctrl+M { maximize-column; }
.config/scripts/hyprland/show_desktop.shmodified+0 -2
@@ -24,8 +24,6 @@ WS_FOCUSED=$WS_FOCUSED
2424 WS_OTHER=$WS_OTHER
2525 EOF
2626
27- # one empty dummy workspace per monitor; no swapactiveworkspaces —
28- # swaps rebind workspaces to the wrong monitor and confuse waybar
2927 if [ -n "$MON2" ]; then
3028 hyprctl --batch "dispatch focusmonitor $MON2; dispatch workspace 998; dispatch focusmonitor $MON1; dispatch workspace 999"
3129 else
.config/scripts/hyprland/toggle_monitors.shmodified+0 -2
@@ -1,7 +1,5 @@
11 #!/bin/bash
22
3-# Toggle monitors off via rofi, re-enable with keybinding
4-
53 DP1_CONFIG="DP-1, 2560x1440@180, 0x0, 1, bitdepth, 10"
64 HDMI_CONFIG="HDMI-A-1, 1920x1080@75, 2560x0, 1, bitdepth, 10"
75
.config/scripts/hyprland/wallpaper_picker.shmodified+0 -7
@@ -1,14 +1,11 @@
11 #!/bin/bash
2-# Rofi wallpaper picker — updates hyprpaper, wallust, and waybar
32
43 WALLPAPER_DIR="$HOME/Pictures/Wallpapers"
54 HYPRPAPER_CONF="$HOME/.config/hypr/hyprpaper.conf"
65 THUMB_DIR="$HOME/.cache/wallpaper_thumbs"
76
8-# Generate thumbnail cache (only for new/changed images)
97 mkdir -p "$THUMB_DIR"
108
11-# Remove orphan thumbnails for deleted wallpapers
129 for thumb in "$THUMB_DIR"/*.png; do
1310 [ -f "$thumb" ] || continue
1411 name=$(basename "$thumb" .png)
@@ -17,7 +14,6 @@ for thumb in "$THUMB_DIR"/*.png; do
1714 fi
1815 done
1916
20-# Generate thumbnails for new/changed wallpapers
2117 find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \) | while read -r img; do
2218 name=$(basename "$img")
2319 thumb="$THUMB_DIR/$name.png"
@@ -27,7 +23,6 @@ find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -
2723 done
2824 wait
2925
30-# List image files with cached thumbnails in a grid rofi
3126 SELECTED=$(find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \) | sort | while read -r img; do
3227 name=$(basename "$img")
3328 echo -en "${name}\0icon\x1f${THUMB_DIR}/${name}.png\n"
@@ -48,7 +43,6 @@ if [ ! -f "$WALLPAPER" ]; then
4843 exit 1
4944 fi
5045
51-# Update hyprpaper config and kill both processes
5246 cat > "$HYPRPAPER_CONF" << EOF
5347 splash = false
5448
@@ -61,7 +55,6 @@ EOF
6155
6256 pkill hyprpaper
6357
64-# Run hyprpaper and wallust in parallel
6558 hyprpaper &disown
6659 wallust run -qs "$WALLPAPER" &
6760 wait
.config/scripts/niri/monitors.shmodified+2 -8
@@ -1,9 +1,3 @@
1-# Monitor names, sourced by the niri scripts. Not executable on purpose.
2-#
3-# Swapping a monitor means editing this file plus the `output` blocks and the
4-# four focus-monitor / move-column-to-monitor binds in config.kdl. KDL has no
5-# variables, so those cannot be parameterised — config.kdl names the outputs
6-# in exactly one place each, and this file covers everything scripted.
71
8-LEFT_MONITOR="DP-1" # Xiaomi Mi Monitor, 2560x1440@180, primary, at x=0
9-RIGHT_MONITOR="HDMI-A-1" # 1920x1080@75, to the right at x=2560
2+LEFT_MONITOR="DP-1"
3+RIGHT_MONITOR="HDMI-A-1"
.config/scripts/niri/show_desktop.shmodified+1 -18
@@ -1,27 +1,15 @@
11 #!/bin/bash
2-# Show-desktop toggle for niri. Port of ~/.config/scripts/hyprland/show_desktop.sh
3-#
4-# Same idea as the Hyprland version: remember what each output is showing, send
5-# every output to an empty workspace, and restore on the second press. niri
6-# always keeps one empty workspace at the end of each output's list, so there is
7-# no need for the dedicated 998/999 dummy workspaces Hyprland needed.
8-#
9-# Workspaces are referenced by name when they have one and by index otherwise,
10-# because niri workspace indices shift as workspaces come and go.
112 set -euo pipefail
123
134 STATE_FILE="/tmp/niri_show_desktop"
145
156 ws_json=$(niri msg -j workspaces)
167
17-# Reference used to focus a workspace again later: prefer the name, else index.
18-ref_of() { # $1 = jq object
8+ref_of() {
199 jq -r 'if .name != null then .name else (.idx | tostring) end' <<<"$1"
2010 }
2111
2212 if [ -f "$STATE_FILE" ]; then
23- # Restore. Focus each output, put back what it was showing, then return
24- # focus to the output that had it before.
2513 while IFS=$'\t' read -r out ref; do
2614 [ -n "$out" ] || continue
2715 niri msg action focus-monitor "$out" >/dev/null
@@ -39,16 +27,12 @@ else
3927 : > "$STATE_FILE"
4028 printf 'FOCUSED\t%s\n' "$focused_out" >> "$STATE_FILE"
4129
42- # Record the active workspace of every output.
4330 while read -r out; do
4431 active=$(jq -c --arg o "$out" '.[] | select(.output == $o and .is_active == true)' <<<"$ws_json")
4532 printf '%s\t%s\n' "$out" "$(ref_of "$active")" >> "$STATE_FILE"
4633 done < <(jq -r '[.[].output] | unique | .[]' <<<"$ws_json")
4734
48- # Send every output to an empty workspace of its own.
4935 while read -r out; do
50- # Unnamed only: the named workspaces are the app ones (code, discord,
51- # ...), and landing on an empty "github" is not "show desktop".
5236 empty_idx=$(jq -r --arg o "$out" --argjson w "$win_json" '
5337 [ .[]
5438 | select(.output == $o and .name == null)
@@ -56,7 +40,6 @@ else
5640 | select(([$w[] | select(.workspace_id == $ws.id)] | length) == 0)
5741 ] | last | .idx // empty' <<<"$ws_json")
5842
59- # Fall back to the highest index on that output, which niri keeps empty.
6043 if [ -z "$empty_idx" ]; then
6144 empty_idx=$(jq -r --arg o "$out" '[.[] | select(.output == $o) | .idx] | max' <<<"$ws_json")
6245 fi
.config/scripts/niri/toggle_monitors.shmodified+3 -12
@@ -1,13 +1,4 @@
11 #!/usr/bin/env bash
2-# Rofi monitor chooser for niri. Port of ~/.config/scripts/hyprland/toggle_monitors.sh
3-#
4-# usage: toggle_monitors.sh [menu|on]
5-#
6-# niri difference worth knowing: there is no per-output DPMS. `power-off-monitors`
7-# blanks EVERY output and any input wakes them back up, while `niri msg output X off`
8-# genuinely disables one output — windows on it move away, and only `... on` (or the
9-# `on` argument here, bound to Super+Shift+M) brings it back. So the single-monitor
10-# entries below disable rather than blank.
112 set -euo pipefail
123
134 . "$(dirname "$(realpath "$0")")/monitors.sh"
@@ -21,9 +12,9 @@ all_on() {
2112 case "${1:-menu}" in
2213 menu)
2314 choice=$(printf '%s\n' \
24- "🖥️ All Monitors Off (blank, any key wakes)" \
25- "🖥️ $LEFT_MONITOR Off (disable)" \
26- "🖥️ $RIGHT_MONITOR Off (disable)" \
15+ "🖥️ All Monitors Off" \
16+ "🖥️ $LEFT_MONITOR Off" \
17+ "🖥️ $RIGHT_MONITOR Off" \
2718 "💡 All Monitors On" \
2819 "💡 $LEFT_MONITOR On" \
2920 "💡 $RIGHT_MONITOR On" \
.config/scripts/niri/wallpaper_picker.shmodified+0 -18
@@ -1,22 +1,11 @@
11 #!/bin/bash
2-# Rofi wallpaper picker for niri — updates awww, wallust, and waybar.
3-#
4-# This is the niri twin of ~/.config/scripts/hyprland/wallpaper_picker.sh.
5-# Everything above the "Apply" section is identical; only the backend differs:
6-# hyprpaper talks over Hyprland's IPC socket (path built from
7-# $HYPRLAND_INSTANCE_SIGNATURE) and cannot run here, so awww replaces it.
8-#
9-# Unlike hyprpaper there is no config file to rewrite and no process to kill:
10-# awww-daemon stays up and `awww img` swaps the image at runtime.
112
123 WALLPAPER_DIR="$HOME/Pictures/Wallpapers"
134 THUMB_DIR="$HOME/.cache/wallpaper_thumbs"
145 STATE_FILE="$HOME/.cache/current_wallpaper"
156
16-# Generate thumbnail cache (only for new/changed images)
177 mkdir -p "$THUMB_DIR"
188
19-# Remove orphan thumbnails for deleted wallpapers
209 for thumb in "$THUMB_DIR"/*.png; do
2110 [ -f "$thumb" ] || continue
2211 name=$(basename "$thumb" .png)
@@ -25,7 +14,6 @@ for thumb in "$THUMB_DIR"/*.png; do
2514 fi
2615 done
2716
28-# Generate thumbnails for new/changed wallpapers
2917 find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \) | while read -r img; do
3018 name=$(basename "$img")
3119 thumb="$THUMB_DIR/$name.png"
@@ -35,7 +23,6 @@ find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -
3523 done
3624 wait
3725
38-# List image files with cached thumbnails in a grid rofi
3926 SELECTED=$(find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \) | sort | while read -r img; do
4027 name=$(basename "$img")
4128 echo -en "${name}\0icon\x1f${THUMB_DIR}/${name}.png\n"
@@ -56,8 +43,6 @@ if [ ! -f "$WALLPAPER" ]; then
5643 exit 1
5744 fi
5845
59-# Apply: awww holds the wallpaper, wallust regenerates the palette.
60-# Start the daemon if it is not already up (also covers a crashed daemon).
6146 if ! awww query >/dev/null 2>&1; then
6247 awww-daemon >/dev/null 2>&1 &
6348 disown
@@ -71,11 +56,8 @@ awww img --transition-type simple "$WALLPAPER" &
7156 wallust run -qs "$WALLPAPER" &
7257 wait
7358
74-# Remember the choice so the daemon can be restored on the next login.
7559 echo "$WALLPAPER" > "$STATE_FILE"
7660
77-# -c: the shared waybar config uses the hyprland/* modules, which are inert
78-# under niri. Must match the config niri starts waybar with.
7961 killall waybar 2>/dev/null
8062 waybar -c "$HOME/.config/waybar/config-niri" &disown
8163 notify-send "Wallpaper Picker" "Applied: $SELECTED"
.config/scripts/niri/wallpaper_restore.shmodified+0 -5
@@ -1,7 +1,4 @@
11 #!/bin/bash
2-# Start awww-daemon and restore the last wallpaper picked by wallpaper_picker.sh.
3-# Run once at niri startup. hyprpaper read its wallpaper from hyprpaper.conf;
4-# awww keeps no config file, so the choice is remembered in a state file.
52
63 STATE_FILE="$HOME/.cache/current_wallpaper"
74 FALLBACK_DIR="$HOME/Pictures/Wallpapers"
@@ -21,8 +18,6 @@ if [ -s "$STATE_FILE" ]; then
2118 WALLPAPER=$(cat "$STATE_FILE")
2219 fi
2320
24-# First run on niri: fall back to whatever hyprpaper was last set to, so the
25-# desktop does not come up blank before the first pick.
2621 if [ ! -f "$WALLPAPER" ]; then
2722 WALLPAPER=$(grep -oP '^\s*path\s*=\s*\K.*' "$HOME/.config/hypr/hyprpaper.conf" 2>/dev/null | head -1)
2823 fi
.config/scripts/niri/wallust_niri_colors.shmodified+0 -22
@@ -1,36 +1,15 @@
11 #!/bin/bash
2-# Rewrite niri's border gradient from the current wallust palette.
3-#
4-# Runs as a wallust hook (see [hooks] in ~/.config/wallust/wallust.toml), so it
5-# fires on every `wallust run`, i.e. on every wallpaper change.
6-#
7-# niri has no `include` directive, so the colors cannot be generated into a
8-# separate file and pulled in — the line has to be edited inside config.kdl
9-# itself. The line immediately following the "// WALLUST-GRADIENT" marker is
10-# replaced wholesale. niri watches its config and reloads on write, so the
11-# border updates live.
12-#
13-# Safe to run under Hyprland too: it only edits a file. niri picks up the new
14-# colors whenever it next runs.
152 set -euo pipefail
163
174 CONFIG="$HOME/.config/niri/config.kdl"
18-# Written by the 'niri' entry in wallust.toml [templates] from
19-# ~/.config/wallust/templates/niri-colors.sh. Do NOT read
20-# ~/.cache/wallust/sequences instead: the picker runs `wallust run -qs`, and -s
21-# skips writing that file, so it silently goes stale and the border never
22-# changes.
235 COLORS="$HOME/.cache/wallust/niri-colors.sh"
246 MARKER="// WALLUST-GRADIENT"
257
268 [ -f "$CONFIG" ] || exit 0
279 [ -f "$COLORS" ] || exit 0
2810
29-# shellcheck source=/dev/null
3011 . "$COLORS"
3112
32-# wallust's {{colorN}} placeholders already carry the leading '#'; strip it so
33-# exactly one is added back below regardless of format.
3413 FROM="${NIRI_BORDER_FROM#\#}"
3514 TO="${NIRI_BORDER_TO#\#}"
3615
@@ -40,7 +19,6 @@ fi
4019
4120 grep -qF "$MARKER" "$CONFIG" || exit 0
4221
43-# Replace the line after the marker, preserving its indentation.
4422 awk -v marker="$MARKER" -v from="#$FROM" -v to="#$TO" '
4523 hit {
4624 match($0, /^[ \t]*/)
.config/scripts/niri/workspace_app.shmodified+0 -28
@@ -1,21 +1,4 @@
11 #!/usr/bin/env bash
2-# Focus an app workspace, launching the app the first time.
3-#
4-# usage: workspace_app.sh <workspace-name> <command> [args...]
5-# workspace_app.sh --move <workspace-name>
6-#
7-# Behaviour:
8-# * workspace holds windows (app is running) -> just focus it. It stays on the
9-# monitor it was launched on; the key moves FOCUS there rather than dragging
10-# the workspace to the monitor you happen to be on.
11-# * workspace is empty (app not running) -> pull it to the focused monitor,
12-# focus it, and launch the app there.
13-#
14-# The workspaces are DECLARED in config.kdl, so they always exist and niri never
15-# reaps them. That is what removed the naming step, the grace marker files and
16-# workspace_reaper.sh: with a permanent workspace, "is the app running" is just
17-# "does its workspace hold a window", which is one stateless query per keypress
18-# instead of a daemon following the IPC event stream.
192 set -euo pipefail
203
214 mode="focus"
@@ -29,10 +12,6 @@ shift || true
2912
3013 ws_json=$(niri msg -j workspaces)
3114
32-# Resolved before the --move branch so both modes fail loudly rather than letting
33-# niri exit non-zero into a keybind, where nothing would be shown at all.
34-# Two ids means two workspaces carry the name — a leftover runtime name next to
35-# the declared one — which every jq below would then choke on.
3615 mapfile -t ids < <(jq -r --arg w "$ws" '.[] | select(.name == $w) | .id' <<<"$ws_json")
3716 if [ "${#ids[@]}" -eq 0 ]; then
3817 notify-send "workspace_app" "No workspace named '$ws' — is it declared in config.kdl?"
@@ -52,13 +31,8 @@ fi
5231 count=$(niri msg -j windows | jq --argjson id "$id" '[.[] | select(.workspace_id == $id)] | length')
5332
5433 if [ "$count" -eq 0 ]; then
55- # Empty, so the app is not running: bring the workspace to the monitor in use
56- # before focusing, so the app opens where you are. move-workspace-to-monitor
57- # takes --reference; the positional argument is the OUTPUT.
5834 focused=$(jq -r '.[] | select(.is_focused == true) | .output' <<<"$ws_json")
5935 home=$(jq -r --arg w "$ws" '.[] | select(.name == $w) | .output' <<<"$ws_json")
60- # || true: a failed move must not take the focus and the launch down with it
61- # under `set -e`. Worst case the app opens on the workspace's own monitor.
6236 if [ -n "$focused" ] && [ "$focused" != "$home" ]; then
6337 niri msg action move-workspace-to-monitor --reference "$ws" "$focused" >/dev/null || true
6438 fi
@@ -66,8 +40,6 @@ fi
6640
6741 niri msg action focus-workspace "$ws" >/dev/null
6842
69-# Launch only when the workspace holds nothing, so a second press is "go there"
70-# rather than a duplicate app.
7143 if [ "$count" -eq 0 ] && [ "$#" -gt 0 ]; then
7244 setsid "$@" >/dev/null 2>&1 &
7345 fi
.config/scripts/niri/workspace_nav.shmodified+1 -31
@@ -1,33 +1,8 @@
11 #!/usr/bin/env bash
2-# Navigate only the PLAIN (unnamed) workspaces, skipping the named app ones.
3-#
4-# usage: workspace_nav.sh focus <N> focus the Nth plain workspace
5-# workspace_nav.sh move <N> move focused column to it
6-# workspace_nav.sh next|prev focus the next/previous plain one
7-# workspace_nav.sh move-next|move-prev
8-# workspace_nav.sh up|down focus within the column, else the
9-# workspace above/below
10-# workspace_nav.sh move-up|move-down same, moving the window
11-#
12-# Why this exists: niri workspace numbers are indices into each output's live
13-# workspace list, and the named app workspaces (code, github, ...) live in that
14-# same list — so Mod+3 could land on "discord". The app workspaces are reachable
15-# by their own Alt+<letter> binds, and should be invisible to number and
16-# directional navigation.
17-#
18-# Everything is scoped to the focused output, matching niri's own per-output
19-# indices. N beyond the number of plain workspaces clamps to the last one; niri
20-# always keeps one empty unnamed workspace at the end of each output, so there
21-# is always at least one target.
222 set -euo pipefail
233
244 action="${1:?usage: workspace_nav.sh focus|move|next|prev|move-next|move-prev|up|down|move-up|move-down [N]}"
255
26-# Vertical motion: niri stacks workspaces vertically, so "down" means the next
27-# window in the column when there is one, and otherwise the workspace below.
28-# Whether the in-column action did anything is decided by comparing the focused
29-# window's row before and after — cheaper and more robust than reimplementing
30-# niri's column arithmetic.
316 if [ "$action" = "up" ] || [ "$action" = "down" ] || [ "$action" = "move-up" ] || [ "$action" = "move-down" ]; then
327 row_of_focused() {
338 niri msg -j windows | jq -r '.[] | select(.is_focused == true) | .layout.pos_in_scrolling_layout | "\(.[0]),\(.[1])"'
@@ -45,11 +20,9 @@ if [ "$action" = "up" ] || [ "$action" = "down" ] || [ "$action" = "move-up" ] |
4520 after=$(row_of_focused)
4621
4722 if [ -n "$before" ] && [ "$before" != "$after" ]; then
48- exit 0 # the in-column move worked
23+ exit 0
4924 fi
5025
51- # Nowhere to go inside the column: fall through to the workspace above/below,
52- # which is the plain-workspace navigation below.
5326 case "$action" in
5427 up) action="prev" ;;
5528 down) action="next" ;;
@@ -61,14 +34,12 @@ fi
6134 ws_json=$(niri msg -j workspaces)
6235 output=$(jq -r '.[] | select(.is_focused == true) | .output' <<<"$ws_json")
6336
64-# Indices of the plain workspaces on this output, in list order.
6537 mapfile -t plain < <(jq -r --arg o "$output" '
6638 [ .[] | select(.output == $o and .name == null) ] | sort_by(.idx) | .[] | .idx
6739 ' <<<"$ws_json")
6840
6941 [ "${#plain[@]}" -gt 0 ] || exit 0
7042
71-# Where the currently focused workspace sits among them (-1 if it is a named one).
7243 current_idx=$(jq -r --arg o "$output" '.[] | select(.output == $o and .is_active == true) | .idx' <<<"$ws_json")
7344 pos=-1
7445 for i in "${!plain[@]}"; do
@@ -89,7 +60,6 @@ focus | move)
8960 target="${plain[$i]}"
9061 ;;
9162 next | move-next)
92- # From a named workspace, "next" means the first plain one.
9363 if [ "$pos" -lt 0 ]; then
9464 target="${plain[0]}"
9565 else
.config/scripts/niri/workspace_startup.shmodified+0 -11
@@ -1,15 +1,4 @@
11 #!/usr/bin/env bash
2-# Put every output on a plain (unnamed) workspace at login.
3-#
4-# The app workspaces are declared in config.kdl, so niri creates them all on one
5-# output at startup and that output comes up showing "code" — the first declared
6-# one — instead of an empty workspace. Nothing else moves them until their
7-# Alt+<letter> bind runs, so the fix is a one-shot nudge: focus the first plain
8-# workspace on each output, then hand focus back to the output that had it
9-# (the one with `focus-at-startup`).
10-#
11-# focus-workspace takes an index into the FOCUSED output's list, hence the
12-# focus-monitor before each one — same reason workspace_nav.sh scopes by output.
132 set -euo pipefail
143
154 ws=$(niri msg -j workspaces)
.config/scripts/system/power_menu.shmodified+0 -16
@@ -1,9 +1,5 @@
11 #!/bin/bash
22
3-# Power Management Menu
4-# Provides quick access to suspend, shutdown, reboot, and logout options
5-
6-# Create menu options
73 menu=$(echo -e "🔴 Shutdown\n🔄 Reboot\n😴 Suspend\n🚪 Logout\n❌ Cancel" | rofi -dmenu -p "Power" -i)
84
95 case "$menu" in
@@ -17,18 +13,6 @@ case "$menu" in
1713 systemctl suspend
1814 ;;
1915 "🚪 Logout")
20- # Shared by both compositors, so the exit command is picked at runtime.
21- # hyprctl is a no-op under niri, which is what silently broke logout.
22- #
23- # Hyprland is checked FIRST on purpose: niri pushes NIRI_SOCKET into the
24- # systemd --user manager environment and never unsets it on exit, so a
25- # niri -> Hyprland switch that kept the same user manager alive would
26- # leave a stale NIRI_SOCKET behind, and `niri msg` does not fall back to
27- # socket discovery — it just errors out. That would mirror this very bug
28- # onto Hyprland. The leak only goes that direction, so ordering fixes it.
29- #
30- # -s skips niri's "Press Enter to confirm" prompt, which has nowhere to
31- # be answered when the quit comes from a rofi menu.
3216 if [ -n "${HYPRLAND_INSTANCE_SIGNATURE:-}" ]; then
3317 hyprctl dispatch exit
3418 elif [ -n "${NIRI_SOCKET:-}" ]; then