Fix HUD launcher host handling

This commit is contained in:
2026-04-03 18:46:16 +02:00
parent 7279d1272e
commit 7d9d6c7b4f
4 changed files with 23 additions and 43 deletions

View File

@@ -53,18 +53,6 @@ is_macos() {
[ "$(uname -s)" = "Darwin" ]
}
current_host_name() {
if is_macos && command_exists scutil; then
scutil --get LocalHostName 2>/dev/null && return
fi
hostname -s 2>/dev/null || hostname
}
is_studio_host() {
[ "$(current_host_name)" = "studio" ]
}
error() {
echo ${RED}"Error: $@"${RESET} >&2
}
@@ -101,7 +89,7 @@ apply_dotfiles() {
link_dotfile "$DOTFILES_DIR/.gitconfig" "$HOME/.gitconfig"
link_dotfile "$DOTFILES_DIR/.p10k.zsh" "$HOME/.p10k.zsh"
mkdir -p "$HOME/.config"
install_kitty_config
link_dotfile "$DOTFILES_DIR/kitty" "$HOME/.config/kitty"
link_dotfile "$DOTFILES_DIR/nvim" "$HOME/.config/nvim"
link_dotfile "$DOTFILES_DIR/tmux" "$HOME/.config/tmux"
if is_macos; then
@@ -182,32 +170,6 @@ link_dotfile() {
echo "${GREEN}Linked $target_path -> $source_path${RESET}"
}
ensure_directory() {
target_path=$1
if [ -L "$target_path" ] || [ -f "$target_path" ]; then
echo "${YELLOW}Removing existing $target_path${RESET}"
rm -rf "$target_path"
fi
mkdir -p "$target_path"
}
install_kitty_config() {
kitty_config_dir="$HOME/.config/kitty"
ensure_directory "$kitty_config_dir"
link_dotfile "$DOTFILES_DIR/kitty/kitty.conf" "$kitty_config_dir/kitty.conf"
link_dotfile "$DOTFILES_DIR/kitty/macos-launch-services-cmdline" "$kitty_config_dir/macos-launch-services-cmdline"
if is_studio_host; then
link_dotfile "$DOTFILES_DIR/hosts/studio/kitty/quick-access-terminal.conf" "$kitty_config_dir/quick-access-terminal.conf"
elif [ -L "$kitty_config_dir/quick-access-terminal.conf" ] || [ -e "$kitty_config_dir/quick-access-terminal.conf" ]; then
echo "${YELLOW}Removing existing $kitty_config_dir/quick-access-terminal.conf${RESET}"
rm -rf "$kitty_config_dir/quick-access-terminal.conf"
fi
}
install_karabiner_config() {
mkdir -p "$HOME/.config/karabiner"
link_dotfile "$DOTFILES_DIR/karabiner/karabiner.json" "$HOME/.config/karabiner/karabiner.json"