-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·89 lines (75 loc) · 1.86 KB
/
install
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
#!/bin/bash
f="i"
v="v"
skip_upgrade=false
while getopts "qsf" opt; do
case $opt in
q) v="";;
s) skip_upgrade=true;;
f) f="f";;
\?) echo "Invalid option: -$OPTARG" >&2 && exit 1;;
esac
done
source ./sh/env
exists () { return $(pacman -Qi "$@" &> /dev/null); }
exists_group () { return $(pacman -Qg "$@" &> /dev/null); }
install () { pacaur -S --needed --noconfirm "$@"; }
i () { exists "$@" || install "$@"; }
l () {
from=$2
to=$DOT/$1
mkdir -p$v "$(dirname $from)"
[[ $f == "f" || ($(readlink $from) != $to && -e $to) ]] &&
ln -sn$v$f "$to" "$from"
}
sudo -v
$skip_upgrade || sudo pacman -Syu
# Git
exists git || sudo pacman -S --needed --noconfirm git
l git.config $XDG_CONFIG_HOME/git/config
# Pacaur
if ! exists pacaur; then
echo "Installing pacaur"
d="$(mktemp -d)"
exists_group base-devel || sudo pacman -S --needed --noconfirm base-devel
mkdir -p "$d" && cd "$d"
if ! exists cower; then
gpg --recv-keys --keyserver hkp://pgp.mit.edu.au 1EB2638FF56C0C53
git clone "https://aur.archlinux.org/cower.git"
cd "$d/cower"
makepkg --syncdeps --install --noconfirm
fi
cd "$d"
git clone "https://aur.archlinux.org/pacaur.git"
cd "$d/pacaur"
makepkg --syncdeps --install --noconfirm
cd $DOT
rm -rf "$d"
if ! exists pacaur; then
echo "Could not install pacaur"
exit
fi
fi
# Xorg
echo "Setting up Xorg"
i xorg-xinit
exists_group xorg || install xorg
l xinitrc $XDG_CONFIG_HOME/X11/xinitrc
l Xresources $XDG_CONFIG_HOME/X11/Xresources
# i3
echo "Setting up i3"
i rofi
i i3-wm
i polybar
l i3 $XDG_CONFIG_HOME/i3
echo "Linking other configs"
l sh/profile $HOME/.bash_profile
# Fontconfig
l fonts.conf $XDG_CONFIG_HOME/fontconfig/fonts.conf
# Emacs
l emacs/init.el $HOME/.emacs.d/init.el
l emacs/elisp $HOME/.emacs.d/my-elisp
# Termite
l termite.ini $XDG_CONFIG_HOME/termite/config
# bin
l bin $XDG_DATA_HOME/bin