Doors/setup

93 lines
2 KiB
Text
Raw Normal View History

2023-06-15 16:36:30 -04:00
#!/bin/bash
2023-06-17 19:32:45 -04:00
#
# setup
#
2023-06-15 16:36:30 -04:00
clear
2023-06-17 19:32:45 -04: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
2023-06-17 19:32:45 -04:00
# grab said header
2023-06-15 17:49:53 -04:00
curl -s https://doordesk.net/doors
2023-06-15 18:19:24 -04:00
echo -e "Doors are sturdier than windows.\n-------------------------------------------------------"
2023-06-15 16:36:30 -04:00
2023-06-17 19:32:45 -04:00
#
# detect OS and run corresponding setup
#
2023-06-15 16:36:30 -04:00
. /etc/os-release
OS=$NAME
2023-06-15 18:19:24 -04:00
echo -e "\nDetected OS as $OS"
2023-06-15 16:36:30 -04:00
if [[ $OS == *Arch* ]]; then
cd &&
echo "Enabling Pacman colors..." &&
sudo sed '/Color/s/^#//' -i /etc/pacman.conf &&
echo -e "\nVerifying base requirements..." &&
sudo pacman -S --needed --noconfirm git base-devel &&
if test -d .doors; then
echo -e "\n$HOME/.doors found, checking for updates..."
cd .doors && git pull && cd
else
echo -e "\n$HOME/.doors not found, creating..."
git clone https://github.com/adoyle0/Doors.git .doors
fi &&
.doors/scripts/install_arch
elif [[ $OS == *buntu* ]]; then
cd &&
sudo apt-get -y install git rsync &&
git clone https://github.com/adoyle0/Doors.git .doors &&
.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 &&
.doors/scripts/install_min_fedora
fi
2023-06-17 19:32:45 -04:00
#
# copy configs
#
2023-06-15 16:36:30 -04:00
echo -e "\nInstalling Configs..." &&
cd .doors/configs &&
for file in *
do
if test -d $HOME/.config/$file; then
echo -e "\n$file already exists, creating backups..."
else
echo -e "\nWriting $file..."
fi
cp -rbv $file $HOME/.config/
done &&
echo -e "\nLinking profile..." &&
cp -sbv $HOME/.config/shell/profile $HOME/.zprofile &&
2023-06-17 19:32:45 -04: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
# wait for less to catch up and tell it we're done
2023-06-15 18:19:24 -04:00
sleep 1 && killall -s SIGINT less