2023-06-15 16:36:30 -04:00
|
|
|
#!/bin/bash
|
2023-06-17 19:32:45 -04:00
|
|
|
|
2023-12-28 04:19:52 -05:00
|
|
|
set -e
|
2023-06-17 19:32:45 -04:00
|
|
|
|
2024-01-01 04:13:57 -05:00
|
|
|
# Trigger sudo prompt before less can block password input
|
|
|
|
sudo echo ''
|
|
|
|
|
|
|
|
# Detect OS and act accordingly
|
|
|
|
. /etc/os-release
|
|
|
|
OS=$NAME
|
|
|
|
|
2023-12-29 23:47:33 -05:00
|
|
|
# Check for less and install if not found
|
|
|
|
if ! type "less" &> /dev/null; then
|
|
|
|
echo "less not found, installing..."
|
2024-01-01 04:13:57 -05:00
|
|
|
sudo pacman -S --noconfirm less # <<< should handle other distros here
|
2023-12-29 23:47:33 -05:00
|
|
|
fi
|
|
|
|
|
2023-12-28 04:19:52 -05:00
|
|
|
# Execute in less with a header for style points
|
2023-06-15 18:19:24 -04:00
|
|
|
exec > >(less +F --header 8) 2>&1
|
2023-06-15 17:49:53 -04:00
|
|
|
trap 'exec >&- 2>&-; wait' EXIT
|
2023-06-15 16:36:30 -04:00
|
|
|
|
2024-01-03 00:44:55 -05:00
|
|
|
echo ':::::::-. ... ... :::::::.. .::::::.
|
|
|
|
;;, `'\'';, .;;;;;;;. .;;;;;;;. ;;;;``;;;; ;;;` `
|
|
|
|
`[[ [[,[[ \[[,,[[ \[[,[[[,/[[['\'' '\''[==/[[[[,
|
|
|
|
$$, $$$$$, $$$$$$, $$$$$$$$$c '\'''\'''\'' $
|
|
|
|
888_,o8P'\''"888,_ _,88P"888,_ _,88P888b "88bo,88b dP
|
|
|
|
MMMMP"` "YMMMMMP" "YMMMMMP" MMMM "W" "YMmMY" '
|
|
|
|
echo "Doors are sturdier than windows.
|
2023-12-30 20:57:14 -05:00
|
|
|
-------------------------------------------------------"
|
2024-01-01 04:13:57 -05:00
|
|
|
echo -e "\nSetup for $OS"
|
2023-06-15 16:36:30 -04:00
|
|
|
|
|
|
|
if [[ $OS == *Arch* ]]; then
|
2023-12-28 04:19:52 -05:00
|
|
|
cd
|
|
|
|
echo "Enabling Pacman colors..."
|
|
|
|
sudo sed '/Color/s/^#//' -i /etc/pacman.conf
|
2023-06-15 16:36:30 -04:00
|
|
|
|
2023-12-28 04:19:52 -05:00
|
|
|
echo -e "\nVerifying base requirements..."
|
|
|
|
sudo pacman -S --needed --noconfirm git base-devel
|
2023-06-15 16:36:30 -04:00
|
|
|
|
|
|
|
if test -d .doors; then
|
|
|
|
echo -e "\n$HOME/.doors found, checking for updates..."
|
2023-12-28 04:19:52 -05:00
|
|
|
cd .doors
|
|
|
|
git pull
|
|
|
|
cd
|
2023-06-15 16:36:30 -04:00
|
|
|
else
|
|
|
|
echo -e "\n$HOME/.doors not found, creating..."
|
|
|
|
git clone https://github.com/adoyle0/Doors.git .doors
|
2023-12-28 04:19:52 -05:00
|
|
|
fi
|
2023-06-15 16:36:30 -04:00
|
|
|
|
2023-06-19 20:25:03 -04:00
|
|
|
$HOME/.doors/scripts/install_arch
|
2023-06-15 16:36:30 -04:00
|
|
|
|
2023-12-30 19:50:42 -05:00
|
|
|
# These are broken for now
|
|
|
|
# elif [[ $OS == *buntu* ]]; then
|
|
|
|
# cd
|
|
|
|
# sudo apt-get -y install git rsync
|
|
|
|
# git clone https://github.com/adoyle0/Doors.git .doors
|
|
|
|
# $HOME/.doors/scripts/install_min_ubuntu
|
|
|
|
#
|
|
|
|
# elif [[ $OS == *Fedora* ]]; then
|
|
|
|
# cd
|
|
|
|
# sudo dnf install -y git rsync
|
|
|
|
# git clone https://github.com/adoyle0/Doors.git .doors
|
|
|
|
# $HOME/.doors/scripts/install_min_fedora
|
|
|
|
|
|
|
|
else
|
|
|
|
echo "$OS is not supported by this script at this time."
|
|
|
|
exit 1
|
2023-06-15 16:36:30 -04:00
|
|
|
fi
|
|
|
|
|
2023-12-30 00:30:18 -05:00
|
|
|
# Init and update awesome widgets submodule
|
2024-01-03 02:32:33 -05:00
|
|
|
cd $HOME/.doors &&
|
2023-12-30 00:30:18 -05:00
|
|
|
git submodule init && git submodule update
|
|
|
|
|
2024-01-03 02:32:33 -05:00
|
|
|
# Copy and link files
|
|
|
|
cd $HOME/.doors &&
|
|
|
|
$HOME/.doors/scripts/copy_and_link
|
2023-06-18 21:16:12 -04:00
|
|
|
|
2023-12-28 04:19:52 -05:00
|
|
|
# Wrap up
|
2023-06-15 18:35:48 -04:00
|
|
|
echo -e "\nDone!\nLog out and back in for changes to take effect."
|
2023-06-17 19:32:45 -04:00
|
|
|
|
2023-12-28 04:19:52 -05:00
|
|
|
# Give less time to catch up and tell it we're done
|
2023-06-15 18:19:24 -04:00
|
|
|
sleep 1 && killall -s SIGINT less
|