From e35fe20f676d11a711891a03230bc619776ec3b2 Mon Sep 17 00:00:00 2001 From: Xiang Ji Date: Thu, 11 Apr 2024 16:17:38 +0200 Subject: [PATCH 1/2] Support a fifth screen --- Amethyst/Events/HotKeyManager.swift | 4 ++-- Amethyst/default.amethyst | 8 ++++++++ README.md | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Amethyst/Events/HotKeyManager.swift b/Amethyst/Events/HotKeyManager.swift index d9bf2cce..5cf9557c 100644 --- a/Amethyst/Events/HotKeyManager.swift +++ b/Amethyst/Events/HotKeyManager.swift @@ -198,7 +198,7 @@ class HotKeyManager: NSObject { } } - (1...4).forEach { screenNumber in + (1...5).forEach { screenNumber in let focusCommandKey = "\(CommandKey.focusScreenPrefix.rawValue)-\(screenNumber)" let throwCommandKey = "\(CommandKey.throwScreenPrefix.rawValue)-\(screenNumber)" @@ -392,7 +392,7 @@ class HotKeyManager: NSObject { hotKeyNameToDefaultsKey.append([name, "\(CommandKey.throwSpacePrefix.rawValue)-\(spaceNumber)"]) } - (1...4).forEach { screenNumber in + (1...5).forEach { screenNumber in let focusCommandName = "Focus screen \(screenNumber)" let throwCommandName = "Throw focused window to screen \(screenNumber)" let focusCommandKey = "\(CommandKey.focusScreenPrefix.rawValue)-\(screenNumber)" diff --git a/Amethyst/default.amethyst b/Amethyst/default.amethyst index ee0d878b..38123126 100644 --- a/Amethyst/default.amethyst +++ b/Amethyst/default.amethyst @@ -62,6 +62,10 @@ "mod": "mod1", "key": "q" }, + "focus-screen-5": { + "mod": "mod1", + "key": "g" + }, "throw-screen-1": { "mod": "mod2", "key": "w" @@ -78,6 +82,10 @@ "mod": "mod2", "key": "q" }, + "throw-screen-5": { + "mod": "mod2", + "key": "g" + }, "shrink-main": { "mod": "mod1", "key": "h" diff --git a/README.md b/README.md index 04bd6604..e35f8aae 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,8 @@ And defines the following commands, mostly a mapping to xmonad key combinations. | `mod2 + r` | Throw focused window to screen 3 | | `mod1 + q` | Focus Screen 4 | | `mod2 + q` | Throw focused window to screen 4 | +| `mod1 + g` | Focus Screen 5 | +| `mod2 + g` | Throw focused window to screen 5 | | `mod1 + t` | Toggle float for focused window | | `mod1 + i` | Display current layout | | `mod2 + t` | Toggle global tiling | From 2f7bc040c4110ffb1d338e185aea9dfb4f83d595 Mon Sep 17 00:00:00 2001 From: Xiang Ji Date: Thu, 11 Apr 2024 16:59:23 +0200 Subject: [PATCH 2/2] Fix test --- AmethystTests/Tests/Managers/HotKeyManagerTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AmethystTests/Tests/Managers/HotKeyManagerTests.swift b/AmethystTests/Tests/Managers/HotKeyManagerTests.swift index d9764bca..95d8817e 100644 --- a/AmethystTests/Tests/Managers/HotKeyManagerTests.swift +++ b/AmethystTests/Tests/Managers/HotKeyManagerTests.swift @@ -17,7 +17,7 @@ class HotKeyManagerTests: QuickSpec { it("has the right number of screens") { let keyMapping = HotKeyManager.hotKeyNameToDefaultsKey() let screenCommands = keyMapping.filter { $0[1].hasPrefix(CommandKey.focusScreenPrefix.rawValue) } - expect(screenCommands.count).to(equal(6)) + expect(screenCommands.count).to(equal(7)) } } }