From 4c0357ff874f8250fcae621d5626aba1c7161710 Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 10 Feb 2024 19:59:52 +0100 Subject: [PATCH] sway: fix workspace 10 missing from default config (#4636) workspace 10 is part of upstream's default config, but was missing in home-manager. The initial "sway: add module" PR (02d60400035028d4c8affab24557344ca371b9fd) went through multiple iterations and had workspace 10 included for a brief moment. Until the author removed it in a force-push commenting > Have removed the last change which added bound ${modifer}+0 to workspace number 10 as this messed up workspace numbering in sway. The reason might have been, that sway used to sort the workspaces in the order they appeared in the config. Attribute sets in nix are sorted, but not "naturally sorted", meaning `bindsym Mod1+0 workspace number 10` comes before `bindsym Mod1+0 workspace number 1`. It's unclear if that's what really happened. A workaround would have been to use `lib.lists.naturalSort` in `keybindingsStr`. But I cannot reproduce this anymore in any way. I assume this has been fixed many years ago by now. upstream config: https://github.com/swaywm/sway/blob/020a572ed615b8fe272c7566a27ee0abe73a58d7/config.in#L113-L134 --- modules/services/window-managers/i3-sway/sway.nix | 3 +++ .../services/window-managers/sway/sway-bar-focused-colors.conf | 2 ++ .../sway/sway-bindkeys-to-code-and-extra-config.conf | 2 ++ tests/modules/services/window-managers/sway/sway-default.conf | 2 ++ .../window-managers/sway/sway-followmouse-expected.conf | 2 ++ .../window-managers/sway/sway-followmouse-legacy-expected.conf | 2 ++ tests/modules/services/window-managers/sway/sway-modules.conf | 2 ++ .../services/window-managers/sway/sway-null-package.conf | 2 ++ .../modules/services/window-managers/sway/sway-post-2003.conf | 2 ++ .../window-managers/sway/sway-workspace-default-expected.conf | 2 ++ .../window-managers/sway/sway-workspace-output-expected.conf | 2 ++ 11 files changed, 23 insertions(+) diff --git a/modules/services/window-managers/i3-sway/sway.nix b/modules/services/window-managers/i3-sway/sway.nix index 6f8ca84a..cc811302 100644 --- a/modules/services/window-managers/i3-sway/sway.nix +++ b/modules/services/window-managers/i3-sway/sway.nix @@ -91,6 +91,7 @@ let "${cfg.config.modifier}+7" = "workspace number 7"; "${cfg.config.modifier}+8" = "workspace number 8"; "${cfg.config.modifier}+9" = "workspace number 9"; + "${cfg.config.modifier}+0" = "workspace number 10"; "${cfg.config.modifier}+Shift+1" = "move container to workspace number 1"; @@ -110,6 +111,8 @@ let "move container to workspace number 8"; "${cfg.config.modifier}+Shift+9" = "move container to workspace number 9"; + "${cfg.config.modifier}+Shift+0" = + "move container to workspace number 10"; "${cfg.config.modifier}+Shift+minus" = "move scratchpad"; "${cfg.config.modifier}+minus" = "scratchpad show"; diff --git a/tests/modules/services/window-managers/sway/sway-bar-focused-colors.conf b/tests/modules/services/window-managers/sway/sway-bar-focused-colors.conf index 3db8b31a..448c41f4 100644 --- a/tests/modules/services/window-managers/sway/sway-bar-focused-colors.conf +++ b/tests/modules/services/window-managers/sway/sway-bar-focused-colors.conf @@ -16,6 +16,7 @@ client.urgent #2f343a #900000 #ffffff #900000 #900000 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #ffffff +bindsym Mod1+0 workspace number 10 bindsym Mod1+1 workspace number 1 bindsym Mod1+2 workspace number 2 bindsym Mod1+3 workspace number 3 @@ -29,6 +30,7 @@ bindsym Mod1+Down focus down bindsym Mod1+Left focus left bindsym Mod1+Return exec @foot@/bin/foot bindsym Mod1+Right focus right +bindsym Mod1+Shift+0 move container to workspace number 10 bindsym Mod1+Shift+1 move container to workspace number 1 bindsym Mod1+Shift+2 move container to workspace number 2 bindsym Mod1+Shift+3 move container to workspace number 3 diff --git a/tests/modules/services/window-managers/sway/sway-bindkeys-to-code-and-extra-config.conf b/tests/modules/services/window-managers/sway/sway-bindkeys-to-code-and-extra-config.conf index cbf4a8c7..d11f6f2b 100644 --- a/tests/modules/services/window-managers/sway/sway-bindkeys-to-code-and-extra-config.conf +++ b/tests/modules/services/window-managers/sway/sway-bindkeys-to-code-and-extra-config.conf @@ -18,6 +18,7 @@ client.urgent #2f343a #900000 #ffffff #900000 #900000 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #ffffff +bindsym --to-code Mod1+0 workspace number 10 bindsym --to-code Mod1+1 workspace number 1 bindsym --to-code Mod1+2 workspace number 2 bindsym --to-code Mod1+3 workspace number 3 @@ -31,6 +32,7 @@ bindsym --to-code Mod1+Down focus down bindsym --to-code Mod1+Left focus left bindsym --to-code Mod1+Return exec @foot@/bin/foot bindsym --to-code Mod1+Right focus right +bindsym --to-code Mod1+Shift+0 move container to workspace number 10 bindsym --to-code Mod1+Shift+1 move container to workspace number 1 bindsym --to-code Mod1+Shift+2 move container to workspace number 2 bindsym --to-code Mod1+Shift+3 move container to workspace number 3 diff --git a/tests/modules/services/window-managers/sway/sway-default.conf b/tests/modules/services/window-managers/sway/sway-default.conf index 620e9b3f..71a0b13f 100644 --- a/tests/modules/services/window-managers/sway/sway-default.conf +++ b/tests/modules/services/window-managers/sway/sway-default.conf @@ -16,6 +16,7 @@ client.urgent #2f343a #900000 #ffffff #900000 #900000 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #ffffff +bindsym Mod1+0 workspace number 10 bindsym Mod1+1 workspace number 1 bindsym Mod1+2 workspace number 2 bindsym Mod1+3 workspace number 3 @@ -29,6 +30,7 @@ bindsym Mod1+Down focus down bindsym Mod1+Left focus left bindsym Mod1+Return exec @foot@/bin/foot bindsym Mod1+Right focus right +bindsym Mod1+Shift+0 move container to workspace number 10 bindsym Mod1+Shift+1 move container to workspace number 1 bindsym Mod1+Shift+2 move container to workspace number 2 bindsym Mod1+Shift+3 move container to workspace number 3 diff --git a/tests/modules/services/window-managers/sway/sway-followmouse-expected.conf b/tests/modules/services/window-managers/sway/sway-followmouse-expected.conf index a61b6bc2..af259fac 100644 --- a/tests/modules/services/window-managers/sway/sway-followmouse-expected.conf +++ b/tests/modules/services/window-managers/sway/sway-followmouse-expected.conf @@ -16,6 +16,7 @@ client.urgent #2f343a #900000 #ffffff #900000 #900000 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #ffffff +bindsym Mod1+0 workspace number 10 bindsym Mod1+1 workspace number 1 bindsym Mod1+2 workspace number 2 bindsym Mod1+3 workspace number 3 @@ -29,6 +30,7 @@ bindsym Mod1+Down focus down bindsym Mod1+Left focus left bindsym Mod1+Return exec @foot@/bin/foot bindsym Mod1+Right focus right +bindsym Mod1+Shift+0 move container to workspace number 10 bindsym Mod1+Shift+1 move container to workspace number 1 bindsym Mod1+Shift+2 move container to workspace number 2 bindsym Mod1+Shift+3 move container to workspace number 3 diff --git a/tests/modules/services/window-managers/sway/sway-followmouse-legacy-expected.conf b/tests/modules/services/window-managers/sway/sway-followmouse-legacy-expected.conf index 7a822d87..1fd0003f 100644 --- a/tests/modules/services/window-managers/sway/sway-followmouse-legacy-expected.conf +++ b/tests/modules/services/window-managers/sway/sway-followmouse-legacy-expected.conf @@ -16,6 +16,7 @@ client.urgent #2f343a #900000 #ffffff #900000 #900000 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #ffffff +bindsym Mod1+0 workspace number 10 bindsym Mod1+1 workspace number 1 bindsym Mod1+2 workspace number 2 bindsym Mod1+3 workspace number 3 @@ -29,6 +30,7 @@ bindsym Mod1+Down focus down bindsym Mod1+Left focus left bindsym Mod1+Return exec @foot@/bin/foot bindsym Mod1+Right focus right +bindsym Mod1+Shift+0 move container to workspace number 10 bindsym Mod1+Shift+1 move container to workspace number 1 bindsym Mod1+Shift+2 move container to workspace number 2 bindsym Mod1+Shift+3 move container to workspace number 3 diff --git a/tests/modules/services/window-managers/sway/sway-modules.conf b/tests/modules/services/window-managers/sway/sway-modules.conf index 47c20a93..766d61de 100644 --- a/tests/modules/services/window-managers/sway/sway-modules.conf +++ b/tests/modules/services/window-managers/sway/sway-modules.conf @@ -16,6 +16,7 @@ client.urgent #2f343a #900000 #ffffff #900000 #900000 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #ffffff +bindsym Mod1+0 workspace number 10 bindsym Mod1+1 workspace number 1 bindsym Mod1+2 workspace number 2 bindsym Mod1+3 workspace number 3 @@ -29,6 +30,7 @@ bindsym Mod1+Down focus down bindsym Mod1+Left focus left bindsym Mod1+Return exec @foot@/bin/foot bindsym Mod1+Right focus right +bindsym Mod1+Shift+0 move container to workspace number 10 bindsym Mod1+Shift+1 move container to workspace number 1 bindsym Mod1+Shift+2 move container to workspace number 2 bindsym Mod1+Shift+3 move container to workspace number 3 diff --git a/tests/modules/services/window-managers/sway/sway-null-package.conf b/tests/modules/services/window-managers/sway/sway-null-package.conf index 11ae4a3e..67073371 100644 --- a/tests/modules/services/window-managers/sway/sway-null-package.conf +++ b/tests/modules/services/window-managers/sway/sway-null-package.conf @@ -16,6 +16,7 @@ client.urgent #2f343a #900000 #ffffff #900000 #900000 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #ffffff +bindsym Mod1+0 workspace number 10 bindsym Mod1+1 workspace number 1 bindsym Mod1+2 workspace number 2 bindsym Mod1+3 workspace number 3 @@ -29,6 +30,7 @@ bindsym Mod1+Down focus down bindsym Mod1+Left focus left bindsym Mod1+Return exec @foot@/bin/foot bindsym Mod1+Right focus right +bindsym Mod1+Shift+0 move container to workspace number 10 bindsym Mod1+Shift+1 move container to workspace number 1 bindsym Mod1+Shift+2 move container to workspace number 2 bindsym Mod1+Shift+3 move container to workspace number 3 diff --git a/tests/modules/services/window-managers/sway/sway-post-2003.conf b/tests/modules/services/window-managers/sway/sway-post-2003.conf index 11ae4a3e..67073371 100644 --- a/tests/modules/services/window-managers/sway/sway-post-2003.conf +++ b/tests/modules/services/window-managers/sway/sway-post-2003.conf @@ -16,6 +16,7 @@ client.urgent #2f343a #900000 #ffffff #900000 #900000 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #ffffff +bindsym Mod1+0 workspace number 10 bindsym Mod1+1 workspace number 1 bindsym Mod1+2 workspace number 2 bindsym Mod1+3 workspace number 3 @@ -29,6 +30,7 @@ bindsym Mod1+Down focus down bindsym Mod1+Left focus left bindsym Mod1+Return exec @foot@/bin/foot bindsym Mod1+Right focus right +bindsym Mod1+Shift+0 move container to workspace number 10 bindsym Mod1+Shift+1 move container to workspace number 1 bindsym Mod1+Shift+2 move container to workspace number 2 bindsym Mod1+Shift+3 move container to workspace number 3 diff --git a/tests/modules/services/window-managers/sway/sway-workspace-default-expected.conf b/tests/modules/services/window-managers/sway/sway-workspace-default-expected.conf index 604dc774..5233c0bb 100644 --- a/tests/modules/services/window-managers/sway/sway-workspace-default-expected.conf +++ b/tests/modules/services/window-managers/sway/sway-workspace-default-expected.conf @@ -16,6 +16,7 @@ client.urgent #2f343a #900000 #ffffff #900000 #900000 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #ffffff bindsym Mod1+9 workspace number 9 +bindsym Mod1+0 workspace number 10 bindsym Mod1+1 workspace number 1 bindsym Mod1+2 workspace number 2 bindsym Mod1+3 workspace number 3 @@ -28,6 +29,7 @@ bindsym Mod1+Down focus down bindsym Mod1+Left focus left bindsym Mod1+Return exec @foot@/bin/foot bindsym Mod1+Right focus right +bindsym Mod1+Shift+0 move container to workspace number 10 bindsym Mod1+Shift+1 move container to workspace number 1 bindsym Mod1+Shift+2 move container to workspace number 2 bindsym Mod1+Shift+3 move container to workspace number 3 diff --git a/tests/modules/services/window-managers/sway/sway-workspace-output-expected.conf b/tests/modules/services/window-managers/sway/sway-workspace-output-expected.conf index 63435cad..32dfd734 100644 --- a/tests/modules/services/window-managers/sway/sway-workspace-output-expected.conf +++ b/tests/modules/services/window-managers/sway/sway-workspace-output-expected.conf @@ -16,6 +16,7 @@ client.urgent #2f343a #900000 #ffffff #900000 #900000 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #ffffff +bindsym Mod1+0 workspace number 10 bindsym Mod1+1 workspace number 1 bindsym Mod1+2 workspace number 2 bindsym Mod1+3 workspace number 3 @@ -29,6 +30,7 @@ bindsym Mod1+Down focus down bindsym Mod1+Left focus left bindsym Mod1+Return exec @foot@/bin/foot bindsym Mod1+Right focus right +bindsym Mod1+Shift+0 move container to workspace number 10 bindsym Mod1+Shift+1 move container to workspace number 1 bindsym Mod1+Shift+2 move container to workspace number 2 bindsym Mod1+Shift+3 move container to workspace number 3