Add a script to automatically create symlinks
This commit is contained in:
parent
8fa1f6fb12
commit
93b3891051
1 changed files with 27 additions and 0 deletions
27
symlinks.sh
Executable file
27
symlinks.sh
Executable file
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Auto-detect the directory where the script is located
|
||||||
|
DOTFILES_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
|
||||||
|
declare -A DIRS
|
||||||
|
DIRS["alacritty"]="$HOME/.config/alacritty"
|
||||||
|
DIRS["doom"]="$HOME/.config/doom"
|
||||||
|
DIRS["i3"]="$HOME/.config/i3"
|
||||||
|
DIRS["polybar"]="$HOME/.config/polybar"
|
||||||
|
DIRS["qtile"]="$HOME/.config/qtile"
|
||||||
|
DIRS["xmobar"]="$HOME/.config/xmobar"
|
||||||
|
DIRS["xmonad"]="$HOME/.config/xmonad"
|
||||||
|
|
||||||
|
for DIR in "${!DIRS[@]}"; do
|
||||||
|
TARGET="${DIRS[$DIR]}"
|
||||||
|
|
||||||
|
if [ -e "$TARGET" ]; then
|
||||||
|
rm -rf "$TARGET"
|
||||||
|
fi
|
||||||
|
|
||||||
|
ln -sf "$DOTFILES_DIR/$DIR" "$TARGET"
|
||||||
|
echo "Symlinked $DOTFILES_DIR/$DIR to $TARGET"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "All directories have been symlinked!"
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue