Fix HUD launcher host handling
This commit is contained in:
40
install.sh
40
install.sh
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user