From b1a456645256068afa7ee15f88c89548e2998a1d Mon Sep 17 00:00:00 2001 From: Tomas Mirchev Date: Fri, 26 Sep 2025 05:57:27 +0200 Subject: [PATCH] zsh,vm-list,karabiner,ghostty --- config/macos/bin/vm | 14 +++- config/macos/bin/vm-switch-daemon | 11 +++ config/macos/bin/vmlist-sync | 3 + config/macos/bin/work | 10 +++ .../automatic_backups/karabiner_20250926.json | 44 ++++++++++++ config/macos/karabiner/karabiner.json | 8 +++ config/shared/ghostty/config | 69 +++++++++---------- config/shared/zsh_config/keybindings | 5 +- config/shared/zsh_root | 2 + 9 files changed, 122 insertions(+), 44 deletions(-) create mode 100755 config/macos/bin/vm-switch-daemon create mode 100755 config/macos/bin/vmlist-sync create mode 100755 config/macos/bin/work create mode 100644 config/macos/karabiner/automatic_backups/karabiner_20250926.json diff --git a/config/macos/bin/vm b/config/macos/bin/vm index 442061c..4cd42a5 100755 --- a/config/macos/bin/vm +++ b/config/macos/bin/vm @@ -13,7 +13,8 @@ # Optional: # --no-tmux -> skips attaching to tmux session -skip_tmux=0 +# TMP: Tmux will be disabled (switch to 0 to enable it again) +skip_tmux=1 # Check for --no-tmux flag if [[ "$1" == "--no-tmux" ]]; then @@ -22,6 +23,8 @@ if [[ "$1" == "--no-tmux" ]]; then fi full="$1" +shift # remove host from args + user="$USER" host="$full" @@ -54,7 +57,7 @@ case "$host" in esac # Build SSH command safely using an array -ssh_cmd=(ssh -t) +ssh_cmd=(ssh -tt) # Include identity file if needed [[ -n "$ssh_identity" ]] && ssh_cmd+=(-i "$ssh_identity" -o IdentitiesOnly=yes) @@ -63,7 +66,12 @@ ssh_cmd=(ssh -t) ssh_cmd+=("$user@$ssh_host") # Add tmux session unless skipped -[[ $skip_tmux -eq 0 ]] && ssh_cmd+=("tmux" "new" "-A" "-s" "$tmux_session") +if [[ $skip_tmux -eq 0 ]]; then + ssh_cmd+=("tmux" "new" "-A" "-s" "$tmux_session") +else + # Pass through any extra args user supplied + ssh_cmd+=("$@") +fi # Replace current shell with SSH command # echo "Executing: ${ssh_cmd[*]}" >&2 diff --git a/config/macos/bin/vm-switch-daemon b/config/macos/bin/vm-switch-daemon new file mode 100755 index 0000000..df6a6d4 --- /dev/null +++ b/config/macos/bin/vm-switch-daemon @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +file=/tmp/vm-switch.txt + +# Ensure the file exists +touch "$file" + +echo "Listening on $file ..." +tail -n0 -F "$file" | while read vm; do + [ -n "$vm" ] && echo "Switch requested: $vm" && ~/bin/work "$vm" & +done + diff --git a/config/macos/bin/vmlist-sync b/config/macos/bin/vmlist-sync new file mode 100755 index 0000000..8557cff --- /dev/null +++ b/config/macos/bin/vmlist-sync @@ -0,0 +1,3 @@ +#!/bin/sh +orbctl list > /tmp/vmlist.txt + diff --git a/config/macos/bin/work b/config/macos/bin/work new file mode 100755 index 0000000..f104f06 --- /dev/null +++ b/config/macos/bin/work @@ -0,0 +1,10 @@ +#!/bin/sh +# Usage: work +vm="$1" +if [ -z "$vm" ]; then + echo "Usage: work " + exit 1 +fi + +exec vm "${vm}-orb" + diff --git a/config/macos/karabiner/automatic_backups/karabiner_20250926.json b/config/macos/karabiner/automatic_backups/karabiner_20250926.json new file mode 100644 index 0000000..52bcba2 --- /dev/null +++ b/config/macos/karabiner/automatic_backups/karabiner_20250926.json @@ -0,0 +1,44 @@ +{ + "global": { "show_in_menu_bar": false }, + "profiles": [ + { + "devices": [ + { + "identifiers": { "is_keyboard": true }, + "simple_modifications": [ + { + "from": { "key_code": "non_us_backslash" }, + "to": [{ "key_code": "grave_accent_and_tilde" }] + } + ] + }, + { + "identifiers": { + "is_keyboard": true, + "product_id": 49164, + "vendor_id": 7276 + }, + "simple_modifications": [ + { + "from": { "key_code": "left_command" }, + "to": [{ "key_code": "left_option" }] + }, + { + "from": { "key_code": "left_option" }, + "to": [{ "key_code": "left_command" }] + } + ] + } + ], + "name": "Default profile", + "selected": true, + "simple_modifications": [ + { + "from": { "key_code": "caps_lock" }, + "to": [{ "key_code": "left_control" }] + } + ], + "virtual_hid_keyboard": { "keyboard_type_v2": "ansi" } + } + ] +} \ No newline at end of file diff --git a/config/macos/karabiner/karabiner.json b/config/macos/karabiner/karabiner.json index 52bcba2..9490271 100644 --- a/config/macos/karabiner/karabiner.json +++ b/config/macos/karabiner/karabiner.json @@ -26,6 +26,14 @@ { "from": { "key_code": "left_option" }, "to": [{ "key_code": "left_command" }] + }, + { + "from": { "key_code": "escape" }, + "to": [{ "key_code": "grave_accent_and_tilde" }] + }, + { + "from": { "key_code": "grave_accent_and_tilde" }, + "to": [{ "key_code": "escape" }] } ] } diff --git a/config/shared/ghostty/config b/config/shared/ghostty/config index 93c839a..9dc9b91 100644 --- a/config/shared/ghostty/config +++ b/config/shared/ghostty/config @@ -1,49 +1,42 @@ -theme = catppuccin-latte - # Terminal -term = "xterm-256color" +term = xterm-256color # Fonts -font-family = "JetBrains Mono NL" -font-size = 14 +font-family = "Maple Mono NF" +#font-size = 14 font-thicken = true - -# Cell width (affects letter spacing) -# adjust-cell-width = -1 -# adjust-cell-height = -1 -# adjust-font-baseline = -1 - -# Cursor -cursor-style-blink = false -cursor-style = block -shell-integration-features = no-cursor - -# Icon -# macos-icon = custom-style -# macos-icon-frame = plastic -# macos-icon-ghost-color = cba6f7 -# macos-icon-screen-color = 181825 +#font-thicken-strength = 2 +adjust-box-thickness = 2 # Window -#background = #181818 -#background = #000000 -#window-theme = dark -window-width = 100 -window-height = 26 -window-padding-x = 4 -window-padding-y = 2 -# window-colorspace = display-p3 -# macos-titlebar-style = native -#macos-titlebar-style = transparent +window-padding-x = 0 +window-padding-y = 0 +window-height = 50 +window-width = 120 +window-step-resize = true +window-padding-balance = false +# window-padding-color = extend +# Icon +macos-icon = custom -# Resize by row -#window-step-resize = true -#window-padding-balance = true - -# Background -# background-opacity = 1 -# background-blur-radius = 0 +# Cursor +cursor-style = block +cursor-style-blink = false +mouse-hide-while-typing = true +shell-integration-features = no-cursor +# Font/Cell quality +window-colorspace = srgb +alpha-blending = linear-corrected +macos-titlebar-style = native +adjust-cell-width = -1 +#adjust-cell-height = -2 +# Theme +background = #eeeeee +foreground = #434343 +window-theme = auto +background-opacity = 1 +background-blur = false diff --git a/config/shared/zsh_config/keybindings b/config/shared/zsh_config/keybindings index b6a70ca..031c623 100644 --- a/config/shared/zsh_config/keybindings +++ b/config/shared/zsh_config/keybindings @@ -6,11 +6,10 @@ autoload -U down-line-or-beginning-search zle -N up-line-or-beginning-search zle -N down-line-or-beginning-search -# ----------------------------- -# Bind keys for history search -# ----------------------------- bindkey '^[[A' up-line-or-beginning-search bindkey '^[OA' up-line-or-beginning-search bindkey '^[[B' down-line-or-beginning-search bindkey '^[OB' down-line-or-beginning-search +bindkey '^U' backward-kill-line + diff --git a/config/shared/zsh_root b/config/shared/zsh_root index 1e13a5f..ad1a99e 100644 --- a/config/shared/zsh_root +++ b/config/shared/zsh_root @@ -1,3 +1,5 @@ +export EDITOR="nvim" +export VISUAL="nvim" if [ -f "$HOME/.config/zsh/zshrc" ]; then source "$HOME/.config/zsh/zshrc" else