Skip to content

Commit

Permalink
feat(nix): tune aerospace bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
sbulav committed Aug 14, 2024
1 parent 075d2ab commit f20dd47
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 79 deletions.
193 changes: 117 additions & 76 deletions nix/modules/darwin/desktop/aerospace/aerospace.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,80 +80,73 @@ outer.right = 6

# All possible commands: https://nikitabobko.github.io/AeroSpace/commands

# You can uncomment this line to open up terminal with cmd + enter shortcut
# You can uncomment this line to open up terminal with alt + enter shortcut
# See: https://nikitabobko.github.io/AeroSpace/commands#exec-and-forget
# cmd-enter = 'exec-and-forget open -n /System/Applications/Utilities/Terminal.app'
# alt-enter = 'exec-and-forget open -n /System/Applications/Utilities/Terminal.app'

# See: https://nikitabobko.github.io/AeroSpace/commands#layout
cmd-b = 'exec-and-forget open -n /Applications/Firefox.app'
cmd-slash = 'layout tiles horizontal vertical'
cmd-comma = 'layout accordion horizontal vertical'
alt-b = 'exec-and-forget open -n /Applications/Firefox.app'
alt-x = 'exec-and-forget open -n /etc/profiles/per-user/sab/bin/wezterm-gui'
alt-slash = 'layout tiles horizontal vertical'
alt-comma = 'layout accordion horizontal vertical'

# See: https://nikitabobko.github.io/AeroSpace/commands#focus-monitor
ctrl-alt-left = 'focus-monitor left'
ctrl-alt-right = 'focus-monitor right'

# See: https://nikitabobko.github.io/AeroSpace/commands#focus
cmd-h = 'focus left'
cmd-j = 'focus down'
cmd-k = 'focus up'
cmd-l = 'focus right'
alt-h = 'focus left'
alt-j = 'focus down'
alt-k = 'focus up'
alt-l = 'focus right'


# See: https://nikitabobko.github.io/AeroSpace/commands#move
cmd-shift-h = 'move left'
cmd-shift-j = 'move down'
cmd-shift-k = 'move up'
cmd-shift-l = 'move right'
alt-shift-h = 'move left'
alt-shift-j = 'move down'
alt-shift-k = 'move up'
alt-shift-l = 'move right'


# See: https://nikitabobko.github.io/AeroSpace/commands#workspace
cmd-1 = 'workspace 1'
cmd-2 = 'workspace 2'
cmd-3 = 'workspace 3'
cmd-4 = 'workspace 4'
cmd-5 = 'workspace 5'
cmd-6 = 'workspace 6'
cmd-7 = 'workspace 7'
cmd-8 = 'workspace 8'
cmd-9 = 'workspace 9'
cmd-b = 'workspace B'
cmd-e = 'workspace E'
cmd-m = 'workspace M'
cmd-n = 'workspace N'
cmd-p = 'workspace P'
cmd-t = 'workspace T'
cmd-v = 'workspace V'
cmd-left = 'workspace --wrap-around prev'
cmd-right = 'workspace --wrap-around next'
cmd-up = 'workspace B'
cmd-down = 'workspace T'
alt-1 = 'workspace 1'
alt-2 = 'workspace 2'
alt-3 = 'workspace 3'
alt-4 = 'workspace 4'
alt-5 = 'workspace 5'
alt-6 = 'workspace 6'
alt-7 = 'workspace 7'
alt-8 = 'workspace 8'
alt-9 = 'workspace 9'
alt-left = 'workspace --wrap-around prev'
alt-right = 'workspace --wrap-around next'
alt-up = 'workspace 2'
alt-down = ['workspace 1']

# See: https://nikitabobko.github.io/AeroSpace/commands#move-node-to-workspace
cmd-shift-1 = 'move-node-to-workspace 1'
cmd-shift-2 = 'move-node-to-workspace 2'
cmd-shift-3 = 'move-node-to-workspace 3'
cmd-shift-4 = 'move-node-to-workspace 4'
cmd-shift-5 = 'move-node-to-workspace 5'
cmd-shift-6 = 'move-node-to-workspace 6'
cmd-shift-7 = 'move-node-to-workspace 7'
cmd-shift-8 = 'move-node-to-workspace 8'
cmd-shift-9 = 'move-node-to-workspace 9'
cmd-shift-b = 'move-node-to-workspace B'
cmd-shift-e = 'move-node-to-workspace E'
cmd-shift-m = 'move-node-to-workspace M'
cmd-shift-n = 'move-node-to-workspace N'
cmd-shift-p = 'move-node-to-workspace P'
cmd-shift-t = 'move-node-to-workspace T'
cmd-shift-v = 'move-node-to-workspace V'

cmd-shift-f = 'fullscreen'
alt-shift-1 = 'move-node-to-workspace 1'
alt-shift-2 = 'move-node-to-workspace 2'
alt-shift-3 = 'move-node-to-workspace 3'
alt-shift-4 = 'move-node-to-workspace 4'
alt-shift-5 = 'move-node-to-workspace 5'
alt-shift-6 = 'move-node-to-workspace 6'
alt-shift-7 = 'move-node-to-workspace 7'
alt-shift-8 = 'move-node-to-workspace 8'
alt-shift-9 = 'move-node-to-workspace 9'


ctrl-shift-f = 'fullscreen'
alt-shift-f = 'macos-native-fullscreen on'

# See: https://nikitabobko.github.io/AeroSpace/commands#workspace-back-and-forth
cmd-tab = 'workspace-back-and-forth'
alt-tab = 'workspace-back-and-forth'
# See: https://nikitabobko.github.io/AeroSpace/commands#move-workspace-to-monitor
cmd-shift-tab = 'move-workspace-to-monitor --wrap-around next'
alt-shift-tab = 'move-workspace-to-monitor --wrap-around next'

# See: https://nikitabobko.github.io/AeroSpace/commands#mode
cmd-shift-semicolon = 'mode service'
alt-shift-s = 'mode service'

cmd-shift-r = 'mode resize'
alt-shift-r = 'mode resize'

[mode.resize.binding]
h = 'resize width -50'
Expand All @@ -162,7 +155,6 @@ k = 'resize height -50'
l = 'resize width +50'
b = 'balance-sizes'


# See: https://nikitabobko.github.io/AeroSpace/commands#resize
minus = 'resize smart -50'
equal = 'resize smart +50'
Expand All @@ -179,46 +171,95 @@ r = ['flatten-workspace-tree', 'mode main'] # reset layout
f = ['layout floating tiling', 'mode main'] # Toggle between floating and tiling layout
backspace = ['close-all-windows-but-current', 'mode main']

cmd-shift-h = ['join-with left', 'mode main']
cmd-shift-j = ['join-with down', 'mode main']
cmd-shift-k = ['join-with up', 'mode main']
cmd-shift-l = ['join-with right', 'mode main']
alt-shift-h = ['join-with left', 'mode main']
alt-shift-j = ['join-with down', 'mode main']
alt-shift-k = ['join-with up', 'mode main']
alt-shift-l = ['join-with right', 'mode main']

[workspace-to-monitor-force-assignment]
1 = 'main'
2 = 'main'
5 = 'main'
6 = 'main'
7 = 'main'
8 = 'secondary'
9 = 'secondary'

[[on-window-detected]]
if.app-id = 'com.github.wez.wezterm'
run = "move-node-to-workspace T"
run = "move-node-to-workspace 1"

[[on-window-detected]]
if.app-id = 'org.mozilla.firefox'
run = "move-node-to-workspace B"
run = "move-node-to-workspace 2"

[[on-window-detected]]
if.app-id = 'org.mozilla.firefox'
run = "move-node-to-workspace B"
if.app-id = 'org.videolan.vlc'
run = "move-node-to-workspace 4"

[[on-window-detected]]
if.app-id = 'com.apple.mail'
run = "move-node-to-workspace M"
run = "move-node-to-workspace 8"

[[on-window-detected]]
if.app-id = 'com.cisco.anyconnect.gui'
run = ['layout floating', 'move-node-to-workspace 8']

[[on-window-detected]]
if.app-id = 'com.tinyspeck.slackmacgap'
run = "move-node-to-workspace 3"
run = "move-node-to-workspace 9"

[[on-window-detected]]
if.app-id = 'com.tdesktop.Telegram'
if.app-id = 'com.apple.Music'
if.app-id = 'com.apple.Music'
run = "move-node-to-workspace 9"

run = "move-node-to-workspace 4"
[[on-window-detected]]
if.app-id = 'us.zoom.xos'
run = "move-node-to-workspace 9"

[[on-window-detected]]
if.app-id = 'org.videolan.vlc'
run = "move-node-to-workspace 5"
if.app-id = 'com.apple.systempreferences'
run = ['layout floating', 'move-node-to-workspace 6']

[[on-window-detected]]
if.app-id = 'com.apple.finder'
if.app-id = 'com.apple.iWork.Keynote'
if.app-id = 'com.apple.keychainaccess'
if.app-id = 'com.apple.systempreferences'
if.app-id = 'com.apple.Preview'
run = ['layout floating', 'move-node-to-workspace 1'] # The callback itself
run = ['layout floating', 'move-node-to-workspace 6']

# Colemak-dh
[key-mapping.key-notation-to-key-code]
q = 'q'
w = 'w'
f = 'e'
p = 'r'
b = 't'
j = 'y'
l = 'u'
u = 'i'
y = 'o'
semicolon = 'p'
leftSquareBracket = 'leftSquareBracket'
rightSquareBracket = 'rightSquareBracket'
backslash = 'backslash'

a = 'a'
r = 's'
s = 'd'
t = 'f'
g = 'g'
m = 'h'
n = 'j'
e = 'k'
i = 'l'
o = 'semicolon'
quote = 'quote'

z = 'z'
x = 'x'
c = 'c'
d = 'v'
v = 'b'
k = 'n'
h = 'm'
comma = 'comma'
period = 'period'
slash = 'slash'
6 changes: 3 additions & 3 deletions nix/modules/darwin/system/input/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ in {
# trackpad settings
trackpad = {
# silent clicking = 0, default = 1
ActuationStrength = 0;
ActuationStrength = 1;
# enable tap to click
Clicking = true;
# firmness level, 0 = lightest, 2 = heaviest
Expand All @@ -44,8 +44,8 @@ in {
AppleKeyboardUIMode = 3;
ApplePressAndHoldEnabled = false;

KeyRepeat = 1;
InitialKeyRepeat = 10;
# KeyRepeat = 1;
# InitialKeyRepeat = 10;
"com.apple.keyboard.fnState" = true;

NSAutomaticCapitalizationEnabled = false;
Expand Down

0 comments on commit f20dd47

Please sign in to comment.