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.
68 lines
1.6 KiB
68 lines
1.6 KiB
7 years ago
|
#!/usr/bin/sh
|
||
|
|
||
7 years ago
|
# Simple shell script to symlink my dotfiles to their place in the system
|
||
|
|
||
|
#whether to use -f when creating symlnk
|
||
|
force=false
|
||
|
#Ask if files should be overiten
|
||
|
read -n1 -p "Do you want to overide files if they exist? [y/N] " answer
|
||
|
|
||
|
#If anser is y or Y then they should be ovewriten
|
||
|
#Anything else and they shouldn't
|
||
|
if [[ "$answer" == "y" || "$answer" == "Y" ]]; then
|
||
|
force=true
|
||
|
fi
|
||
|
|
||
6 years ago
|
echo ""
|
||
7 years ago
|
# A wrapper around ln which will force if necesary
|
||
|
function myLink(){
|
||
|
if $force; then
|
||
|
/usr/bin/ln -sf "$1" "$2"
|
||
|
echo "forced $2 -> $1"
|
||
|
else
|
||
6 years ago
|
if [ ! -e "$2" ]; then
|
||
|
echo "${1} -> ${2}"
|
||
|
/usr/bin/ln -s "$1" "$2"
|
||
|
fi
|
||
7 years ago
|
fi
|
||
|
}
|
||
|
|
||
7 years ago
|
#ZSH
|
||
7 years ago
|
myLink $HOME/.dotfiles/shells/zsh/zprofile $HOME/.zprofile
|
||
|
myLink $HOME/.dotfiles/shells/zsh/zshrc $HOME/.zshrc
|
||
7 years ago
|
|
||
|
#bash
|
||
7 years ago
|
myLink $HOME/.dotfiles/shells/bash/bash_profile $HOME/.bash_profile
|
||
|
myLink $HOME/.dotfiles/shells/bash/bashrc $HOME/.bashrc
|
||
7 years ago
|
|
||
|
#X
|
||
7 years ago
|
myLink $HOME/.dotfiles/x/xinitrc $HOME/.xinitrc
|
||
6 years ago
|
myLink $HOME/.dotfiles/x/xmodmap $HOME/.Xmodmap
|
||
7 years ago
|
|
||
|
#Git
|
||
7 years ago
|
myLink $HOME/.dotfiles/git/gitconfig $HOME/.gitconfig
|
||
7 years ago
|
|
||
|
#i3
|
||
7 years ago
|
mkdir -p $HOME/.config/i3
|
||
|
myLink $HOME/.dotfiles/i3/config $HOME/.config/i3/config
|
||
6 years ago
|
myLink /home/jonathan/.dotfiles/i3/i3exit $HOME/.config/i3/i3exit
|
||
7 years ago
|
|
||
6 years ago
|
#dunst
|
||
|
myLink $HOME/.dotfiles/dunst $HOME/.config/dunst
|
||
|
|
||
7 years ago
|
#vim
|
||
7 years ago
|
myLink $HOME/.dotfiles/vim $HOME/.vim
|
||
|
myLink $HOME/.dotfiles/vim/.vimrc $HOME/.vimrc
|
||
|
|
||
|
#rofi
|
||
|
myLink $HOME/.dotfiles/rofi $HOME/.config/rofi
|
||
|
|
||
|
#Templates
|
||
|
myLink $HOME/.dotfiles/Templates $HOME/Templates
|
||
7 years ago
|
|
||
7 years ago
|
#Pandoc
|
||
|
myLink $HOME/.dotfiles/pandoc $HOME/.pandoc
|
||
7 years ago
|
|
||
6 years ago
|
#Qutebrowser
|
||
|
myLink $HOME/.dotfiles/qutebrowser $HOME/.config/qutebrowser
|