-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakesymlinks.sh
More file actions
executable file
·70 lines (60 loc) · 2.1 KB
/
makesymlinks.sh
File metadata and controls
executable file
·70 lines (60 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh
############################
# .make.sh
# This script creates symlinks from the home directory to any desired dotfiles in ~/dotfiles
############################
########## Variables
dir=~/src/dotfiles # dotfiles directory
olddir=~/src/dotfiles/dotfiles_old # old dotfiles backup directory
files="~/Pictures/Screenshots/wallpaper.png ~/.doom.d/config.el ~/.doom.d/custom.el ~/.doom.d/init.el ~/.doom.d/packages ~/.zshrc ~/.xmobarrc ~/.xmonad/xmonad.hs ~/.xsession ~/.Xresources ~/.ghc/ghci.conf" # list of files/folders to symlink in homedir
##########
# create dotfiles_old in homedir
echo -n "Creating $olddir for backup of any existing dotfiles in ~ ..."
# mkdir -p ~/dev
# mkdir -p ~/.emacs.d
mkdir -p ~/.xmonad
mkdir -p ~/.ghc/ghci.conf
mkdir -p ~/.doom.d
mkdir -p ~/Pictures/Screenshots
mkdir -p $dir
mkdir -p $olddir
echo "done"
echo ""
# change to the dotfiles directory
echo -n "Changing to the $dir directory ..."
cd $dir
echo "done"
echo ""
echo "Copying any existing dotfiles from ~ to $olddir"
mv ~/.gitconfig $olddir
mv ~/.zshrc $olddir
# mv ~/.emacs.d/init.el $olddir
mv ~/.xmobarrc $olddir
mv ~/.xmonad/xmonad.hs $olddir
mv ~/.xsession $olddir
mv ~/.Xresources $olddir
mv ~/.ghc/ghci.conf $olddir
mv ~/.doom.d/config.el $olddir
mv ~/.doom.d/custom.el $olddir
mv ~/.doom.d/init.el $olddir
mv ~/.doom.d/packages.el $olddir
echo "Finished doing backup for existing dotfiles (an error will appear for each non-existing dotfile)."
echo ""
echo "Creating symlink in home directory."
ln -s $dir/gitconfig ~/.gitconfig
ln -s $dir/zshrc ~/.zshrc
ln -s $dir/xmobarrc ~/.xmobarrc
ln -s $dir/xmonad.hs ~/.xmonad/xmonad.hs
ln -s $dir/xsession ~/.xsession
ln -s $dir/Xresources ~/.Xresources
ln -s $dir/ghci.conf ~/.ghc/ghci.conf
ln -s $dir/config.el ~/.doom.d/config.el
ln -s $dir/custom.el ~/.doom.d/custom.el
ln -s $dir/init.el ~/.doom.d/init.el
ln -s $dir/packages.el ~/.doom.d/packages.el
ln -s $dir/wallpaper.png ~/Pictures/wallpaper.png
# doom-emacs install
echo "Installing Doom Emacs."
git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d
~/.emacs.d/bin/doom install
echo "done"