This commit is contained in:
Stephan Raabe 2023-12-25 14:45:11 +01:00
parent b269f9a12f
commit 8a506585b7
13 changed files with 84 additions and 20 deletions

View File

@ -3,11 +3,12 @@
# ------------------------------------------------------
echo "IMPORTANT: Please make sure that your system and your packages are up to date (sudo pacman -Syu or yay)."
echo "You can cancel the installation at any time with CMD + C"
echo "You can cancel the installation at any time with CTRL + C"
echo "If you have already installed a window manager like sway, please backup your .config folder."
SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
if [ $SCRIPTPATH = "/home/$USER/dotfiles" ]; then
echo ""
echo "IMPORTANT: You're running the installation script from the installation target directory."
echo "Please move the installation folder dotfiles e.g. to ~/Downloads/ and start the script again."
echo "Proceeding is not recommended!"
@ -25,7 +26,6 @@ if [ ! -d ~/dotfiles ];then
exit;
fi
else
echo "A ML4W dotfiles installation has been detected."
if gum confirm "DO YOU WANT TO START THE UPDATE NOW?" ;then
echo "Update started."
elif [ $? -eq 130 ]; then

View File

@ -5,5 +5,5 @@
echo -e "${GREEN}"
figlet "Done"
echo -e "${NONE}"
echo "Please logout and reboot your system!"
echo "Please reboot your system!"
echo ""

View File

@ -2,7 +2,9 @@
# Copy dotfiles
# ------------------------------------------------------
if [ -f ~/dotfiles-versions/hook.sh ]; then
echo -e "${GREEN}"
figlet "Hook"
echo -e "${NONE}"
echo "The script has detected a hook.sh script."
if gum confirm "Do you want to run the script now?"; then
source ~/dotfiles-versions/hook.sh

View File

@ -47,7 +47,6 @@ packagesPacman=(
);
packagesYay=(
"brave-bin"
"pfetch"
"bibata-cursor-theme"
"trizen"

View File

@ -1,6 +1,10 @@
# ------------------------------------------------------
# Install required packages
# ------------------------------------------------------
if [[ "$force_install" == "1" ]] ;then
echo "Force installation of all packages..."
_forcePackagesPacman "${packagesPacman[@]}";
_forcePackagesYay "${packagesYay[@]}";
else
echo "Install only missing packages..."
_installPackagesPacman "${packagesPacman[@]}";
_installPackagesYay "${packagesYay[@]}";
fi
echo ""

29
.install/installer.sh Normal file
View File

@ -0,0 +1,29 @@
# ------------------------------------------------------
# Install required packages
# ------------------------------------------------------
echo -e "${GREEN}"
figlet "Packages"
echo -e "${NONE}"
if [ -d ~/dotfiles ] ;then
echo "Do you want to check for new packages only (faster installation)"
echo "or do you want to reinstall all packages again? (can help to fix issues)"
if gum confirm "How do you want to proceed?" --affirmative "Check for new packages only" --negative "Reinstall and add new packages" ;then
force_install=0
elif [ $? -eq 130 ]; then
echo "Installation canceled."
exit 130
else
force_install=1
fi
else
echo "Do you want to reinstall all already installed packages and install the required new packages? (recommended)"
echo "or do you want to install the new required packages only? (could be faster installation)"
if gum confirm "How do you want to proceed?" --affirmative "Reinstall and add new packages" --negative "Check for new packages only" ;then
force_install=1
elif [ $? -eq 130 ]; then
echo "Installation canceled."
exit 130
else
force_install=0
fi
fi

View File

@ -52,13 +52,11 @@ _isFolderEmpty() {
# ------------------------------------------------------
_installPackagesPacman() {
toInstall=();
for pkg; do
if [[ $(_isInstalledPacman "${pkg}") == 0 ]]; then
echo "${pkg} is already installed.";
continue;
fi;
toInstall+=("${pkg}");
done;
@ -67,19 +65,32 @@ _installPackagesPacman() {
return;
fi;
printf "Package not installed:\n%s\n" "${toInstall[@]}";
# printf "Package not installed:\n%s\n" "${toInstall[@]}";
sudo pacman --noconfirm -S "${toInstall[@]}";
}
_forcePackagesPacman() {
toInstall=();
for pkg; do
toInstall+=("${pkg}");
done;
if [[ "${toInstall[@]}" == "" ]] ; then
# echo "All pacman packages are already installed.";
return;
fi;
# printf "Package not installed:\n%s\n" "${toInstall[@]}";
sudo pacman --noconfirm -S "${toInstall[@]}";
}
_installPackagesYay() {
toInstall=();
for pkg; do
if [[ $(_isInstalledYay "${pkg}") == 0 ]]; then
echo "${pkg} is already installed.";
continue;
fi;
toInstall+=("${pkg}");
done;
@ -88,7 +99,22 @@ _installPackagesYay() {
return;
fi;
printf "AUR packags not installed:\n%s\n" "${toInstall[@]}";
# printf "AUR packags not installed:\n%s\n" "${toInstall[@]}";
yay --noconfirm -S "${toInstall[@]}";
}
_forcePackagesYay() {
toInstall=();
for pkg; do
toInstall+=("${pkg}");
done;
if [[ "${toInstall[@]}" == "" ]] ; then
# echo "All packages are already installed.";
return;
fi;
# printf "AUR packags not installed:\n%s\n" "${toInstall[@]}";
yay --noconfirm -S "${toInstall[@]}";
}

View File

@ -47,7 +47,6 @@ packagesPacman=(
);
packagesYay=(
"brave-bin"
"pfetch"
"bibata-cursor-theme"
"trizen"

View File

@ -1,4 +1,4 @@
name="Background"
name="Background Image"
desxription="Update the background wallpaper of sddm to the current wallpaper."
order=50
author="Stephan Raabe ML4W"

View File

@ -1,7 +1,7 @@
#!/bin/bash
_getHeader "$name" "$author"
if gum confirm "Do you want to update the SDDM background with the current wallpaper?" ;then
if gum confirm "Do you want to update the SDDM background image with the current wallpaper?" ;then
cache_file="$HOME/.cache/current_wallpaper"

View File

@ -1,2 +1,2 @@
name="SDDM"
name="SDDM Display Manager"
order=40

View File

@ -1,4 +1,3 @@
name="Enable Disable"
desxription="Update the background wallpaper of sddm to the current wallpaper."
name="Enable Disable DM"
order=50
author="Stephan Raabe ML4W"

View File

@ -26,7 +26,12 @@ echo -e "${NONE}"
echo "Version: $version"
echo "by Stephan Raabe 2023"
echo ""
echo "This script will guide you through the installation process of my dotfiles."
if [ -d ~/dotfiles ] ;then
echo "A ML4W dotfiles installation has been detected."
echo "This script will guide you through the update process of the ML4W dotfiles."
else
echo "This script will guide you through the installation process of the ML4W dotfiles."
fi
echo ""
source .install/required.sh
source .install/confirm-start.sh
@ -34,6 +39,7 @@ source .install/backup.sh
source .install/preparation.sh
source .install/profile.sh
source .install/yay.sh
source .install/installer.sh
if [[ $profile == *"Hyprland"* ]]; then
source .install/hyprland.sh
source .install/hyprland-packages.sh