Skip to content

Commit

Permalink
Support a fifth screen (#1627)
Browse files Browse the repository at this point in the history
  • Loading branch information
x-ji committed Apr 28, 2024
1 parent 1861c11 commit d465051
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Amethyst/Events/HotKeyManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class HotKeyManager<Application: ApplicationType>: NSObject {
}
}

(1...4).forEach { screenNumber in
(1...5).forEach { screenNumber in
let focusCommandKey = "\(CommandKey.focusScreenPrefix.rawValue)-\(screenNumber)"
let throwCommandKey = "\(CommandKey.throwScreenPrefix.rawValue)-\(screenNumber)"

Expand Down Expand Up @@ -392,7 +392,7 @@ class HotKeyManager<Application: ApplicationType>: 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)"
Expand Down
8 changes: 8 additions & 0 deletions Amethyst/default.amethyst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
"mod": "mod1",
"key": "q"
},
"focus-screen-5": {
"mod": "mod1",
"key": "g"
},
"throw-screen-1": {
"mod": "mod2",
"key": "w"
Expand All @@ -78,6 +82,10 @@
"mod": "mod2",
"key": "q"
},
"throw-screen-5": {
"mod": "mod2",
"key": "g"
},
"shrink-main": {
"mod": "mod1",
"key": "h"
Expand Down
2 changes: 1 addition & 1 deletion AmethystTests/Tests/Managers/HotKeyManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class HotKeyManagerTests: QuickSpec {
it("has the right number of screens") {
let keyMapping = HotKeyManager<SIApplication>.hotKeyNameToDefaultsKey()
let screenCommands = keyMapping.filter { $0[1].hasPrefix(CommandKey.focusScreenPrefix.rawValue) }
expect(screenCommands.count).to(equal(6))
expect(screenCommands.count).to(equal(7))
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down

0 comments on commit d465051

Please sign in to comment.