-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.sh
executable file
·53 lines (42 loc) · 1.31 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
#!/bin/bash
set -e
HERE=$(cd $(dirname "$BASH_SOURCE"); pwd)
cd "$HERE"
# Source the profile file immediately, for e.g. peru settings.
source "$HERE/profile"
if [[ "$HERE" != "$HOME/dotfiles" ]] ; then
echo 'can only be installed from ~/dotfiles'
exit 1
fi
newshell="/bin/zsh"
if [[ ! "$SHELL" =~ "zsh" ]]; then
echo "Switching default shell from $SHELL to $newshell..."
chsh -s "$newshell"
fi
peru sync
echo Building prompt...
(cd prompt && cargo build --release)
function link {
local src="$1"
local dest="$2"
mkdir -p $(dirname "$dest")
ln -sfn "$HERE/$src" "$dest"
}
link alacritty.toml ~/.config/alacritty/alacritty.toml
link bare.desktop ~/.local/share/applications/bare.desktop
link docker_config.json ~/.docker/config.json
link gdbinit ~/.gdbinit
link gitconfig ~/.gitconfig
link helix ~/.config/helix
link hgrc ~/.hgrc
link kitty.conf ~/.config/kitty/kitty.conf
link makepkg.conf ~/.makepkg.conf
link profile ~/.profile
link tmux.conf ~/.tmux.conf
link tmux.desktop ~/.local/share/applications/tmux.desktop
link vimrc ~/.config/nvim/init.vim
link vim_pack ~/.local/share/nvim/site/pack
link zshrc ~/.zshrc
for script in $(ls bin); do
link "bin/$script" ~/bin/"$script"
done