-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·59 lines (53 loc) · 1.53 KB
/
setup.sh
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
#!/bin/bash
# Setup dotfiles using symlinks to home directory, and git config
# Rajesh Raheja
# July 2019
cd ~/Github/dotfiles
for dotfile in * .[^.] .??*
do
if [ $dotfile != ".git" ] &&
[ $dotfile != ".[^.]" ] &&
[ $dotfile != ".??*" ] &&
[ $dotfile != "README.md" ] &&
[ $dotfile != "LICENSE" ] &&
[ $dotfile != "setup.sh" ]
then
if [ -h $HOME/"$dotfile" ] || [ -f $HOME/"$dotfile" ] || [ -d $HOME/"$dotfile" ]
then
if [ -h $HOME/"$dotfile" ]
then
echo Removing existing link $HOME/"$dotfile"
rm -f $HOME/"$dotfile"
mv $HOME/"$dotfile".bak $HOME/"$dotfile"
else
echo Backing up existing $HOME/"$dotfile"
mv $HOME/"$dotfile" $HOME/"$dotfile".bak
fi
fi
if [[ "$1" != "-d" ]]
then
echo Linking `pwd`/$dotfile to "$HOME"/$dotfile
ln -s `pwd`/$dotfile "$HOME"/$dotfile
fi
else
echo Skipping $dotfile
fi
done
# Removing auto setup of ssh to avoid security issues
# if [ -d $HOME/Google\ Drive ]
# then
# echo Linking .ssh folder from Google Drive
# mv "$HOME"/.ssh "$HOME"/.ssh.bak
# ln -fs $HOME/Google\ Drive/Software/ssh "$HOME"/.ssh
# else
# echo Google Drive not installed. Skipping linking of .ssh
# fi
osname=`uname`
if [[ "$osname" == 'Darwin' ]]; then
echo Install remaining applications and tools using scripts in the "workstation" repo.
elif [[ "$osname" == 'Linux' ]]; then
echo Start conky using : conky -c $HOME/.conky/conkyrc &
echo Start x11vnc using: ssh -t -L 5900:localhost:5900 'x11vnc -localhost -display :0'
fi
echo Dotfiles setup complete on `date`.
exit 0