My misc dotfiles (will likely dramatically change at random times, so the git history will likely be unclean, nonexistent, or otherwise bad practices). This is mostly for backup and in case anyone's curious
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.8 KiB

# simple script to create symlinks from many of my dotfiles
# by x1phosura
dotfiles_root="$HOME"/73h4x/dotfiles/x1yoga-manjaro # where dotfiles live
#dotfiles_root="$PWD" # alternative (for testing)
dest="$HOME" # destination (usually $HOME)
if [ ! -d "$dotfiles_root" ]; then
echo "ERROR: $dotfiles_root doesn't exist. Aborting..."
exit 1
if [[ "$(realpath $dotfiles_root)" = "$(realpath $dest)" ]] ; then
echo " ERROR: dotfiles_root and dest are the same directory! Aborting..."
exit 1
dotfile_home_list=".bashrc \
.bashrc_secrets \
.bash_prompt \
.bash_profile \
.gdbinit \
.tmux.conf \
.vimrc \
.xinitrc \
config_dir_list="alacritty \
cava \
i3 \
nano \
neofetch \
nvim \
picom \
polybar \
ranger \
radare2 \
redshift \
systemd \
rofi \
# link dotfiles in home directory
for file in $dotfile_home_list ; do
# TODO: only link after checking file's existence in dotfiles_root
ln -svfn "$dotfiles_root"/"$file" "$dest"/"$file"
# link dotfiles in .config
# Note: I directly symlink items to .config instead of symlinking .config itself
# because I don't want to preserve everything that programs create there
mkdir -p "$dest"/.config
for file in $config_dir_list; do
# TODO: only link after checking file's existence in config_dir_list
ln -svfn "$dotfiles_root"/.config/"$file" "$dest"/.config/"$file"
# link personal /bin directory (ex. contains scripts, java, etc...)
ln -svfn "$dotfiles_root"/bin "$dest"/bin
# link scripts (not used anymore, now served by $HOME/bin)
# mkdir -p "$dest"/73h4x
#ln -svfn "$dotfiles_root"/scripts "$dest"/73h4x/scripts
# link /etc dotfiles (some of these HAVE to be in /etc)
#sudo ln -svf "$dotfiles_root"/etc/default/tlp /etc/default/tlp # tlp dir
# TODO: /etc/pacman.conf