From e7f4f59986fbba9707b503dc5bc101533510fe35 Mon Sep 17 00:00:00 2001 From: Random936 Date: Fri, 1 Nov 2024 22:43:08 -0700 Subject: [PATCH] Fixed config for aerospace --- dotfiles/.aerospace.toml | 79 ++++++++++++++++++++++++++++++++++ home/modules/aerospace.nix | 87 +------------------------------------- 2 files changed, 80 insertions(+), 86 deletions(-) create mode 100644 dotfiles/.aerospace.toml diff --git a/dotfiles/.aerospace.toml b/dotfiles/.aerospace.toml new file mode 100644 index 0000000..07a7ab1 --- /dev/null +++ b/dotfiles/.aerospace.toml @@ -0,0 +1,79 @@ +# Reference: https://github.com/i3/i3/blob/next/etc/config +# i3 doesn't have "normalizations" feature that why we disable them here. +# But the feature is very helpful. +# Normalizations eliminate all sorts of weird tree configurations that don't make sense. +# Give normalizations a chance and enable them back. +enable-normalization-flatten-containers = false +enable-normalization-opposite-orientation-for-nested-containers = false + +# Mouse follows focus when focused monitor changes +on-focused-monitor-changed = ['move-mouse monitor-lazy-center'] + +[mode.main.binding] +# See: https://nikitabobko.github.io/AeroSpace/goodness#open-a-new-window-with-applescript +cmd-enter = '''exec-and-forget osascript -e 'tell application "iTerm2" to create window with default profile'''' +cmd-shift-e = 'exec-and-forget emacs' +cmd-shift-f = 'exec-and-forget open -n -a "Google Chrome"' +cmd-shift-d = 'exec-and-forget open -n -a "Discord"' + +# i3 wraps focus by default +cmd-h = 'focus --boundaries-action wrap-around-the-workspace left' +cmd-j = 'focus --boundaries-action wrap-around-the-workspace down' +cmd-k = 'focus --boundaries-action wrap-around-the-workspace up' +cmd-l = 'focus --boundaries-action wrap-around-the-workspace right' + +cmd-shift-h = 'move left' +cmd-shift-j = 'move down' +cmd-shift-k = 'move up' +cmd-shift-l = 'move right' + +cmd-f = 'fullscreen' +cmd-s = 'layout v_accordion' # 'layout stacking' in i3 +cmd-w = 'layout h_accordion' # 'layout tabbed' in i3 +cmd-e = 'layout tiles horizontal vertical' # 'layout toggle split' in i3 + +cmd-q = 'close' + +cmd-shift-space = '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 +#cmd-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 +# cmd-a = 'focus parent' + +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-0 = 'workspace 10' + +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-0 = 'move-node-to-workspace 10' + +cmd-shift-c = 'reload-config' + +cmd-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' \ No newline at end of file diff --git a/home/modules/aerospace.nix b/home/modules/aerospace.nix index c1682ed..8d15ac2 100644 --- a/home/modules/aerospace.nix +++ b/home/modules/aerospace.nix @@ -1,88 +1,3 @@ { ... }: { - home.file.".aerospace.toml".text = '' - # Reference: https://github.com/i3/i3/blob/next/etc/config - # i3 doesn't have "normalizations" feature that why we disable them here. - # But the feature is very helpful. - # Normalizations eliminate all sorts of weird tree configurations that don't make sense. - # Give normalizations a chance and enable them back. - enable-normalization-flatten-containers = false - enable-normalization-opposite-orientation-for-nested-containers = false - - # Mouse follows focus when focused monitor changes - on-focused-monitor-changed = ['move-mouse monitor-lazy-center'] - - [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' - ''' - - # i3 wraps focus by default - alt-j = 'focus --boundaries-action wrap-around-the-workspace left' - alt-k = 'focus --boundaries-action wrap-around-the-workspace down' - alt-l = 'focus --boundaries-action wrap-around-the-workspace up' - alt-semicolon = 'focus --boundaries-action wrap-around-the-workspace right' - - alt-shift-j = 'move left' - alt-shift-k = 'move down' - alt-shift-l = 'move up' - alt-shift-semicolon = 'move right' - - # Consider using 'join-with' command as a 'split' replacement if you want to enable normalizations - alt-h = 'split horizontal' - alt-v = 'split vertical' - - alt-f = 'fullscreen' - - alt-s = 'layout v_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-shift-space = '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' - 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-0 = 'workspace 10' - - 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' - alt-shift-0 = 'move-node-to-workspace 10' - - alt-shift-c = 'reload-config' - - alt-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' - ''; + home.file.".aerospace.toml".source = ../../dotfiles/.aerospace.toml; }