From 869ea8436d9cf9d5748e6c089cc0b0b58358e75f Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Sat, 26 Sep 2026 22:23:04 +0100 Subject: Align GNOME shortcuts with the Sway setup --- tests/test_canonical_desktop.py | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'tests/test_canonical_desktop.py') diff --git a/tests/test_canonical_desktop.py b/tests/test_canonical_desktop.py index 146ae9f..039948f 100644 --- a/tests/test_canonical_desktop.py +++ b/tests/test_canonical_desktop.py @@ -60,17 +60,31 @@ class DesktopTests(unittest.TestCase): with patch.object(desktop, "write_key") as write: desktop.tiling({}) schema = "org.gnome.shell.extensions.o-tiling" - for key in [ - "tile-enter", - "toggle-tiling", - "tile-orientation", - "pop-workspace-up", - "pop-workspace-down", - ]: + for key in ["toggle-tiling", "pop-workspace-up", "pop-workspace-down"]: write.assert_any_call(schema, key, [], {}) write.assert_any_call(schema, "new-window-placement", "focused", {}) - write.assert_any_call(schema, "focus-right", ["Right"], {}) + write.assert_any_call(schema, "focus-right", ["l"], {}) write.assert_any_call(schema, "tile-move-down-global", ["j"], {}) + write.assert_any_call(schema, "tile-enter", ["r"], {}) + write.assert_any_call(schema, "tile-resize-left", ["h"], {}) + + def test_desktop_bindings_release_sway_keys_and_keep_lock(self): + with patch.object(desktop, "write_key") as write: + desktop.desktop_bindings({}) + wm = "org.gnome.desktop.wm.keybindings" + media = "org.gnome.settings-daemon.plugins.media-keys" + write.assert_any_call(wm, "switch-applications", ["Tab"], {}) + write.assert_any_call(wm, "switch-input-source", [], {}) + write.assert_any_call(wm, "switch-input-source-backward", [], {}) + write.assert_any_call(media, "screensaver", ["s"], {}) + write.assert_any_call(media, "mic-mute", ["m"], {}) + + def test_workspace_cycle_keys_are_configured(self): + with patch.object(desktop, "write_key") as write: + desktop.workspaces({}) + schema = "org.gnome.shell.extensions.workspace-cycle" + write.assert_any_call(schema, "next-workspace", ["Tab"], {}) + write.assert_any_call(schema, "previous-workspace", ["Tab"], {}) def test_clipboard_shortcut_preserves_other_display_bindings(self): settings = MagicMock() -- cgit v1.3.1