2016-12-16 19:24:15 -08:00
|
|
|
#!/usr/bin/env bash
|
2016-10-19 07:56:37 -07:00
|
|
|
|
|
|
|
PWD=$(dirname $0)
|
|
|
|
|
2016-12-16 19:24:15 -08:00
|
|
|
pacman='sudo pacman --needed --noconfirm'
|
|
|
|
pacaur='pacaur --needed --noconfirm'
|
2016-11-15 12:48:06 -08:00
|
|
|
|
2016-12-16 19:24:15 -08:00
|
|
|
exists() { command -v "$1" >/dev/null; }
|
2016-11-15 12:48:06 -08:00
|
|
|
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Bootstrap
|
|
|
|
#
|
|
|
|
########################################
|
|
|
|
|
|
|
|
if ! echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1; then
|
|
|
|
>&2 echo "No internet connection detected!"
|
|
|
|
exit 1
|
2016-12-16 19:24:15 -08:00
|
|
|
elif [[ $(id -u) == 0 ]]; then
|
|
|
|
>&2 echo "Should not be run as root!"
|
|
|
|
exit 2
|
2016-11-15 12:48:06 -08:00
|
|
|
fi
|
|
|
|
|
2016-12-16 19:24:15 -08:00
|
|
|
# Essential utilities
|
|
|
|
$pacman -S wget curl tree rsync openssh dnsutils
|
2016-11-15 12:48:06 -08:00
|
|
|
|
2016-12-16 19:24:15 -08:00
|
|
|
# Set up pacaur (AUR helper)
|
|
|
|
if ! exists pacaur; then
|
2016-11-03 10:51:32 -07:00
|
|
|
pushd $(mktemp -d)
|
2016-12-16 19:24:15 -08:00
|
|
|
curl -o PKGBUILD https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=cower && makepkg --skippgpcheck -sri
|
|
|
|
curl -o PKGBUILD https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=pacaur && makepkg --skippgpcheck -sri
|
2016-11-03 10:51:32 -07:00
|
|
|
TEMP=$(pwd)
|
2016-10-31 07:32:02 -07:00
|
|
|
popd
|
|
|
|
rm -rf "$TEMP"
|
2016-12-16 19:24:15 -08:00
|
|
|
|
|
|
|
if ! exists pacaur; then
|
|
|
|
>&2 echo "Pacaur wasn't successfully installed"
|
|
|
|
exit 3
|
|
|
|
fi
|
2016-10-31 07:32:02 -07:00
|
|
|
fi
|
|
|
|
|
2016-12-16 19:24:15 -08:00
|
|
|
|
|
|
|
## Bootstrap
|
|
|
|
# Helpful utilities
|
|
|
|
$pacaur -S the_silver_searcher fasd tmux hub bc keybase cronie
|
|
|
|
sudo systemctl enable cronie.service
|
|
|
|
|
|
|
|
if [[ -z $SERVER ]]; then
|
|
|
|
# crontab
|
|
|
|
if exists crontab; then
|
|
|
|
[[ -f $PWD/crontab ]] && crontab $PWD/crontab
|
|
|
|
fi
|
|
|
|
|
2016-12-16 20:11:35 -08:00
|
|
|
# desktop essentials
|
2016-12-17 00:10:02 -08:00
|
|
|
$pacman -S xorg-init xorg-server
|
2016-12-16 19:24:15 -08:00
|
|
|
|
|
|
|
# fontconfig
|
|
|
|
if ! grep infinality /etc/pacman.conf >/dev/null; then
|
|
|
|
echo <<EOL | sudo tee -a /etc/pacman.conf
|
2016-11-15 12:48:06 -08:00
|
|
|
[infinality-bundle]
|
|
|
|
Server = http://bohoomil.com/repo/\$arch
|
|
|
|
|
|
|
|
[infinality-bundle-multilib]
|
|
|
|
Server = http://bohoomil.com/repo/multilib/\$arch
|
|
|
|
|
|
|
|
[infinality-bundle-fonts]
|
|
|
|
Server = http://bohoomil.com/repo/fonts
|
|
|
|
EOL
|
2016-12-16 19:24:15 -08:00
|
|
|
sudo pacman-key -r 962DDE58
|
|
|
|
sudo pacman-key --lsign-key 962DDE58
|
|
|
|
sudo pacman -Sy
|
|
|
|
|
|
|
|
$pacaur -S ttf-droid-ib ttf-opensans otf-fira-{mono,sans}-ibx terminus-font-td1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Window manager
|
|
|
|
$pacaur -S bspwm sxhkd compton
|
|
|
|
# Taskbar
|
2016-12-17 00:10:02 -08:00
|
|
|
$pacaur -S lemonbar-xft-git siji-git xtitle sutils-git dunst libnotify
|
2016-12-16 19:24:15 -08:00
|
|
|
# Music player
|
|
|
|
$pacaur -S mpd mpc ncmpcpp
|
|
|
|
# Utilities
|
2016-12-24 13:19:08 -08:00
|
|
|
$pacaur -S rofi feh maim slop-opengl neofetch-git pass youtube-dl xdotool
|
2016-12-16 19:24:15 -08:00
|
|
|
# Apps
|
|
|
|
$pacaur -S redshift chromium termite
|
2016-12-17 00:10:02 -08:00
|
|
|
# Power events from users
|
|
|
|
$pacaur -S polkit
|
|
|
|
# Audio
|
|
|
|
$pacaur -S alsa-utils
|
2016-12-16 19:24:15 -08:00
|
|
|
|
2016-12-20 19:54:19 -08:00
|
|
|
systemctl enable --user redshift.service
|
|
|
|
systemctl enable --user rslsync.service
|
|
|
|
systemctl enable --user mpd.service
|
|
|
|
|
|
|
|
# FIXME Install pacman hooks
|
2016-12-16 19:24:15 -08:00
|
|
|
hookdest=/etc/pacman.d/hooks
|
|
|
|
mkdir -p "$hookdest"
|
|
|
|
for hook in $PWD/$hookdest/*.hook; do
|
|
|
|
[[ -f $hookdest/${hook##*/} ]] || sudo ln -svf $hook $hookdest/
|
|
|
|
done
|
2016-11-15 12:48:06 -08:00
|
|
|
fi
|