forked from Hithomelabs/dotfiles
47 lines
1.7 KiB
Bash
Executable File
47 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Symlink installer for dotfiles.
|
|
#
|
|
# Usage: ./install.sh [--force]
|
|
# --force overwrite any existing files/symlinks at the target paths
|
|
#
|
|
# The repo layout mirrors the target ~/.config layout, so each file here is
|
|
# symlinked to where the app actually reads it.
|
|
set -euo pipefail
|
|
|
|
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
FORCE=0
|
|
if [[ "${1:-}" == "--force" ]]; then FORCE=1; fi
|
|
|
|
link() {
|
|
local src="$1" dst="$2"
|
|
if [ -e "$dst" ] || [ -L "$dst" ]; then
|
|
if [ "$FORCE" -eq 1 ]; then
|
|
rm -rf "$dst"
|
|
else
|
|
echo "skip (target exists): $dst"
|
|
return
|
|
fi
|
|
fi
|
|
mkdir -p "$(dirname "$dst")"
|
|
ln -s "$src" "$dst"
|
|
echo "link: $dst -> $src"
|
|
}
|
|
|
|
link "$REPO_DIR/zsh/.zshrc" "$HOME/.zshrc"
|
|
link "$REPO_DIR/i3/config" "$HOME/.config/i3/config"
|
|
link "$REPO_DIR/i3/lock.sh" "$HOME/.config/i3/lock.sh"
|
|
link "$REPO_DIR/starship/starship.toml" "$HOME/.config/starship.toml"
|
|
link "$REPO_DIR/rofi/catppuccin-mocha.rasi" "$HOME/.config/rofi/themes/catppuccin-mocha.rasi"
|
|
link "$REPO_DIR/gtk/gtk-3.0/bookmarks" "$HOME/.config/gtk-3.0/bookmarks"
|
|
link "$REPO_DIR/gtk/gtk-3.0/servers" "$HOME/.config/gtk-3.0/servers"
|
|
link "$REPO_DIR/gtk/gtk-3.0/settings.ini" "$HOME/.config/gtk-3.0/settings.ini"
|
|
link "$REPO_DIR/gtk/gtk-4.0/servers" "$HOME/.config/gtk-4.0/servers"
|
|
link "$REPO_DIR/gtk/gtk-4.0/settings.ini" "$HOME/.config/gtk-4.0/settings.ini"
|
|
link "$REPO_DIR/themes/Dracula" "$HOME/.themes/Dracula"
|
|
link "$REPO_DIR/themes/gnome-terminal" "$HOME/.themes/gnome-terminal"
|
|
|
|
echo
|
|
echo "Done."
|
|
echo "gnome-terminal profiles are stored in dconf:"
|
|
echo " dconf load /org/gnome/terminal/legacy/profiles:/ < $REPO_DIR/gnome-terminal/profiles.dconf"
|