content: # AeroSpace still lacks some features that I use in Yabai
  # - BSP - There are no way to replicate it in AeroSpace yet, at least
  #     - https://github.com/nikitabobko/AeroSpace/issues/260
  # - No resizing floating window e.g. Make window float, then make it center if the screen is not possible
  # - Cannot get status of window, so creating complex condition is not possible
  # - Cannot swap window A & B
  
  enable-normalization-flatten-containers = true
  enable-normalization-opposite-orientation-for-nested-containers = true
  
  default-root-container-layout = 'tiles'
  default-root-container-orientation = 'auto'
  
  # Mouse follows focus when focused monitor changes
  on-focus-changed = ['move-mouse window-lazy-center']
  on-focused-monitor-changed = ['move-mouse monitor-lazy-center']
  
  automatically-unhide-macos-hidden-apps = true
  
  accordion-padding = 36
  
  after-startup-command = [
    # JankyBorders has a built-in detection of already running process,
    # so it won't be run twice on AeroSpace restart
    'exec-and-forget borders active_color=0xffe1e3e4 inactive_color=0xff494d64 width=4.0',
  
    # Sketchybar
    "exec-and-forget sketchybar",
  ]
  
  # Notify Sketchybar about workspace change
  exec-on-workspace-change = ['/bin/bash', '-c',
    'sketchybar --trigger aerospace_workspace_change FOCUSED_WORKSPACE=$AEROSPACE_FOCUSED_WORKSPACE'
  ]
  
  [gaps]
  inner.horizontal = 12
  inner.vertical =   12
  outer.left =       12
  outer.bottom =     12
  outer.top =        40 # Sketchybar height
  outer.right =      12
  
  [mode.main.binding]
  # See: https://nikitabobko.github.io/AeroSpace/goodness#open-a-new-window-with-applescript
  # alt-enter = '''exec-and-forget osascript -e '
  # tell application "Terminal"
  #     do script
  #     activate
  # end tell'
  # '''
  
  # Migrated from yabai-skhd
  
  # Close window
  alt-w = 'close'
  
  # Focus window
  alt-h = 'focus --boundaries-action wrap-around-the-workspace left'
  alt-j = 'focus --boundaries-action wrap-around-the-workspace down'
  alt-k = 'focus --boundaries-action wrap-around-the-workspace up'
  alt-l = 'focus --boundaries-action wrap-around-the-workspace right'
  # Focus recently used window
  alt-quote = 'exec-and-forget aerospace focus-back-and-forth || aerospace workspace-back-and-forth'
  
  # Move window
  alt-shift-h = 'move left'
  alt-shift-j = 'move down'
  alt-shift-k = 'move up'
  alt-shift-l = 'move right'
  
  alt-shift-cmd-h = 'join-with left'
  alt-shift-cmd-j = 'join-with down'
  alt-shift-cmd-k = 'join-with up'
  alt-shift-cmd-l = 'join-with right'
  
  # Focus workspace
  alt-u = 'workspace prev'
  alt-p = 'workspace next'
  
  # Move window to workspace
  alt-shift-u = 'move-node-to-workspace --focus-follows-window prev'
  alt-shift-p = 'move-node-to-workspace --focus-follows-window next'
  
  # Focus monitor
  alt-i = 'focus-monitor --wrap-around prev'
  alt-o = 'focus-monitor --wrap-around next'
  
  # Move window to monitor
  alt-shift-i = 'move-node-to-monitor --focus-follows-window prev'
  alt-shift-o = 'move-node-to-monitor --focus-follows-window next'
  
  # i3 Config (Default):
  
  # Consider using 'join-with' command as a 'split' replacement if you want to enable normalizations
  # alt-h = 'split horizontal'
  # alt-v = 'split vertical'
  
  alt-z = 'fullscreen'
  
  alt-s = 'layout tiles accordion' # 'layout stacking' in i3
  # alt-w = 'layout h_accordion' # 'layout tabbed' in i3
  alt-e = 'layout tiles horizontal vertical' # 'layout toggle split' in i3
  
  alt-f = 'layout floating tiling' # 'floating toggle' in i3
  
  # Not supported, because this command is redundant in AeroSpace mental model.
  # See: https://nikitabobko.github.io/AeroSpace/guide#floating-windows
  #alt-space = 'focus toggle_tiling_floating'
  
  # `focus parent`/`focus child` are not yet supported, and it's not clear whether they
  # should be supported at all https://github.com/nikitabobko/AeroSpace/issues/5
  # alt-a = 'focus parent'
  
  alt-1 = 'workspace 1.Main'
  alt-2 = 'workspace 2.Browse'
  alt-3 = 'workspace 3.Code'
  alt-4 = 'workspace 4.Comms'
  alt-5 = 'workspace 5.System'
  alt-6 = 'workspace 6.Other'
  alt-7 = 'workspace 7'
  alt-8 = 'workspace 8'
  alt-9 = 'workspace 9'
  alt-0 = 'workspace 10'
  
  alt-shift-1 = 'move-node-to-workspace 1.Main'
  alt-shift-2 = 'move-node-to-workspace 2.Browse'
  alt-shift-3 = 'move-node-to-workspace 3.Code'
  alt-shift-4 = 'move-node-to-workspace 4.Comms'
  alt-shift-5 = 'move-node-to-workspace 5.System'
  alt-shift-6 = 'move-node-to-workspace 6.Other'
  alt-shift-7 = 'move-node-to-workspace 7'
  alt-shift-8 = 'move-node-to-workspace 8'
  alt-shift-9 = 'move-node-to-workspace 9'
  alt-shift-0 = 'move-node-to-workspace 10'
  
  alt-shift-c = 'reload-config'
  
  alt-shift-r = 'mode resize'
  
  [mode.resize.binding]
  h = 'resize width -50'
  j = 'resize height +50'
  k = 'resize height -50'
  l = 'resize width +50'
  enter = 'mode main'
  esc = 'mode main'
  
  # [key-mapping]
  # preset = "qwerty"
  
  # [key-mapping.key-notation-to-key-code]
  # q = 'q'
  # w = 'w'
  # f = 'f'
  # p = 'p'
  # b = 'b'
  # j = 'j'
  # l = 'l'
  # u = 'u'
  # y = 'y'
  # semicolon = 'semicolon'
  # leftSquareBracket = 'leftSquareBracket'
  # rightSquareBracket = 'rightSquareBracket'
  # backslash = 'backslash'
  
  # a = 'a'
  # r = 'r'
  # s = 's'
  # t = 't'
  # g = 'g'
  # m = 'm'
  # n = 'n'
  # e = 'e'
  # i = 'i'
  # o = 'o'
  # quote = 'quote'
  
  # z = 'z'
  # x = 'x'
  # c = 'c'
  # d = 'd'
  # v = 'v'
  # k = 'k'
  # h = 'h'
  # comma = 'comma'
  # period = 'period'
  # slash = 'slash'
  
  # Window rules
  # https://nikitabobko.github.io/AeroSpace/guide#callbacks
  #
  # To get app-id:
  # - https://nikitabobko.github.io/AeroSpace/goodness#popular-apps-ids
  # - `aerospace list-apps`
  
  # Fix macOS native tabs e.g. Finder, Ghostty
  # Now it must be floating on start, then you can tile it manually
  [[on-window-detected]]
  if.app-id = 'com.mitchellh.ghostty'
  run = ['layout floating']
  check-further-callbacks = true
  
  [[on-window-detected]]
  if.app-id = 'com.apple.finder'
  run = ['layout floating']
  check-further-callbacks = true
  
  [[on-window-detected]]
  if.app-id = 'com.autodesk.fusion360'
  run = ['layout floating']
  
  # Workspace #1 Main
  [[on-window-detected]]
  if.app-id = 'com.philipyoungg.session-setapp'
  run = ['layout floating', 'move-node-to-workspace 1.Main']
  
  [[on-window-detected]]
  if.app-id = 'com.1password.1password'
  run = ['layout floating', 'move-node-to-workspace 1.Main']
  
  [[on-window-detected]]
  if.app-id = 'com.spotify.client'
  run = ['move-node-to-workspace 1.Main']
  
  # Workspace #2 Browse
  [[on-window-detected]]
  if.app-id = 'com.kapeli.dash-setapp'
  run = ['layout floating', 'move-node-to-workspace 2.Browse']
  
  [[on-window-detected]]
  if.app-id = 'company.thebrowser.Browser' # Arc Browser
  run = ['move-node-to-workspace 2.Browse']
  
  [[on-window-detected]]
  if.app-id = 'com.vivaldi.Vivaldi'
  run = ['move-node-to-workspace 2.Browse']
  
  [[on-window-detected]]
  if.app-id = 'com.google.Chrome'
  run = ['move-node-to-workspace 2.Browse']
  
  [[on-window-detected]]
  if.app-id = 'org.mozilla.firefox'
  run = ['move-node-to-workspace 2.Browse']
  
  [[on-window-detected]]
  if.app-id = 'com.apple.Safari'
  run = ['move-node-to-workspace 2.Browse']
  
  # Workspace #3 Code
  [[on-window-detected]]
  if.app-id = 'com.microsoft.VSCode'
  run = ['move-node-to-workspace 3.Code']
  
  [[on-window-detected]]
  if.app-id = 'com.microsoft.VSCodeInsiders'
  run = ['move-node-to-workspace 3.Code']
  
  [[on-window-detected]]
  if.app-id = 'com.todesktop.230313mzl4w4u92' # Cursor
  run = ['move-node-to-workspace 3.Code']
  
  [[on-window-detected]]
  if.app-id = 'net.kovidgoyal.kitty'
  run = ['move-node-to-workspace 3.Code']
  
  [[on-window-detected]]
  if.app-id = 'com.mitchellh.ghostty'
  run = ['move-node-to-workspace 3.Code']
  
  [[on-window-detected]]
  if.app-id = 'com.github.wez.wezterm'
  run = ['move-node-to-workspace 3.Code']
  
  # Workspace #4 Comms
  [[on-window-detected]]
  if.app-id = 'md.obsidian'
  run = ['move-node-to-workspace 4.Comms']
  
  [[on-window-detected]]
  if.app-id = 'com.tinyspeck.slackmacgap'
  run = ['move-node-to-workspace 4.Comms']
  
  [[on-window-detected]]
  if.app-id = 'com.tdesktop.Telegram'
  run = ['move-node-to-workspace 4.Comms']
  
  [[on-window-detected]]
  if.app-id = 'com.cron.electron' # Notion Calendar
  run = ['move-node-to-workspace 4.Comms']
  
  [[on-window-detected]]
  if.app-id = 'com.hnc.Discord'
  run = ['move-node-to-workspace 4.Comms']
  
  # Workspace #5 System
  [[on-window-detected]]
  if.app-id = 'com.apple.systempreferences'
  run = ['layout floating', 'move-node-to-workspace 5.System']
  
  [[on-window-detected]]
  if.app-id = 'com.apple.finder'
  run = ['move-node-to-workspace 5.System']
  
  [[on-window-detected]]
  if.app-id = 'org.pqrs.Karabiner-Elements.Settings'
  run = ['move-node-to-workspace 5.System']
  
  [[on-window-detected]]
  if.app-id = 'com.apple.shortcuts'
  run = ['move-node-to-workspace 5.System']
  
  [[on-window-detected]]
  if.app-id = 'com.stairways.keyboardmaestro.editor'
  run = ['move-node-to-workspace 5.System']
  
  # Workspace #6 Other
  
  [workspace-to-monitor-force-assignment]
  "1.Main" = ["secondary", "main"]
  "2.Browse" = "main"
  "3.Code" = "main"
  "4.Comms" = "main"
  "5.System" = ["secondary", "main"]
  "6.Other" = "main"
  