dotfiles/setup.sh

53 lines
1.2 KiB
Bash
Raw Permalink Normal View History

2022-04-14 21:07:10 +02:00
#!/usr/bin/env bash
2023-10-30 14:49:11 +01:00
#
cd $(dirname $0)
DOTS_DIR=$(pwd)
2023-10-30 14:49:11 +01:00
function link_config {
NAME="$1"
TARGET="$2"
FROM="$DOTS_DIR/$3"
if [ -d "$TARGET" ]; then
echo "[$NAME] Configuration directory exists. Skipping."
else
ln -s "$FROM" "$TARGET"
fi
}
link_config "Dunst" "$HOME/.config/dunst" "dunst"
link_config "Kitty" "$HOME/.config/kitty" "kitty"
link_config "Eww" "$HOME/.config/eww" "eww"
# Neovim
NVIM_DIR="$HOME/.config/nvim"
# Check if the NVIM directory exists. If it does we skip this part of the script and inform the user.
if [ -d $NVIM_DIR ]; then
echo "[NVIM] Configuration directory exists. Skipping."
else
# Symlink the config.
ln -s $DOTS_DIR/nvim $NVIM_DIR
2022-08-20 16:36:33 +02:00
# Bootstrap the plugins
nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
fi
2022-02-06 19:45:28 +01:00
# Scripts
SCRIPT_DIR="$HOME/bin/scripts"
# Check if the scripts directory exists. If it does we skip this part of the script and inform the user.
if [ -d $SCRIPT_DIR ]; then
echo "[SCRIPTS] Configuration directory exists. Skipping."
else
mkdir "$HOME/bin"
ln -s $DOTS_DIR/scripts $SCRIPT_DIR
fi
2022-04-14 21:26:15 +02:00
# Templates
TEMPLATE_DIR="$HOME/Templates"
rmdir "$TEMPLATE_DIR"
ln -s "$DOTS_DIR/Templates" "$TEMPLATE_DIR"
2023-10-30 14:49:11 +01:00