2016-12-16 19:24:15 -08:00
|
|
|
#!/usr/bin/env bash
|
2016-10-19 07:56:37 -07:00
|
|
|
|
2017-04-25 16:55:02 -07:00
|
|
|
set -e
|
|
|
|
shopt -s nullglob
|
|
|
|
|
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
|
2017-04-02 20:09:27 -07:00
|
|
|
# Desktop manager
|
|
|
|
$pacaur -S lightdm lightdm-webkit2-greeter
|
2016-12-16 19:24:15 -08:00
|
|
|
# Window manager
|
|
|
|
$pacaur -S bspwm sxhkd compton
|
|
|
|
# Taskbar
|
2017-04-26 15:52:37 -07:00
|
|
|
$pacaur -S xcb-proto polybar
|
|
|
|
# Notifications
|
|
|
|
$pacaur -S dunst libnotify
|
2016-12-16 19:24:15 -08:00
|
|
|
# Utilities
|
2016-12-24 16:12:16 -08:00
|
|
|
$pacaur -S rofi feh sxiv maim slop-opengl neofetch-git pass youtube-dl xdotool
|
2016-12-16 19:24:15 -08:00
|
|
|
# Apps
|
2017-04-24 00:07:08 -07:00
|
|
|
$pacaur -S redshift firefox termite
|
2016-12-17 00:10:02 -08:00
|
|
|
# Audio
|
|
|
|
$pacaur -S alsa-utils
|
2017-04-24 00:07:08 -07:00
|
|
|
# Dictionary
|
|
|
|
$pacaur -S dictd dict-gcide
|
2016-12-16 19:24:15 -08:00
|
|
|
|
|
|
|
hookdest=/etc/pacman.d/hooks
|
2016-12-24 13:19:23 -08:00
|
|
|
sudo mkdir -p "$hookdest"
|
2016-12-16 19:24:15 -08:00
|
|
|
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
|