Skip to content

Commit 87b2335

Browse files
committed
WIP: config #2
1 parent 38c74a0 commit 87b2335

File tree

10 files changed

+450
-105
lines changed

10 files changed

+450
-105
lines changed

AeroSpace.xcodeproj/project.pbxproj

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
1CB4082BE5C95CA8CD52BED9 /* Maybe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345148B22F8A8F85109229AE /* Maybe.swift */; };
1616
2F8DC074DAB97DC87E07A559 /* Bundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9CAC977020A08D0227FAFB2 /* Bundle.swift */; };
1717
4005ECE237BD9230F74CA917 /* TreeNodeEx.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8C39B0C4E4888832129C4C7 /* TreeNodeEx.swift */; };
18+
45EA2D1C90430C432E123B51 /* keysMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C0D40CBD65704BA9595C2FA /* keysMap.swift */; };
1819
518B9E5AC031C24C7C84CD70 /* MacWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 243F29F496F7463F3482DD10 /* MacWindow.swift */; };
1920
6317AB471F4C4F5D66A25784 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EEDBFFCA7A77D96B18FB0732 /* Assets.xcassets */; };
2021
64A058E536F1EEF7F01043AF /* TOMLKit in Frameworks */ = {isa = PBXBuildFile; productRef = EC8E4F2CA4FF8884F9F59975 /* TOMLKit */; };
@@ -26,20 +27,22 @@
2627
852F88894A3B9FC385563665 /* HotKey in Frameworks */ = {isa = PBXBuildFile; productRef = 42BC1E757EF69233C2262FF4 /* HotKey */; };
2728
920FDF8498DCCB62149D1719 /* Monitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6507EBAA795220FD0C05384 /* Monitor.swift */; };
2829
96593DF93A69CA2E05189A3F /* axObservers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E6F3930E3BF5D8196A20E9B /* axObservers.swift */; };
30+
A0765C31043BCFB0420BF1C9 /* parseConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67DBAF4ECF8A0B931FC34EAD /* parseConfig.swift */; };
2931
A2CBF9674964F9083BB198D2 /* ArrayEx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 883D7F7F87FBE7D0BDE4E87F /* ArrayEx.swift */; };
3032
A4F66097ADF0FD58C6B715AE /* NSWorkspaceEx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6935AF0A2DB3D186D1C6218F /* NSWorkspaceEx.swift */; };
3133
AE76A183D0454E4C8ADCE380 /* SequenceEx.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAE5DCAEC5EE619CE33859E7 /* SequenceEx.swift */; };
3234
B0D0C37BAE7E7F0D0FF1E9FC /* GlobalObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C2E5977331398421A4FC168 /* GlobalObserver.swift */; };
3335
B1E2002BB8F70F2555AAA82D /* TreeNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = D295CA45172ADBDB1E4DF708 /* TreeNode.swift */; };
3436
B3702BB393A9B03CCAE4C60E /* refresh.swift in Sources */ = {isa = PBXBuildFile; fileRef = 526B113159987FA43EA41120 /* refresh.swift */; };
3537
C0A88261ECF505FC5648FC0A /* OptionalEx.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9EDFD4A9F45182CA6E0BD7B /* OptionalEx.swift */; };
36-
C39C2054893A6506C35732D7 /* config.swift in Sources */ = {isa = PBXBuildFile; fileRef = 651C5EE18862C252795811B3 /* config.swift */; };
38+
D4F68F33C6E354856C80E729 /* ConfigModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6C3C4DD77B74C92C8C01E39 /* ConfigModel.swift */; };
3739
E2FD8E2B2D2BE6B88BF8E8AD /* accessibility.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE605CF46DE6377C69B9D49D /* accessibility.swift */; };
3840
F2AFA702961A1D653EB7D269 /* command.swift in Sources */ = {isa = PBXBuildFile; fileRef = 776E3F4EE298A9C69C97EF7F /* command.swift */; };
3941
/* End PBXBuildFile section */
4042

4143
/* Begin PBXFileReference section */
4244
09685297933511208058F7CF /* AeroSpace.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AeroSpace.app; sourceTree = BUILT_PRODUCTS_DIR; };
45+
1C0D40CBD65704BA9595C2FA /* keysMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = keysMap.swift; sourceTree = "<group>"; };
4346
1E81623E8954701269A22322 /* AeroSpaceApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AeroSpaceApp.swift; sourceTree = "<group>"; };
4447
243F29F496F7463F3482DD10 /* MacWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MacWindow.swift; sourceTree = "<group>"; };
4548
24F99E8C4FD17A1D939C41F1 /* ViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewModel.swift; sourceTree = "<group>"; };
@@ -50,7 +53,7 @@
5053
3E05FB0C7158C8B6DECBD603 /* TilingContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TilingContainer.swift; sourceTree = "<group>"; };
5154
51CE37C1B8D858C81A396F40 /* CollectionEx.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionEx.swift; sourceTree = "<group>"; };
5255
526B113159987FA43EA41120 /* refresh.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = refresh.swift; sourceTree = "<group>"; };
53-
651C5EE18862C252795811B3 /* config.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = config.swift; sourceTree = "<group>"; };
56+
67DBAF4ECF8A0B931FC34EAD /* parseConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = parseConfig.swift; sourceTree = "<group>"; };
5457
6935AF0A2DB3D186D1C6218F /* NSWorkspaceEx.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSWorkspaceEx.swift; sourceTree = "<group>"; };
5558
776E3F4EE298A9C69C97EF7F /* command.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = command.swift; sourceTree = "<group>"; };
5659
7E6F3930E3BF5D8196A20E9B /* axObservers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = axObservers.swift; sourceTree = "<group>"; };
@@ -63,6 +66,7 @@
6366
BEF353340822CD20E9DAB3EC /* AeroSpace.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AeroSpace.entitlements; sourceTree = "<group>"; };
6467
D295CA45172ADBDB1E4DF708 /* TreeNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TreeNode.swift; sourceTree = "<group>"; };
6568
D6296D5F9AFE5F266EE4B1D0 /* MacApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MacApp.swift; sourceTree = "<group>"; };
69+
D6C3C4DD77B74C92C8C01E39 /* ConfigModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigModel.swift; sourceTree = "<group>"; };
6670
EC2F56249A233EC9806D0F08 /* Bridged-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Bridged-Header.h"; sourceTree = "<group>"; };
6771
EE605CF46DE6377C69B9D49D /* accessibility.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = accessibility.swift; sourceTree = "<group>"; };
6872
EEDBFFCA7A77D96B18FB0732 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
@@ -107,8 +111,10 @@
107111
isa = PBXGroup;
108112
children = (
109113
776E3F4EE298A9C69C97EF7F /* command.swift */,
110-
651C5EE18862C252795811B3 /* config.swift */,
114+
D6C3C4DD77B74C92C8C01E39 /* ConfigModel.swift */,
111115
BA7CD89E786588324DFB5575 /* defaultConfig.swift */,
116+
1C0D40CBD65704BA9595C2FA /* keysMap.swift */,
117+
67DBAF4ECF8A0B931FC34EAD /* parseConfig.swift */,
112118
);
113119
path = config;
114120
sourceTree = "<group>";
@@ -247,6 +253,7 @@
247253
A2CBF9674964F9083BB198D2 /* ArrayEx.swift in Sources */,
248254
2F8DC074DAB97DC87E07A559 /* Bundle.swift in Sources */,
249255
1C46EBB55D401C0D1AFD50F0 /* CollectionEx.swift in Sources */,
256+
D4F68F33C6E354856C80E729 /* ConfigModel.swift in Sources */,
250257
B0D0C37BAE7E7F0D0FF1E9FC /* GlobalObserver.swift in Sources */,
251258
7FE92DDAC2F094C83A177914 /* MacApp.swift in Sources */,
252259
518B9E5AC031C24C7C84CD70 /* MacWindow.swift in Sources */,
@@ -265,8 +272,9 @@
265272
E2FD8E2B2D2BE6B88BF8E8AD /* accessibility.swift in Sources */,
266273
96593DF93A69CA2E05189A3F /* axObservers.swift in Sources */,
267274
F2AFA702961A1D653EB7D269 /* command.swift in Sources */,
268-
C39C2054893A6506C35732D7 /* config.swift in Sources */,
269275
082EECCB2607F31DCBBF3870 /* defaultConfig.swift in Sources */,
276+
45EA2D1C90430C432E123B51 /* keysMap.swift in Sources */,
277+
A0765C31043BCFB0420BF1C9 /* parseConfig.swift in Sources */,
270278
B3702BB393A9B03CCAE4C60E /* refresh.swift in Sources */,
271279
6820E6846AE51B6988B6F673 /* utils.swift in Sources */,
272280
);
@@ -352,7 +360,7 @@
352360
"@executable_path/../Frameworks",
353361
);
354362
MACOSX_DEPLOYMENT_TARGET = 13.0;
355-
MARKETING_VERSION = 0.0.1;
363+
MARKETING_VERSION = "0.0.1-Alpha";
356364
PRODUCT_BUNDLE_IDENTIFIER = bobko.debug.AeroSpace;
357365
PRODUCT_NAME = "AeroSpace-Debug";
358366
SDKROOT = macosx;
@@ -434,7 +442,7 @@
434442
"@executable_path/../Frameworks",
435443
);
436444
MACOSX_DEPLOYMENT_TARGET = 13.0;
437-
MARKETING_VERSION = 0.0.1;
445+
MARKETING_VERSION = "0.0.1-Alpha";
438446
PRODUCT_BUNDLE_IDENTIFIER = bobko.AeroSpace;
439447
PRODUCT_NAME = AeroSpace;
440448
SDKROOT = macosx;

README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
AeroSpace is a tiling window manager for macOS.
44

5+
## Status
6+
7+
🚧 **Work in progress.** Alpha quality. 🚧
8+
9+
- Please expect a lot of bugs
10+
- Please expect that documentation isn't complete
11+
- Please expect that something doesn't work as expected, or doesn't work at all
12+
- Please expect breaking changes in config format in future releases
13+
514
## Key features
615

716
- **Manual** tiling window manager
@@ -16,7 +25,9 @@ AeroSpace is a tiling window manager for macOS.
1625

1726
## How to build the project
1827

19-
You would need a mac. Run in terminal:
28+
You would need a mac.
29+
30+
Firstly, install [xcodegen](https://github.com/yonaskolb/XcodeGen). Then run in terminal:
2031
```bash
2132
./build-debug.sh
2233
```
@@ -28,20 +39,16 @@ You would need a mac. Run in terminal:
2839
- select parent -> outline several windows?
2940
- OR: outline with "SLSSetWindowOpacity"
3041
- OR: "shake" windows
31-
- settings
3242
- CLI interface
3343
- Check all todos in code
34-
- move vs swap (swap requires position and size proportions decoupling from windows)
44+
- move vs swap
3545
- what is src/Assets.xcassets ?
3646
- license
3747
- unminimize apps automatically
48+
- minimized apps handling
49+
- macOS fullscreen apps handling
3850
- unhide apps automatically
3951

40-
## Tests
41-
42-
- Test main monitor change
43-
- Test monitor add/remove
44-
4552
## Challenges
4653

4754
- Window overlapping

config-examples/default-config.toml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
[config]
2+
use-padding-for-nested-containers-with-the-same-orientation = true
3+
auto-flatten-containers = true
4+
# auto-different-orientation-for-nested-containers = true
5+
# start-at-login = true
6+
floating-windows-on-top = true
7+
8+
[mode.main.binding]
9+
alt-enter = 'bash /usr/bin/open /System/Applications/Utilities/Terminal.app'
10+
11+
alt-shift-quote = 'focus child'
12+
alt-quote = 'focus parent'
13+
alt-slash = 'layout toggle h_list v_list'
14+
alt-comma = 'layout toggle h_accordion v_accordion'
15+
16+
# todo focus floating binding
17+
18+
# Focus window
19+
alt-k = ['focus tiling', 'focus up']
20+
alt-h = ['focus tiling', 'focus left']
21+
alt-j = ['focus tiling', 'focus down']
22+
alt-l = ['focus tiling', 'focus right']
23+
24+
# Move window
25+
alt-shift-k = 'move_through up'
26+
alt-shift-h = 'move_through left'
27+
alt-shift-j = 'move_through down'
28+
alt-shift-l = 'move_through right'
29+
30+
# Resize window
31+
alt-shift-minus = 'resize shrink height 2 px'
32+
alt-shift-equal = 'resize grow height 2 px'
33+
alt-shift-comma = 'resize shrink width 2 px'
34+
alt-shift-period = 'resize grow width 2 px'
35+
36+
alt-0 = 'workspace 000'
37+
alt-1 = 'workspace 111'
38+
alt-2 = 'workspace 222'
39+
alt-3 = 'workspace 333'
40+
alt-4 = 'workspace 444'
41+
alt-5 = 'workspace 555'
42+
alt-6 = 'workspace 666'
43+
alt-7 = 'workspace 777'
44+
alt-8 = 'workspace 888'
45+
alt-9 = 'workspace 999'
46+
alt-a = 'workspace AAA'
47+
alt-b = 'workspace BBB'
48+
alt-c = 'workspace CCC'
49+
alt-d = 'workspace DDD'
50+
alt-e = 'workspace EEE'
51+
alt-f = 'workspace FFF'
52+
alt-g = 'workspace GGG'
53+
alt-i = 'workspace III'
54+
alt-m = 'workspace MMM'
55+
alt-n = 'workspace NNN'
56+
alt-o = 'workspace OOO'
57+
alt-p = 'workspace PPP'
58+
alt-q = 'workspace QQQ'
59+
alt-r = 'workspace RRR'
60+
alt-s = 'workspace SSS'
61+
alt-t = 'workspace TTT'
62+
alt-u = 'workspace UUU'
63+
alt-v = 'workspace VVV'
64+
alt-w = 'workspace WWW'
65+
alt-x = 'workspace XXX'
66+
alt-y = 'workspace YYY'
67+
alt-z = 'workspace ZZZ'
68+
69+
alt-shift-0 = 'move container to workspace 000'
70+
alt-shift-1 = 'move container to workspace 111'
71+
alt-shift-2 = 'move container to workspace 222'
72+
alt-shift-3 = 'move container to workspace 333'
73+
alt-shift-4 = 'move container to workspace 444'
74+
alt-shift-5 = 'move container to workspace 555'
75+
alt-shift-6 = 'move container to workspace 666'
76+
alt-shift-7 = 'move container to workspace 777'
77+
alt-shift-8 = 'move container to workspace 888'
78+
alt-shift-9 = 'move container to workspace 999'
79+
alt-shift-a = 'move container to workspace AAA'
80+
alt-shift-b = 'move container to workspace BBB'
81+
alt-shift-c = 'move container to workspace CCC'
82+
alt-shift-d = 'move container to workspace DDD'
83+
alt-shift-e = 'move container to workspace EEE'
84+
alt-shift-f = 'move container to workspace FFF'
85+
alt-shift-g = 'move container to workspace GGG'
86+
alt-shift-i = 'move container to workspace III'
87+
alt-shift-m = 'move container to workspace MMM'
88+
alt-shift-n = 'move container to workspace NNN'
89+
alt-shift-o = 'move container to workspace OOO'
90+
alt-shift-p = 'move container to workspace PPP'
91+
alt-shift-q = 'move container to workspace QQQ'
92+
alt-shift-r = 'move container to workspace RRR'
93+
alt-shift-s = 'move container to workspace SSS'
94+
alt-shift-t = 'move container to workspace TTT'
95+
alt-shift-u = 'move container to workspace UUU'
96+
alt-shift-v = 'move container to workspace VVV'
97+
alt-shift-w = 'move container to workspace WWW'
98+
alt-shift-x = 'move container to workspace XXX'
99+
alt-shift-y = 'move container to workspace YYY'
100+
alt-shift-z = 'move container to workspace ZZZ'
101+
102+
alt-tab = 'workspace back_and_forth'
103+
104+
alt-shift-slash.alt-shift-k = 'move_in up'
105+
alt-shift-slash.alt-shift-h = 'move_in left'
106+
alt-shift-slash.alt-shift-j = 'move_in down'
107+
alt-shift-slash.alt-shift-l = 'move_in right'
108+
109+
# aerospace config set mode.main.binding.alt-l 'focus tiling' 'focus right'
110+
# aerospace config set mode.main.binding.alt-enter 'basn alacritty'
111+
# aerospace config set mode.main.binding.alt-shift-slash.alt-shift-l 'move_in right'
112+
# aerospace config set config.start-at-login false
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Reference: https://github.com/i3/i3/blob/next/etc/config
2+
3+
auto-flatten-containers = false
4+
5+
[mode.main.binding]
6+
alt-enter = 'bash /usr/bin/open /System/Applications/Utilities/Terminal.app'
7+
8+
alt-h = 'focus left'
9+
alt-j = 'focus down'
10+
alt-k = 'focus up'
11+
alt-l = 'focus right'
12+
13+
alt-shift-h = 'move_through left'
14+
alt-shift-j = 'move_through down'
15+
alt-shift-k = 'move_through up'
16+
alt-shift-l = 'move_through right'
17+
18+
# alt-h = 'split h' # todo support split command?
19+
# alt-v = 'split v' # todo support split command?
20+
21+
# alt-f = 'fullscreen' # todo support fullscreen command?
22+
23+
alt-s = 'layout v_accordion' # 'layout stacking' in i3
24+
alt-w = 'layout h_accordion' # 'layout tabbed' in i3
25+
alt-e = 'layout h_list v_list' # 'layout toggle list' in i3
26+
27+
alt-shift-space = 'layout floating tiling' # 'floating toggle' in i3
28+
alt-space = 'focus toggle_tiling_floating'
29+
30+
alt-a = 'focus parent'
31+
32+
alt-1 = 'workspace 1'
33+
alt-2 = 'workspace 2'
34+
alt-3 = 'workspace 3'
35+
alt-4 = 'workspace 4'
36+
alt-5 = 'workspace 5'
37+
alt-6 = 'workspace 6'
38+
alt-7 = 'workspace 7'
39+
alt-8 = 'workspace 8'
40+
alt-9 = 'workspace 9'
41+
alt-0 = 'workspace 10'
42+
43+
alt-shift-1 = 'move container to workspace 1'
44+
alt-shift-2 = 'move container to workspace 2'
45+
alt-shift-3 = 'move container to workspace 3'
46+
alt-shift-4 = 'move container to workspace 4'
47+
alt-shift-5 = 'move container to workspace 5'
48+
alt-shift-6 = 'move container to workspace 6'
49+
alt-shift-7 = 'move container to workspace 7'
50+
alt-shift-8 = 'move container to workspace 8'
51+
alt-shift-9 = 'move container to workspace 9'
52+
alt-shift-0 = 'move container to workspace 10'
53+
54+
alt-shift-c = 'reload_config'
55+
56+
alt-r = 'mode resize'
57+
58+
[mode.resize.binding]
59+
# todo does it work?
60+
h = 'resize shrink width 10'
61+
j = 'resize grow height 10'
62+
k = 'resize shrink height 10'
63+
l = 'resize grow width 10'
64+
enter = 'mode main'
65+
esc = 'mode esc'

project.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ targets:
2222
SWIFT_VERSION: 5.8
2323
CODE_SIGN_STYLE: Automatic
2424
GENERATE_INFOPLIST_FILE: YES
25-
CURRENT_PROJECT_VERSION: 1 # Build number CFBundleVersion
26-
MARKETING_VERSION: 0.0.1 # User visible version CFBundleShortVersionString
25+
CURRENT_PROJECT_VERSION: 1 # Build number CFBundleVersion
26+
MARKETING_VERSION: 0.0.1-Alpha # User visible version CFBundleShortVersionString
2727
SWIFT_OBJC_BRIDGING_HEADER: "src/Bridged-Header.h"
2828
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/20001431-108256
2929
# Specifies whether the app runs as an agent app. If this key is set to YES, Launch Services runs the app as an agent app.

src/config/ConfigModel.swift

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import HotKey
2+
3+
struct ConfigRoot {
4+
let config: Config
5+
let modes: [String: Mode]
6+
}
7+
8+
struct Config {
9+
let afterStartupCommand: Command
10+
let usePaddingForNestedContainersWithTheSameOrientation: Bool
11+
let autoFlattenContainers: Bool
12+
let floatingWindowsOnTop: Bool
13+
}
14+
15+
struct Mode {
16+
/// User visible name. Optional. todo drop it?
17+
let name: String?
18+
let bindings: [HotkeyBinding]
19+
20+
func activate() {
21+
for binding in bindings {
22+
binding.activate()
23+
}
24+
}
25+
26+
func deactivate() {
27+
for binding in bindings {
28+
binding.deactivate()
29+
}
30+
}
31+
}
32+
33+
class HotkeyBinding {
34+
let modifiers: NSEvent.ModifierFlags
35+
let key: Key
36+
let command: Command
37+
private var hotKey: HotKey? = nil
38+
39+
init(_ modifiers: NSEvent.ModifierFlags, _ key: Key, _ command: Command) {
40+
self.modifiers = modifiers
41+
self.key = key
42+
self.command = command
43+
}
44+
45+
func activate() {
46+
hotKey = HotKey(key: key, modifiers: modifiers, keyUpHandler: command.run)
47+
}
48+
49+
func deactivate() {
50+
hotKey = nil
51+
}
52+
}

0 commit comments

Comments
 (0)