mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-08-26 13:04:01 +02:00
feat(niri): reorganize workspace layout
This commit is contained in:
@@ -151,22 +151,16 @@ binds {
|
|||||||
Mod+1 { focus-workspace "1terminal"; }
|
Mod+1 { focus-workspace "1terminal"; }
|
||||||
Mod+2 { focus-workspace "2browser"; }
|
Mod+2 { focus-workspace "2browser"; }
|
||||||
Mod+3 { focus-workspace "3chat"; }
|
Mod+3 { focus-workspace "3chat"; }
|
||||||
Mod+4 { focus-workspace "4music"; }
|
Mod+4 { focus-workspace "4entertainment"; }
|
||||||
Mod+5 { focus-workspace "5mail"; }
|
Mod+5 { focus-workspace "5mail"; }
|
||||||
Mod+6 { focus-workspace "6file"; }
|
Mod+6 { focus-workspace "6utility"; }
|
||||||
Mod+7 { focus-workspace "7"; }
|
|
||||||
Mod+8 { focus-workspace "8"; }
|
|
||||||
Mod+9 { focus-workspace "9"; }
|
|
||||||
Mod+0 { focus-workspace "0other"; }
|
Mod+0 { focus-workspace "0other"; }
|
||||||
Mod+Ctrl+1 { move-column-to-workspace "1terminal"; }
|
Mod+Ctrl+1 { move-column-to-workspace "1terminal"; }
|
||||||
Mod+Ctrl+2 { move-column-to-workspace "2browser"; }
|
Mod+Ctrl+2 { move-column-to-workspace "2browser"; }
|
||||||
Mod+Ctrl+3 { move-column-to-workspace "3chat"; }
|
Mod+Ctrl+3 { move-column-to-workspace "3chat"; }
|
||||||
Mod+Ctrl+4 { move-column-to-workspace "4music"; }
|
Mod+Ctrl+4 { move-column-to-workspace "4entertainment"; }
|
||||||
Mod+Ctrl+5 { move-column-to-workspace "5mail"; }
|
Mod+Ctrl+5 { move-column-to-workspace "5mail"; }
|
||||||
Mod+Ctrl+6 { move-column-to-workspace "6file"; }
|
Mod+Ctrl+6 { move-column-to-workspace "6utility"; }
|
||||||
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"; }
|
Mod+Ctrl+0 { move-column-to-workspace "0other"; }
|
||||||
|
|
||||||
// Alternatively, there are commands to move just a single window:
|
// Alternatively, there are commands to move just a single window:
|
||||||
|
|||||||
@@ -61,66 +61,77 @@ window-rule {
|
|||||||
open-on-workspace "3chat"
|
open-on-workspace "3chat"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gaming applications - open in workspace 4
|
// Entertainment applications - open in workspace 4
|
||||||
window-rule {
|
window-rule {
|
||||||
match app-id="steam"
|
match app-id="steam"
|
||||||
open-on-workspace "4gaming"
|
open-on-workspace "4entertainment"
|
||||||
}
|
}
|
||||||
window-rule {
|
window-rule {
|
||||||
match app-id="steam_app_default"
|
match app-id="steam_app_default"
|
||||||
open-on-workspace "4gaming"
|
open-on-workspace "4entertainment"
|
||||||
}
|
}
|
||||||
window-rule {
|
window-rule {
|
||||||
match app-id="heroic"
|
match app-id="heroic"
|
||||||
open-on-workspace "4gaming"
|
open-on-workspace "4entertainment"
|
||||||
}
|
}
|
||||||
window-rule {
|
window-rule {
|
||||||
match app-id="net.lutris.Lutris"
|
match app-id="net.lutris.Lutris"
|
||||||
open-on-workspace "4gaming"
|
open-on-workspace "4entertainment"
|
||||||
}
|
}
|
||||||
window-rule {
|
window-rule {
|
||||||
match app-id="com.vysp3r.ProtonPlus"
|
match app-id="com.vysp3r.ProtonPlus"
|
||||||
open-on-workspace "4gaming"
|
open-on-workspace "4entertainment"
|
||||||
}
|
}
|
||||||
window-rule {
|
window-rule {
|
||||||
// Run anime games on Linux
|
// Run anime games on Linux
|
||||||
match app-id="^moe.launcher"
|
match app-id="^moe.launcher"
|
||||||
open-on-workspace "4gaming"
|
open-on-workspace "4entertainment"
|
||||||
}
|
}
|
||||||
window-rule {
|
window-rule {
|
||||||
// All *.exe (Windows applications)
|
// All *.exe (Windows applications)
|
||||||
match app-id=".exe$"
|
match app-id=".exe$"
|
||||||
open-on-workspace "4gaming"
|
open-on-workspace "4entertainment"
|
||||||
|
}
|
||||||
|
window-rule {
|
||||||
|
match app-id="^mpv$"
|
||||||
|
open-on-workspace "4entertainment"
|
||||||
}
|
}
|
||||||
|
|
||||||
// File management applications - open in workspace 6
|
// Utility applications - open in workspace 6
|
||||||
window-rule {
|
window-rule {
|
||||||
match app-id="com.github.johnfactotum.Foliate"
|
match app-id="com.github.johnfactotum.Foliate"
|
||||||
open-on-workspace "6file"
|
open-on-workspace "6utility"
|
||||||
}
|
}
|
||||||
window-rule {
|
window-rule {
|
||||||
match app-id="thunar"
|
match app-id="thunar"
|
||||||
open-on-workspace "6file"
|
open-on-workspace "6utility"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Other applications - open in workspace 0
|
|
||||||
window-rule {
|
window-rule {
|
||||||
match app-id="Clash-verge"
|
match app-id="^Clash-verge$"
|
||||||
open-on-workspace "0other"
|
match app-id="^[.]clash-verge-wrapped$"
|
||||||
|
open-on-workspace "6utility"
|
||||||
|
}
|
||||||
|
window-rule {
|
||||||
|
match app-id="^org[.]kde[.]easyeffects$"
|
||||||
|
open-on-workspace "6utility"
|
||||||
}
|
}
|
||||||
window-rule {
|
window-rule {
|
||||||
match app-id="Zoom Workplace"
|
match app-id="Zoom Workplace"
|
||||||
// Zoom Home Page
|
// Zoom Home Page
|
||||||
match title="^(Zoom Workplace)( - Free account)?$"
|
match title="^(Zoom Workplace)( - Free account)?$"
|
||||||
open-on-workspace "0other"
|
open-on-workspace "6utility"
|
||||||
}
|
}
|
||||||
window-rule {
|
window-rule {
|
||||||
match app-id="Zoom Workplace"
|
match app-id="Zoom Workplace"
|
||||||
// Zoom - other windows
|
// Zoom - other windows
|
||||||
exclude title="^(Zoom Workplace)( - Free account)?$"
|
exclude title="^(Zoom Workplace)( - Free account)?$"
|
||||||
open-on-workspace "0other"
|
open-on-workspace "6utility"
|
||||||
open-floating true
|
open-floating true
|
||||||
}
|
}
|
||||||
|
window-rule {
|
||||||
|
match app-id="^Zoom$"
|
||||||
|
open-on-workspace "6utility"
|
||||||
|
}
|
||||||
window-rule {
|
window-rule {
|
||||||
match app-id="^Zoom$" title="^as_toolbar$"
|
match app-id="^Zoom$" title="^as_toolbar$"
|
||||||
open-floating true
|
open-floating true
|
||||||
|
|||||||
@@ -1,17 +1,38 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Reorder named workspaces so indices match their numeric prefixes:
|
# Niri keeps a separate workspace index sequence on each output.
|
||||||
# 1 → "1terminal", 2 → "2browser", ..., 6 → "6file", 10 → "0other".
|
case "$(hostname)" in
|
||||||
# Requires a running niri session and the `niri msg` command in PATH.
|
ai)
|
||||||
|
workspace_order=(
|
||||||
|
"4entertainment:1"
|
||||||
|
"2browser:2"
|
||||||
|
"0other:3"
|
||||||
|
"1terminal:1"
|
||||||
|
"3chat:2"
|
||||||
|
"6utility:3"
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
shoukei)
|
||||||
|
workspace_order=(
|
||||||
|
"1terminal:1"
|
||||||
|
"2browser:2"
|
||||||
|
"3chat:3"
|
||||||
|
"4entertainment:4"
|
||||||
|
"5mail:5"
|
||||||
|
"6utility:6"
|
||||||
|
"0other:7"
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
printf 'No workspace order configured for host %s\n' "$(hostname)" >&2
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
niri msg action move-workspace-to-index 1 --reference "1terminal"
|
for entry in "${workspace_order[@]}"; do
|
||||||
niri msg action move-workspace-to-index 2 --reference "2browser"
|
workspace="${entry%%:*}"
|
||||||
niri msg action move-workspace-to-index 3 --reference "3chat"
|
index="${entry##*:}"
|
||||||
niri msg action move-workspace-to-index 4 --reference "4music"
|
printf 'Moving workspace %s to index %s\n' "$workspace" "$index"
|
||||||
niri msg action move-workspace-to-index 5 --reference "5mail"
|
niri msg action move-workspace-to-index "$index" --reference "$workspace"
|
||||||
niri msg action move-workspace-to-index 6 --reference "6file"
|
done
|
||||||
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"
|
|
||||||
|
|||||||
@@ -7,12 +7,9 @@ output "eDP-1" {
|
|||||||
workspace "1terminal" { open-on-output "eDP-1"; }
|
workspace "1terminal" { open-on-output "eDP-1"; }
|
||||||
workspace "2browser" { open-on-output "eDP-1"; }
|
workspace "2browser" { open-on-output "eDP-1"; }
|
||||||
workspace "3chat" { open-on-output "eDP-1"; }
|
workspace "3chat" { open-on-output "eDP-1"; }
|
||||||
workspace "4music" { open-on-output "eDP-1"; }
|
workspace "4entertainment" { open-on-output "eDP-1"; }
|
||||||
workspace "5mail" { open-on-output "eDP-1"; }
|
workspace "5mail" { open-on-output "eDP-1"; }
|
||||||
workspace "6file" { open-on-output "eDP-1"; }
|
workspace "6utility" { 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"; }
|
workspace "0other" { open-on-output "eDP-1"; }
|
||||||
debug { render-drm-device "/dev/dri/renderD128"; }
|
debug { render-drm-device "/dev/dri/renderD128"; }
|
||||||
|
|
||||||
|
|||||||
@@ -38,14 +38,10 @@ output "HDMI-A-2" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ============= Named Workspaces =============
|
// ============= Named Workspaces =============
|
||||||
|
workspace "4entertainment" { open-on-output "DP-1"; }
|
||||||
workspace "2browser" { open-on-output "DP-1"; }
|
workspace "2browser" { open-on-output "DP-1"; }
|
||||||
workspace "4gaming" { open-on-output "DP-1"; }
|
workspace "0other" { open-on-output "DP-1"; }
|
||||||
workspace "5music" { open-on-output "DP-1"; }
|
|
||||||
|
|
||||||
workspace "1terminal" { open-on-output "HDMI-A-2"; }
|
workspace "1terminal" { open-on-output "HDMI-A-2"; }
|
||||||
workspace "3chat" { open-on-output "HDMI-A-2"; }
|
workspace "3chat" { open-on-output "HDMI-A-2"; }
|
||||||
workspace "6file" { open-on-output "HDMI-A-2"; }
|
workspace "6utility" { open-on-output "HDMI-A-2"; }
|
||||||
workspace "7" { open-on-output "HDMI-A-2"; }
|
|
||||||
workspace "8" { open-on-output "HDMI-A-2"; }
|
|
||||||
workspace "9" { open-on-output "HDMI-A-2"; }
|
|
||||||
workspace "0other" { open-on-output "HDMI-A-2"; }
|
|
||||||
|
|||||||
Reference in New Issue
Block a user