forked from BlueTufa/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstaller.sh
executable file
·89 lines (73 loc) · 2.97 KB
/
installer.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
#! /bin/bash
install-vim-plug () {
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
}
install-oh-my-zsh () {
make-backup ~/.zshrc
make-backup ~/.p10k.zsh
echo "Remember to type exit after the oh-my-zsh install is complete"
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.powerlevel10k
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
echo "Remember to run p10k configure any time you want to reconfigure powerlevel10k."
ln -sf $(pwd)/zsh/.zshrc ~/.zshrc
}
make-backup () {
# if the file exists and is not a symlink...
if [[ -f $1 ]] && [[ ! -L $1 ]]
then
new_path="$(dirname $1)/backup-of-$(basename $1)"
echo "Making a backup of non-symlinked $1 to ${new_path}"
mv $1 ${new_path}
fi
}
# os-independent config directories
mkdir -p ~/src/bin
mkdir -p ~/.config/fish
mkdir -p ~/.config/nvim
mkdir -p ~/.config/kitty
# comment this out if you don't want to use oh-my-zsh or zsh support
# [[ -d ~/.oh-my-zsh ]] || install-oh-my-zsh
[[ -f ~/.local/share/nvim/site/autoload/plug.vim ]] || install-vim-plug
make-backup ~/.config/fish/config.fish
make-backup ~/.config/nvim/init.vim
# comment this out if you don't want to symlink gitconfig.
# make-backup ~/.gitconfig
ln -sf $(pwd)/fish/config.fish ~/.config/fish/config.fish
ln -sf $(pwd)/nvim/init.vim ~/.config/nvim/init.vim
ln -sf $(pwd)/zsh/.p10k.zsh ~/.p10k.zsh
if [[ $(uname -v | grep 'Debian') ]]; then
echo 'Attempting to install baseline dependencies for cli support on Debian'
sudo ./debian/client-dependencies.sh
fi
touch ~/.hushlogin
if [[ $(uname) == "Linux" ]]; then
mkdir -p ~/.config/alacritty
mkdir -p ~/.config/sway/scripts
mkdir -p ~/.config/mpd
mkdir -p ~/.ncmpcpp
mkdir -p ~/.config/waybar
mkdir -p ~/.config/wofi
ln -sf $(pwd)/alacritty/alacritty.yml ~/.config/alacritty/alacritty.yml
ln -sf $(pwd)/sway/config ~/.config/sway/config
ln -sf $(pwd)/sway/scripts/sway-launcher-desktop.sh ~/.config/sway/scripts/sway-launcher-desktop.sh
ln -sf $(pwd)/mpd/mpd.conf ~/.config/mpd/mpd.conf
ln -sf $(pwd)/.ncmpcpp/config ~/.ncmpcpp/config
ln -sf $(pwd)/waybar/config ~/.config/waybar/config
ln -sf $(pwd)/waybar/executable_mediaplayer.sh ~/.config/waybar/executable_mediaplayer.sh
ln -sf $(pwd)/waybar/style.css ~/.config/waybar/style.css
ln -sf $(pwd)/wofi/style.css ~/.config/wofi/style.css
fi
if [[ $(uname) == "Darwin" ]]; then
# this next line is totally subjective and will fall victim to my mood at any time
ln -sf $(pwd)/kitty/kitty.conf.ayu-mirage ~/.config/kitty/kitty.conf
# TODO: fix this, it only runs properly in a fish shell
# curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher
# fisher install edc/bass
fi
for file in fish/.{functions,exports,aliases,*$(uname)}
do
make-backup ~/.config/${file}
echo "Linking ${file}..."
ln -sf $(pwd)/${file} ~/.config/${file}
done