summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorsommerfeld <sommerfeld@sommerfeld.dev>2026-09-22 14:30:19 +0100
committersommerfeld <sommerfeld@sommerfeld.dev>2026-09-22 14:30:19 +0100
commit92c29300d7363b02807f5b5c1aa48eeef5e18bb2 (patch)
tree31258151ca6e3a5120aa153f5a592f9d77a0e149
parent05bf213010f4a09487c1bb67e73e61bd31bb33b7 (diff)
downloaddotfiles-92c29300d7363b02807f5b5c1aa48eeef5e18bb2.tar.gz
dotfiles-92c29300d7363b02807f5b5c1aa48eeef5e18bb2.tar.bz2
dotfiles-92c29300d7363b02807f5b5c1aa48eeef5e18bb2.zip
Use dynamic workspaces on the corporate desktop
-rw-r--r--KEYBINDS.md4
-rw-r--r--docs/canonical-laptop.md3
-rw-r--r--dot_local/lib/dotfiles/canonical_desktop.py3
-rw-r--r--tests/test_canonical_desktop.py8
4 files changed, 16 insertions, 2 deletions
diff --git a/KEYBINDS.md b/KEYBINDS.md
index ee60159..2352729 100644
--- a/KEYBINDS.md
+++ b/KEYBINDS.md
@@ -451,3 +451,7 @@ apply to this role.
Super+L remains the GNOME lock shortcut. Super+D opens the application launcher.
XF86Display remains the display-switching key; Super+P opens clipboard history.
Super+1 through Super+9 select workspaces 1 through 9; Super+0 selects workspace 10. Add Shift to move the current window to that workspace.
+
+GNOME uses dynamic workspaces. Number shortcuts select existing workspaces;
+they do not create missing ones. Empty workspaces are removed, so numbers can
+change. GNOME keeps one empty workspace at the end for new windows.
diff --git a/docs/canonical-laptop.md b/docs/canonical-laptop.md
index 5bfb789..882318f 100644
--- a/docs/canonical-laptop.md
+++ b/docs/canonical-laptop.md
@@ -334,6 +334,9 @@ controls. Ubuntu AppIndicators supplies the tray. O-Tiling provides window
tiling and movement. Emoji Copy uses Super+Period without a persistent panel
icon. The custom `EXT`, `APT`, `FAIL`, and `REBOOT` status labels are disabled.
+Workspaces are dynamic: unused workspaces are removed, with one empty workspace
+kept at the end. Workspace numbers can change as empty workspaces are removed.
+
On an existing corporate installation, run outside the sandbox:
```sh
diff --git a/dot_local/lib/dotfiles/canonical_desktop.py b/dot_local/lib/dotfiles/canonical_desktop.py
index d530058..96e4e4e 100644
--- a/dot_local/lib/dotfiles/canonical_desktop.py
+++ b/dot_local/lib/dotfiles/canonical_desktop.py
@@ -220,8 +220,7 @@ def panel(saved: dict) -> None:
def workspaces(saved: dict) -> None:
- write_key("org.gnome.mutter", "dynamic-workspaces", False, saved)
- write_key("org.gnome.desktop.wm.preferences", "num-workspaces", 10, saved)
+ write_key("org.gnome.mutter", "dynamic-workspaces", True, saved)
for number in range(1, 11):
key = str(number % 10)
for action, modifier in [("switch", ""), ("move", "<Shift>")]:
diff --git a/tests/test_canonical_desktop.py b/tests/test_canonical_desktop.py
index a8229bd..146ae9f 100644
--- a/tests/test_canonical_desktop.py
+++ b/tests/test_canonical_desktop.py
@@ -14,6 +14,14 @@ SPEC.loader.exec_module(desktop)
class DesktopTests(unittest.TestCase):
+ def test_workspaces_are_dynamic_without_a_fixed_count(self):
+ with patch.object(desktop, "write_key") as write:
+ desktop.workspaces({})
+ write.assert_any_call("org.gnome.mutter", "dynamic-workspaces", True, {})
+ self.assertFalse(
+ any(call.args[1] == "num-workspaces" for call in write.call_args_list)
+ )
+
def test_workspace_indicator_uses_numbers(self):
with patch.object(desktop, "write_key") as write:
desktop.tiling({})