makedots.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/bin/bash
  2. DIR=$(pwd)
  3. # Choose only the template
  4. if [ ! $1 ]
  5. then
  6. echo "Please specify [template suffix]. for a local zsh config."
  7. exit
  8. fi
  9. # Install Template
  10. if [ -f $HOME/.zshrc.local -o -h $HOME/.zshrc.local -o -d $HOME/.zshrc.local ]
  11. then
  12. rm -i $HOME/.zshrc.local
  13. fi
  14. ln -s $DIR/zshrc.local.$1 $HOME/.zshrc.local
  15. # Install all dotfiles
  16. if [ -f $HOME/.zshrc -o -h $HOME/.zshrc -o -d $HOME/.zshrc ]
  17. then
  18. rm -ri $HOME/.zshrc
  19. fi
  20. ln -s $DIR/zshrc $HOME/.zshrc
  21. for i in vimrc vim bashrc tmux.conf zshrc emacs.d dircolors compton.conf
  22. do
  23. if [ -f $HOME/.$i -o -h $HOME/.$i -o -d $HOME/.$i ]
  24. then
  25. rm -ri $HOME/.$i
  26. fi
  27. ln -s $DIR/$i $HOME/.$i
  28. done
  29. # Nvim
  30. mkdir -p $HOME/.config/
  31. if [ -d $HOME/.config/nvim ]
  32. then
  33. rm -ri $HOME/.config/nvim
  34. fi
  35. ln -s $DIR/vim $HOME/.config/nvim
  36. # Antigen
  37. if [ -h $HOME/.antigen.zsh ]
  38. then
  39. rm -i $HOME/.antigen.zsh
  40. fi
  41. ln -s $DIR/antigen/antigen.zsh $HOME/.antigen.zsh
  42. # Xmonad
  43. if [ -h $HOME/.xmonad ]
  44. then
  45. rm -i $HOME/.xmonad
  46. fi
  47. ln -s $DIR/xmonad $HOME/.xmonad
  48. if [ -h $HOME/.xmobarrc ]
  49. then
  50. rm -i $HOME/.xmobarrc
  51. fi
  52. ln -s $DIR/xmonad/xmobarrc $HOME/.xmobarrc
  53. # Emacs desktop file
  54. if [ -h $HOME/.local/share/applications ]
  55. then
  56. ln -s $DIR/emacs.d/emacs-client.desktop $HOME/.local/share/applications/emacs-client.desktop
  57. fi