Hyprland-dotfiles/1-install.sh
2023-10-18 07:22:28 +02:00

214 lines
5.9 KiB
Bash
Executable File

#/bin/bash
# ___ _ _ _
# |_ _|_ __ ___| |_ __ _| | |
# | || '_ \/ __| __/ _` | | |
# | || | | \__ \ || (_| | | |
# |___|_| |_|___/\__\__,_|_|_|
#
# by Stephan Raabe (2023)
# -----------------------------------------------------
# Install Script for required packages
# ------------------------------------------------------
# ------------------------------------------------------
# Load Library
# ------------------------------------------------------
source $(dirname "$0")/scripts/library.sh
clear
echo " ___ _ _ _ "
echo " |_ _|_ __ ___| |_ __ _| | | "
echo " | || _ \/ __| __/ _ | | | "
echo " | || | | \__ \ || (_| | | | "
echo " |___|_| |_|___/\__\__,_|_|_| "
echo " "
echo "by Stephan Raabe (2023)"
echo "-------------------------------------"
echo ""
# ------------------------------------------------------
# Check if yay is installed
# ------------------------------------------------------
if sudo pacman -Qs yay > /dev/null ; then
echo "yay is installed. You can proceed with the installation"
else
echo "yay is not installed. Will be installed now!"
_installPackagesPacman "base-devel"
git clone https://aur.archlinux.org/yay-git.git ~/yay-git
cd ~/yay-git
makepkg -si
cd ~/dotfiles/
clear
echo "yay has been installed successfully."
echo ""
echo " ___ _ _ _ "
echo " |_ _|_ __ ___| |_ __ _| | | "
echo " | || _ \/ __| __/ _ | | | "
echo " | || | | \__ \ || (_| | | | "
echo " |___|_| |_|___/\__\__,_|_|_| "
echo " "
echo "by Stephan Raabe (2023)"
echo "-------------------------------------"
echo ""
fi
# ------------------------------------------------------
# Confirm Start
# ------------------------------------------------------
while true; do
read -p "DO YOU WANT TO START THE INSTALLATION NOW? (Yy/Nn): " yn
case $yn in
[Yy]* )
echo "Installation started."
break;;
[Nn]* )
exit;
break;;
* ) echo "Please answer yes or no.";;
esac
done
# ------------------------------------------------------
# Install required packages
# ------------------------------------------------------
echo ""
echo "-> Install main packages"
packagesPacman=(
"pacman-contrib"
"alacritty"
"rofi"
"chromium"
"nitrogen"
"dunst"
"starship"
"neovim"
"mpv"
"freerdp"
"xfce4-power-manager"
"thunar"
"mousepad"
"ttf-font-awesome"
"ttf-fira-sans"
"ttf-fira-code"
"ttf-firacode-nerd"
"figlet"
"vlc"
"exa"
"python-pip"
"python-psutil"
"python-rich"
"python-click"
"xdg-desktop-portal-gtk"
"pavucontrol"
"tumbler"
"xautolock"
"blueman"
"sddm"
"papirus-icon-theme"
);
packagesYay=(
"brave-bin"
"pfetch"
"bibata-cursor-theme"
"trizen"
"sddm-sugar-dark"
);
# ------------------------------------------------------
# Install required packages
# ------------------------------------------------------
_installPackagesPacman "${packagesPacman[@]}";
_installPackagesYay "${packagesYay[@]}";
# ------------------------------------------------------
# Install pywal
# ------------------------------------------------------
if [ -f /usr/bin/wal ]; then
echo "pywal already installed."
else
yay --noconfirm -S pywal
fi
clear
# ------------------------------------------------------
# Install .bashrc
# ------------------------------------------------------
echo ""
echo "-> Install .bashrc"
_installSymLink .bashrc ~/.bashrc ~/dotfiles/.bashrc ~/.bashrc
# ------------------------------------------------------
# Install sddm display manager
# ------------------------------------------------------
echo ""
echo "-> Install sddm display manager"
while true; do
read -p "Do you want to install the custom login promt? (Yy/Nn): " yn
case $yn in
[Yy]* )
sudo systemctl enable sddm.service
break;;
[Nn]* )
echo "sddm installation skipped."
break;;
* ) echo "Please answer yes or no.";;
esac
done
# ------------------------------------------------------
# Install wallpapers
# ------------------------------------------------------
echo ""
echo "-> Install wallapers"
while true; do
read -p "Do you want to clone the wallpapers? If not, the script will install 3 default wallpapers to ~/wallpaper/ (Yy/Nn): " yn
case $yn in
[Yy]* )
if [ -d ~/wallpaper/ ]; then
echo "wallpaper folder already exists."
else
git clone https://gitlab.com/stephan-raabe/wallpaper.git ~/wallpaper
echo "wallpaper installed."
fi
echo "Wallpaper installed."
break;;
[Nn]* )
if [ -d ~/wallpaper/ ]; then
echo "wallpaper folder already exists."
else
mkdir ~/wallpaper
fi
cp ~/dotfiles/wallpapers/* ~/wallpaper
echo "Default wallpapers installed."
break;;
* ) echo "Please answer yes or no.";;
esac
done
# ------------------------------------------------------
# Init pywal
# ------------------------------------------------------
echo ""
echo "-> Init pywal"
wal -i ~/dotfiles/wallpapers/default.jpg
echo "pywal initiated."
# ------------------------------------------------------
# Copy default wallpaper to .cache
# ------------------------------------------------------
echo ""
echo "-> Copy default wallpaper to .cache"
cp ~/dotfiles/wallpapers/default.jpg ~/.cache/current_wallpaper.jpg
echo "default wallpaper copied."
# ------------------------------------------------------
# DONE
# ------------------------------------------------------
clear
echo "DONE!"
echo "NEXT: Please continue with 2-install-hyprland.sh and/or 2-install-qtile.sh"