From 120dd53a7f6bacc0716cffdf7bfe3c687062ceea Mon Sep 17 00:00:00 2001 From: 0x0D <126201299+0x0Dx@users.noreply.github.com> Date: Sun, 15 Mar 2026 17:04:34 +0100 Subject: [PATCH] fix(niri): add workspaces 7, 8, 9 for proper bar ordering (#246) * Create reorder-workspaces.sh * Update keybindings.kdl * Update config.kdl * Update niri-hardware.kdl * fix(niri): add workspaces 7, 8, 9 for proper bar ordering --- home/linux/gui/niri/conf/config.kdl | 2 ++ home/linux/gui/niri/conf/keybindings.kdl | 12 ++++++------ home/linux/gui/niri/reorder-workspaces.sh | 17 +++++++++++++++++ hosts/12kingdoms-shoukei/niri-hardware.kdl | 3 +++ hosts/idols-ai/niri-hardware.kdl | 3 +++ 5 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 home/linux/gui/niri/reorder-workspaces.sh diff --git a/home/linux/gui/niri/conf/config.kdl b/home/linux/gui/niri/conf/config.kdl index a6e7feba..8a3fb420 100644 --- a/home/linux/gui/niri/conf/config.kdl +++ b/home/linux/gui/niri/conf/config.kdl @@ -9,6 +9,8 @@ include "./windowrules.kdl" include "./niri-hardware.kdl" include "./noctalia-shell.kdl" +spawn-sh-at-startup "bash ~/nix-config/home/linux/gui/niri/reorder-workspaces.sh" + // Input device configuration. // Find the full list of options on the wiki: // https://yalter.github.io/niri/Configuration:-Input diff --git a/home/linux/gui/niri/conf/keybindings.kdl b/home/linux/gui/niri/conf/keybindings.kdl index 4c831f89..7a5096a2 100644 --- a/home/linux/gui/niri/conf/keybindings.kdl +++ b/home/linux/gui/niri/conf/keybindings.kdl @@ -154,9 +154,9 @@ binds { Mod+4 { focus-workspace "4music"; } Mod+5 { focus-workspace "5mail"; } Mod+6 { focus-workspace "6file"; } - Mod+7 { focus-workspace 7; } - Mod+8 { focus-workspace 8; } - Mod+9 { focus-workspace 9; } + Mod+7 { focus-workspace "7"; } + Mod+8 { focus-workspace "8"; } + Mod+9 { focus-workspace "9"; } Mod+0 { focus-workspace "0other"; } Mod+Ctrl+1 { move-column-to-workspace "1terminal"; } Mod+Ctrl+2 { move-column-to-workspace "2browser"; } @@ -164,9 +164,9 @@ binds { Mod+Ctrl+4 { move-column-to-workspace "4music"; } Mod+Ctrl+5 { move-column-to-workspace "5mail"; } Mod+Ctrl+6 { move-column-to-workspace "6file"; } - 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+Ctrl+7 { move-column-to-workspace "7"; } + Mod+Ctrl+8 { move-column-to-workspace "8"; } + Mod+Ctrl+9 { move-column-to-workspace "9"; } Mod+Ctrl+0 { move-column-to-workspace "0other"; } // Alternatively, there are commands to move just a single window: diff --git a/home/linux/gui/niri/reorder-workspaces.sh b/home/linux/gui/niri/reorder-workspaces.sh new file mode 100644 index 00000000..8bbfff4c --- /dev/null +++ b/home/linux/gui/niri/reorder-workspaces.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Reorder named workspaces so indices match their numeric prefixes: +# 1 → "1terminal", 2 → "2browser", ..., 6 → "6file", 10 → "0other". +# Requires a running niri session and the `niri msg` command in PATH. + +niri msg action move-workspace-to-index 1 --reference "1terminal" +niri msg action move-workspace-to-index 2 --reference "2browser" +niri msg action move-workspace-to-index 3 --reference "3chat" +niri msg action move-workspace-to-index 4 --reference "4music" +niri msg action move-workspace-to-index 5 --reference "5mail" +niri msg action move-workspace-to-index 6 --reference "6file" +niri msg action move-workspace-to-index 7 --reference "7" +niri msg action move-workspace-to-index 8 --reference "8" +niri msg action move-workspace-to-index 9 --reference "9" +niri msg action move-workspace-to-index 10 --reference "0other" diff --git a/hosts/12kingdoms-shoukei/niri-hardware.kdl b/hosts/12kingdoms-shoukei/niri-hardware.kdl index 2c11d0c5..a01cc3fe 100644 --- a/hosts/12kingdoms-shoukei/niri-hardware.kdl +++ b/hosts/12kingdoms-shoukei/niri-hardware.kdl @@ -10,6 +10,9 @@ workspace "3chat" { open-on-output "eDP-1"; } workspace "4music" { open-on-output "eDP-1"; } workspace "5mail" { open-on-output "eDP-1"; } workspace "6file" { open-on-output "eDP-1"; } +workspace "7" { open-on-output "eDP-1"; } +workspace "8" { open-on-output "eDP-1"; } +workspace "9" { open-on-output "eDP-1"; } workspace "0other" { open-on-output "eDP-1"; } debug { render-drm-device "/dev/dri/renderD128"; } diff --git a/hosts/idols-ai/niri-hardware.kdl b/hosts/idols-ai/niri-hardware.kdl index c2e34bb4..3a05df2b 100644 --- a/hosts/idols-ai/niri-hardware.kdl +++ b/hosts/idols-ai/niri-hardware.kdl @@ -45,4 +45,7 @@ workspace "5music" { open-on-output "DP-2"; } workspace "1terminal" { open-on-output "HDMI-A-1"; } workspace "3chat" { open-on-output "HDMI-A-1"; } workspace "6file" { open-on-output "HDMI-A-1"; } +workspace "7" { open-on-output "HDMI-A-1"; } +workspace "8" { open-on-output "HDMI-A-1"; } +workspace "9" { open-on-output "HDMI-A-1"; } workspace "0other" { open-on-output "HDMI-A-1"; }