-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·75 lines (60 loc) · 2.29 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
#!/usr/bin/env bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SUDO=
if which sudo; then
SUDO="sudo"
fi
# first install some deps
if cat /etc/os-release | grep -qo "Ubuntu 18.04"; then
echo "Detected Ubuntu, going to install Ubuntu dependencies"
$SUDO apt update
$SUDO apt install -y $(cat ubuntu-dependencies)
if [ ! -d wm ]; then
mkdir -p wm && cd wm
git clone https://github.com/baskerville/bspwm.git
cd bspwm && make && $SUDO make install
$SUDO cp contrib/freedesktop/bspwm.desktop /usr/share/xsessions/
cd ..
git clone https://github.com/baskerville/sxhkd.git
cd sxhkd && make && $SUDO make install
cd ..
git clone https://github.com/baskerville/xdo.git
cd xdo && make && $SUDO make install
cd ..
git clone https://github.com/baskerville/sutils.git
cd sutils && make && $SUDO make install
cd ..
git clone https://github.com/baskerville/xtitle.git
cd xtitle && make && $SUDO make install
cd ..
git clone https://github.com/krypt-n/bar.git
cd bar && make && $SUDO make install
cd ..
cd ..
fi
else
echo "Falling back to an Arch Linux install"
yay -S --needed --noconfirm $(cat $DIR/dependencies)
fi
# using stow to deploy dotfiles
stow --ignore="wm" */ -t "$HOME"
# Create a .vim/bundle dir if it doesn't already exist
[ -d ~/.vim/bundle ] || mkdir -p ~/.vim/bundle
# Clone Vundle plugin if the folder doesn't already exist. Assuming folder is complete.
[ -d ~/.vim/bundle/Vundle.vim ] || git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
if [ -n "$DISPLAY" ]; then
xrdb -merge ~/.Xresources
fi
vim +PluginInstall +qall
if [ -f ~/.env ]; then
echo "a .env file already exists in your home dir, if you experience problems please manually diff ~/.env with dotfile/.env.dist"
else
cp "$DIR/.env.dist" ~/.env
echo "Created ~/.env for you, please change it to match your systems configuration"
fi
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
if [ ! -f ~/.zshrc_brand_spanking_new ] && [ -f ~/.zshrc.pre-oh-my-zsh ]; then
mv ~/.zshrc ~/.zshrc_brand_spanking_new
mv ~/.zshrc.pre-oh-my-zsh ~/.zshrc
fi