2016-12-16 19:24:15 -08:00
|
|
|
#!/usr/bin/env bash
|
2016-10-19 07:56:37 -07:00
|
|
|
|
2017-04-29 14:30:11 -07:00
|
|
|
# Provisions arch linux. Should be run from a non-root user, after the bootstrap
|
|
|
|
# script (and reboot).
|
|
|
|
|
2017-04-25 16:55:02 -07:00
|
|
|
set -e
|
|
|
|
|
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
|
|
|
|
#
|
|
|
|
########################################
|
|
|
|
|
2017-04-29 14:30:11 -07:00
|
|
|
if ! ping -c1 google.com >/dev/null; then
|
2016-11-15 12:48:06 -08:00
|
|
|
>&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
|
2017-04-29 14:30:11 -07:00
|
|
|
$pacman -S wget git 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
|
2017-05-05 12:23:58 -07:00
|
|
|
TEMP="$(mktemp -d)"
|
|
|
|
function cleanup {
|
|
|
|
rm -rf "$TEMP"
|
|
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
|
|
|
|
|
|
pushd "$TEMP"
|
2017-04-29 20:18:26 -07:00
|
|
|
curl -o PKGBUILD https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=cower && makepkg --needed --noconfirm --skippgpcheck -sri
|
|
|
|
curl -o PKGBUILD https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=pacaur && makepkg --needed --noconfirm --skippgpcheck -sri
|
2016-10-31 07:32:02 -07:00
|
|
|
popd
|
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
|
2017-05-07 07:49:59 -07:00
|
|
|
$pacaur -S ripgrep tmux hub gist bc keybase-bin cronie
|
2017-05-05 12:23:58 -07:00
|
|
|
sudo systemctl enable cronie.service
|
2016-12-16 19:24:15 -08:00
|
|
|
|
2017-09-02 09:58:39 -07:00
|
|
|
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.d/99-sysctl.conf && sudo sysctl --system
|
|
|
|
|
2016-12-16 19:24:15 -08:00
|
|
|
if [[ -z $SERVER ]]; then
|
2017-04-29 20:18:26 -07:00
|
|
|
if exists crontab; then
|
2017-05-05 12:23:58 -07:00
|
|
|
[[ -f $PWD/crontab ]] && crontab "$PWD/crontab"
|
2017-04-29 20:18:26 -07:00
|
|
|
fi
|
|
|
|
|
2017-05-05 12:23:58 -07:00
|
|
|
hookdest=/etc/pacman.d/hooks
|
|
|
|
sudo mkdir -p "$hookdest"
|
|
|
|
for hook in $PWD/$hookdest/*.hook; do
|
|
|
|
[[ -f $hookdest/${hook##*/} ]] || sudo ln -svf "$hook" "$hookdest/"
|
|
|
|
done
|
|
|
|
|
2016-12-16 20:11:35 -08:00
|
|
|
# desktop essentials
|
2017-04-29 14:30:11 -07:00
|
|
|
$pacaur -S \
|
|
|
|
xorg-xinit xorg-server \
|
|
|
|
lightdm lightdm-webkit2-greeter \
|
2017-05-05 12:30:51 -07:00
|
|
|
bspwm sxhkd compton rvxt-unicode rvxt-unicode-terminfo \
|
2017-04-29 14:30:11 -07:00
|
|
|
xcb-proto polybar \
|
|
|
|
dunst libnotify \
|
2017-09-02 09:58:54 -07:00
|
|
|
feh sxiv maim slop-opengl neofetch-git pass youtube-dl xdotool at \
|
2017-04-29 21:49:39 -07:00
|
|
|
redshift chromium chromium-widevine \
|
2017-04-29 14:30:11 -07:00
|
|
|
alsa-utils \
|
2017-05-05 12:30:40 -07:00
|
|
|
dictd dict-gcide \
|
|
|
|
arc-gtk-theme
|
2017-05-15 11:42:35 -07:00
|
|
|
|
2017-09-02 09:58:54 -07:00
|
|
|
sudo systemctl enable atd.service
|
|
|
|
|
2017-05-15 11:42:35 -07:00
|
|
|
# fonts
|
|
|
|
$pacaur -S ttf-fira-{mono,sans} ttf-dejavu ttf-liberation ttf-font-awesome
|
2016-11-15 12:48:06 -08:00
|
|
|
fi
|