zsh,vm-list,karabiner,ghostty
This commit is contained in:
@@ -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
|
||||
|
||||
11
config/macos/bin/vm-switch-daemon
Executable file
11
config/macos/bin/vm-switch-daemon
Executable file
@@ -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
|
||||
|
||||
3
config/macos/bin/vmlist-sync
Executable file
3
config/macos/bin/vmlist-sync
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
orbctl list > /tmp/vmlist.txt
|
||||
|
||||
10
config/macos/bin/work
Executable file
10
config/macos/bin/work
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
# Usage: work <vm>
|
||||
vm="$1"
|
||||
if [ -z "$vm" ]; then
|
||||
echo "Usage: work <vm>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec vm "${vm}-orb"
|
||||
|
||||
@@ -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" }
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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" }]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user