forked from mellowcandle/myrcs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·129 lines (97 loc) · 3.62 KB
/
install.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/bin/bash
############################
# .make.sh
# This script creates symlinks from the home directory to any desired dotfiles in ~/dotfiles
############################
########## Variables
dir=$PWD # dotfiles directory
olddir=~/.dotfiles_old_$(date +"%d-%m-%Y") # old dotfiles backup directory
files=".tmux.conf .bashrc .bash_aliases .bash_arch .gitignore .gitconfig .gitconfig_gmail .gitconfig_intel .vimrc .vim .git-prompt .acd_func .pwclientrc" # list of files/folders to symlink in homedir
# Detect the current distrubution we're in:
arch=$(uname -m)
kernel=$(uname -r)
if [ -n "$(command -v lsb_release)" ]; then
distroname=$(lsb_release -s -d)
elif [ -f "/etc/os-release" ]; then
distroname=$(grep PRETTY_NAME /etc/os-release | sed 's/PRETTY_NAME=//g' | tr -d '="')
elif [ -f "/etc/debian_version" ]; then
distroname="Debian $(cat /etc/debian_version)"
elif [ -f "/etc/redhat-release" ]; then
distroname=$(cat /etc/redhat-release)
else
distroname="$(uname -s) $(uname -r)"
fi
echo "Running on: $distroname"
exit
mkdir -p ~/bin
mkdir -p ~/.vim_runtime/temp_dirs/undodir
##########
# BACKUP #
##########
# create dotfiles_old in homedir
echo "Creating $olddir for backup of any existing dotfiles in ~"
mkdir -p $olddir
echo "...done"
# change to the dotfiles directory
echo "Changing to the $dir directory"
cd $dir
echo "...done"
# move any existing dotfiles in homedir to dotfiles_old directory, then create symlinks
for file in $files; do
echo "Moving any existing dotfiles from ~ to $olddir"
mv ~/$file $olddir
echo "Creating symlink to $file in home directory."
ln -s $dir/$file ~/$file
done
# copy whole .config directory before making changes
echo "cp ~/.config/ dir before making changes:"
rsync -rav ~/.config $olddir/.
###############
# WRITE FILES #
###############
# TODO: maybe split mac specific to different branch-file?
# enable home-end on microsoft4000 keyboard
mkdir -p ~/Library/KeyBindings
cp DefaultKeyBinding.dict ~/Library/KeyBindings
# enable home-end on microsoft4000 keyboard
mkdir -p ~/.config/karabiner
cp karabiner.json ~/.config/karabiner/karabiner.json
# mac has an paths.d direcotry
# cp you personal path files in there:
cp ohadTestPath /etc/paths.d/.
sudo mkdir -p /etc/synthetic.d
sudo cp ohadMacMountPoints /etc/synthetic.d/.
# Build and install cscope (my version becuase upstream is shit) */
mkdir tmp
cd tmp
curl -O -J -L https://github.com/mellowcandle/cscope/archive/master.zip
unzip cscope-master.zip
cd cscope-master
autoreconf -i
./configure
make -j8
sudo make install
cd ../..
rm -rf tmp
# .gdbinit is in a special directory
ln -s -f $dir/extra/gdb-dashboard/.gdbinit ~/.gdbinit
# Install filepicker
ln -s -f $dir/extra/PathPicker/fpp ~/bin/fpp
ln -s -f $dir/extra/diff-so-fancy/diff-so-fancy ~/bin/diff-so-fancy
ln -s -f $dir/extra/tmux-vim-select-pane /bin/tmux-vim-select-pane
ln -s -f $dir/extra/pastebin.py /bin/pastebin
ln -s -f $dir/extra/android-completion/android /etc/etc/bash_completion.d/android
ln -s -f $dir/extra/bitbake-bash-completion/bitbake /etc/etc/bash_completion.d/bitbake
ln -s -f $dir/extra/.tmux/.tmux.conf ~/.tmux.conf
cp $dir/extra/.tmux/.tmux.conf.local ~/
ln -s $dir/extra/tmux-bash-completion/completions/tmux /etc/bash_completions.d/tmux
# Install pwclint
curl -o ~/bin/pwclient -J -L http://patchwork.ozlabs.org/pwclient/
chmod +x ~/bin/pwclient
# Install TLDR
curl -o ~/bin/tldr https://raw.githubusercontent.com/raylee/tldr/master/tldr
chmod +x ~/bin/tldr
# Need to do so only for Ubuntu
echo "Installing BAT"
curl -O -J -L https://github.com/sharkdp/bat/releases/download/v0.6.1/bat_0.6.1_amd64.deb
sudo dpkg -i bat_0.6.1_amd64.deb