diff options
| -rw-r--r-- | machines/work.nix | 63 | ||||
| -rw-r--r-- | mut/aerospace/aerospace.toml | 162 | ||||
| l--------- | mut/bin/docker | 1 | ||||
| l--------- | mut/bin/docker-compose | 1 | ||||
| l--------- | mut/bin/docker-credential-osxkeychain | 1 | ||||
| l--------- | mut/bin/orb | 1 | ||||
| l--------- | mut/bin/orbctl | 1 | ||||
| -rwxr-xr-x | mut/bin/pnsh-nvim | 3 | ||||
| -rw-r--r-- | mut/ghostty/config | 1 | ||||
| -rw-r--r-- | mut/neovim/lua/my/init.lua | 39 |
10 files changed, 196 insertions, 77 deletions
diff --git a/machines/work.nix b/machines/work.nix index a73c48d..596573f 100644 --- a/machines/work.nix +++ b/machines/work.nix @@ -58,6 +58,7 @@ sessionPath = [ "/opt/homebrew/bin" ]; + file.".config/aerospace".source = config.lib.meta.mkMutableSymlink /mut/aerospace; file."gpg-agent.conf" = { text = '' pinentry-program /opt/homebrew/bin/pinentry-mac @@ -104,68 +105,6 @@ -----END CERTIFICATE----- ''; }; -# cmd - 1 : osascript -e 'tell application "alacritty" to activate' -# cmd - 2 : osascript -e 'tell application "Google Chrome" to activate' -# cmd - 3 : osascript -e 'tell application "slack" to activate' -# cmd - 4 : osascript -e 'tell application "Microsoft Teams (work or school)" to activate' -# cmd - 5 : osascript -e 'tell application "calendar" to activate' -# cmd - 6 : osascript -e 'tell application "mail" to activate' - services.skhd = { - enable = true; - skhdConfig = '' - cmd - d : /opt/X11/bin/xrandr -s 2560x1664 - ''; - }; - services.sketchybar.enable = false; - services.yabai = { - enable = false; - package = pkgs.yabai; - enableScriptingAddition = true; - config = { - focus_follows_mouse = "off"; - mouse_follows_focus = "off"; - window_placement = "first_child"; - window_opacity = "off"; - window_opacity_duration = "0.0"; - window_border = "on"; - window_border_placement = "inset"; - window_border_width = 2; - window_border_radius = 3; - active_window_border_topmost = "off"; - window_topmost = "on"; - window_shadow = "float"; - active_window_border_color = "0xff5c7e81"; - normal_window_border_color = "0xff505050"; - insert_window_border_color = "0xffd75f5f"; - active_window_opacity = "1.0"; - normal_window_opacity = "1.0"; - split_ratio = "0.50"; - split_type = "horizontal"; - auto_balance = "off"; - mouse_modifier = "fn"; - mouse_action1 = "move"; - mouse_action2 = "resize"; - layout = "bsp"; - window_origin_display = "focused"; - display_arrangement_order = "vertical"; - top_padding = 10; - bottom_padding = 10; - left_padding = 10; - right_padding = 10; - window_gap = 10; - }; - - extraConfig = '' - # rules - yabai -m rule --add app='System Settings' manage=off - yabai -m rule --add app='alacritty' title='dap' display='2' - - # Any other arbitrary config here - yabai -m signal --add event=window_destroyed action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus recent || yabai -m window --focus first" - yabai -m signal --add event=application_terminated action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus recent || yabai -m window --focus first" - yabai -m signal --add event=window_created action="yabai -m window --warp east" - ''; - }; # Auto upgrade nix package and the daemon service. services.nix-daemon.enable = true; # nix.package = pkgs.nix; diff --git a/mut/aerospace/aerospace.toml b/mut/aerospace/aerospace.toml new file mode 100644 index 0000000..bb30cbe --- /dev/null +++ b/mut/aerospace/aerospace.toml @@ -0,0 +1,162 @@ +# Place a copy of this config to ~/.aerospace.toml +# After that, you can edit ~/.aerospace.toml to your liking + +# You can use it to add commands that run after login to macOS user session. +# 'start-at-login' needs to be 'true' for 'after-login-command' to work +# Available commands: https://nikitabobko.github.io/AeroSpace/commands +after-login-command = [] + +# You can use it to add commands that run after AeroSpace startup. +# 'after-startup-command' is run after 'after-login-command' +# Available commands : https://nikitabobko.github.io/AeroSpace/commands +after-startup-command = [] + +# Start AeroSpace at login +start-at-login = true + +# Normalizations. See: https://nikitabobko.github.io/AeroSpace/guide#normalization +enable-normalization-flatten-containers = true +enable-normalization-opposite-orientation-for-nested-containers = true + +# See: https://nikitabobko.github.io/AeroSpace/guide#layouts +# The 'accordion-padding' specifies the size of accordion padding +# You can set 0 to disable the padding feature +accordion-padding = 100 + +# Possible values: tiles|accordion +default-root-container-layout = 'accordion' + +# Possible values: horizontal|vertical|auto +# 'auto' means: wide monitor (anything wider than high) gets horizontal orientation, +# tall monitor (anything higher than wide) gets vertical orientation +default-root-container-orientation = 'auto' + +# Mouse follows focus when focused monitor changes +# Drop it from your config, if you don't like this behavior +# See https://nikitabobko.github.io/AeroSpace/guide#on-focus-changed-callbacks +# See https://nikitabobko.github.io/AeroSpace/commands#move-mouse +# Fallback value (if you omit the key): on-focused-monitor-changed = [] +on-focused-monitor-changed = ['move-mouse monitor-lazy-center'] + +# You can effectively turn off macOS "Hide application" (cmd-h) feature by toggling this flag +# Useful if you don't use this macOS feature, but accidentally hit cmd-h or cmd-alt-h key +# Also see: https://nikitabobko.github.io/AeroSpace/goodies#disable-hide-app +automatically-unhide-macos-hidden-apps = false + +# Possible values: (qwerty|dvorak) +# See https://nikitabobko.github.io/AeroSpace/guide#key-mapping +[key-mapping] + preset = 'qwerty' + +# Gaps between windows (inner-*) and between monitor edges (outer-*). +# Possible values: +# - Constant: gaps.outer.top = 8 +# - Per monitor: gaps.outer.top = [{ monitor.main = 16 }, { monitor."some-pattern" = 32 }, 24] +# In this example, 24 is a default value when there is no match. +# Monitor pattern is the same as for 'workspace-to-monitor-force-assignment'. +# See: +# https://nikitabobko.github.io/AeroSpace/guide#assign-workspaces-to-monitors +[gaps] + inner.horizontal = 0 + inner.vertical = 0 + outer.left = 0 + outer.bottom = 0 + outer.top = 0 + outer.right = 0 + +# 'main' binding mode declaration +# See: https://nikitabobko.github.io/AeroSpace/guide#binding-modes +# 'main' binding mode must be always presented +# Fallback value (if you omit the key): mode.main.binding = {} +[mode.main.binding] + + # All possible keys: + # - Letters. a, b, c, ..., z + # - Numbers. 0, 1, 2, ..., 9 + # - Keypad numbers. keypad0, keypad1, keypad2, ..., keypad9 + # - F-keys. f1, f2, ..., f20 + # - Special keys. minus, equal, period, comma, slash, backslash, quote, semicolon, + # backtick, leftSquareBracket, rightSquareBracket, space, enter, esc, + # backspace, tab + # - Keypad special. keypadClear, keypadDecimalMark, keypadDivide, keypadEnter, keypadEqual, + # keypadMinus, keypadMultiply, keypadPlus + # - Arrows. left, down, up, right + + # All possible modifiers: cmd, alt, ctrl, shift + + # All possible commands: https://nikitabobko.github.io/AeroSpace/commands + + # See: https://nikitabobko.github.io/AeroSpace/commands#exec-and-forget + # You can uncomment the following lines to open up terminal with alt + enter shortcut + # (like in i3) + cmd-enter = '''exec-and-forget osascript -e ' + tell application "Ghostty" + activate + end tell' + ''' + + # See: https://nikitabobko.github.io/AeroSpace/commands#layout + cmd-slash = 'layout tiles horizontal vertical' + cmd-comma = 'layout accordion horizontal vertical' + + # See: https://nikitabobko.github.io/AeroSpace/commands#focus + cmd-j = 'focus right' + cmd-k = 'focus left' + + # See: https://nikitabobko.github.io/AeroSpace/commands#move + cmd-shift-j = 'move right' + cmd-shift-k = 'move left' + + # See: https://nikitabobko.github.io/AeroSpace/commands#resize + cmd-minus = 'resize smart -50' + cmd-equal = 'resize smart +50' + + # 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' + + # 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' + + # See: https://nikitabobko.github.io/AeroSpace/commands#workspace-back-and-forth + cmd-semicolon = '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' + + # See: https://nikitabobko.github.io/AeroSpace/commands#mode + cmd-shift-semicolon = 'mode service' + +# 'service' binding mode declaration. +# See: https://nikitabobko.github.io/AeroSpace/guide#binding-modes +[mode.service.binding] + esc = ['reload-config', 'mode main'] + 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'] + + # sticky is not yet supported https://github.com/nikitabobko/AeroSpace/issues/2 + #s = ['layout sticky tiling', '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'] + + down = 'volume down' + up = 'volume up' + shift-down = ['volume set 0', 'mode main'] diff --git a/mut/bin/docker b/mut/bin/docker deleted file mode 120000 index 6ac42b5..0000000 --- a/mut/bin/docker +++ /dev/null @@ -1 +0,0 @@ -/Applications/OrbStack.app/Contents/MacOS/xbin/docker
\ No newline at end of file diff --git a/mut/bin/docker-compose b/mut/bin/docker-compose deleted file mode 120000 index 2a32a59..0000000 --- a/mut/bin/docker-compose +++ /dev/null @@ -1 +0,0 @@ -/Applications/OrbStack.app/Contents/MacOS/xbin/docker-compose
\ No newline at end of file diff --git a/mut/bin/docker-credential-osxkeychain b/mut/bin/docker-credential-osxkeychain deleted file mode 120000 index c7e32a6..0000000 --- a/mut/bin/docker-credential-osxkeychain +++ /dev/null @@ -1 +0,0 @@ -/Applications/OrbStack.app/Contents/MacOS/xbin/docker-credential-osxkeychain
\ No newline at end of file diff --git a/mut/bin/orb b/mut/bin/orb deleted file mode 120000 index f5fd04a..0000000 --- a/mut/bin/orb +++ /dev/null @@ -1 +0,0 @@ -/Applications/OrbStack.app/Contents/MacOS/bin/orb
\ No newline at end of file diff --git a/mut/bin/orbctl b/mut/bin/orbctl deleted file mode 120000 index ab07a02..0000000 --- a/mut/bin/orbctl +++ /dev/null @@ -1 +0,0 @@ -/Applications/OrbStack.app/Contents/MacOS/bin/orbctl
\ No newline at end of file diff --git a/mut/bin/pnsh-nvim b/mut/bin/pnsh-nvim index 0afc4c2..bc417c0 100755 --- a/mut/bin/pnsh-nvim +++ b/mut/bin/pnsh-nvim @@ -8,7 +8,6 @@ if not ($desktop_open_pipe | path exists) { let args = ( "--init" + " --entrypoint=/usr/bin/nu" + -" --network=host" + " --env=TERM=xterm-ghostty" + $" --env=TERMINFO=($env.TERMINFO)" + " --env=_ZO_DATA_DIR=/hostfs/.local/share/zoxide" + @@ -27,7 +26,7 @@ $" --workdir=($env | default $env.HOME PWD | get PWD)" + " --volume=/nix/store:/nix/store" + " --volume=/nix-config:/nix-config" + $" --volume=($env.HOME)/.ssh/config:/root/.ssh/config" + -$" --volume=($env.XDG_RUNTIME_DIR)/docker.sock:/var/run/docker.sock" +$" --volume=($env | default "/var/run" XDG_RUNTIME_DIR | get XDG_RUNTIME_DIR)/docker.sock:/var/run/docker.sock" ) ( diff --git a/mut/ghostty/config b/mut/ghostty/config index 656cc20..44a7aed 100644 --- a/mut/ghostty/config +++ b/mut/ghostty/config @@ -12,3 +12,4 @@ keybind = ctrl+enter=unbind theme=GruvboxLuke window-decoration=false confirm-close-surface=false +macos-option-as-alt=true diff --git a/mut/neovim/lua/my/init.lua b/mut/neovim/lua/my/init.lua index b72ad31..5703ed4 100644 --- a/mut/neovim/lua/my/init.lua +++ b/mut/neovim/lua/my/init.lua @@ -425,15 +425,38 @@ end function xclip(lines) vim.system({ "nu", "--commands", "xclip -f -sel c | xclip"}, {stdin=lines, text=true}, nil) end -vim.g.clipboard = { - name = "OSC 52", - copy = { - ["+"] = xclip, ["*"] = xclip - }, - paste = { - ["+"] = paste, ["*"] = paste +function pbcopy(lines) + vim.system({ "nu", "--commands", "pbcopy"}, {stdin=lines, text=true}, nil) +end + +-- Unix, Linux variants +local fh, err = assert(io.popen("which xclip 2>/dev/null", "r")) +if fh:read() then + vim.g.clipboard = { + name = "Xclip Clipboard", + copy = { + ["+"] = xclip, ["*"] = xclip + }, + paste = { + ["+"] = paste, ["*"] = paste + } } -} +else + local fh, err = assert(io.popen("which pbcopy 2>/dev/null", "r")) + if fh:read() then + vim.g.clipboard = { + name = 'pbcopy Clipboard', + copy = { + ['+'] = pbcopy, + ['*'] = pbcopy, + }, + paste = { + ['+'] = paste, + ['*'] = paste, + }, + } + end +end require("my.events") require("my.packages") |
