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 "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." echo "If you have already installed a window manager like sway, please backup your .config folder."
SCRIPT=$(realpath "$0") SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT") SCRIPTPATH=$(dirname "$SCRIPT")
if [ $SCRIPTPATH = "/home/$USER/dotfiles" ]; then if [ $SCRIPTPATH = "/home/$USER/dotfiles" ]; then
echo ""
echo "IMPORTANT: You're running the installation script from the installation target directory." 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 "Please move the installation folder dotfiles e.g. to ~/Downloads/ and start the script again."
echo "Proceeding is not recommended!" echo "Proceeding is not recommended!"
@ -25,7 +26,6 @@ if [ ! -d ~/dotfiles ];then
exit; exit;
fi fi
else else
echo "A ML4W dotfiles installation has been detected."
if gum confirm "DO YOU WANT TO START THE UPDATE NOW?" ;then if gum confirm "DO YOU WANT TO START THE UPDATE NOW?" ;then
echo "Update started." echo "Update started."
elif [ $? -eq 130 ]; then elif [ $? -eq 130 ]; then

View File

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

View File

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

View File

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

View File

@ -1,6 +1,10 @@
# ------------------------------------------------------ if [[ "$force_install" == "1" ]] ;then
# Install required packages echo "Force installation of all packages..."
# ------------------------------------------------------ _forcePackagesPacman "${packagesPacman[@]}";
_forcePackagesYay "${packagesYay[@]}";
else
echo "Install only missing packages..."
_installPackagesPacman "${packagesPacman[@]}"; _installPackagesPacman "${packagesPacman[@]}";
_installPackagesYay "${packagesYay[@]}"; _installPackagesYay "${packagesYay[@]}";
fi
echo "" 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() { _installPackagesPacman() {
toInstall=(); toInstall=();
for pkg; do for pkg; do
if [[ $(_isInstalledPacman "${pkg}") == 0 ]]; then if [[ $(_isInstalledPacman "${pkg}") == 0 ]]; then
echo "${pkg} is already installed."; echo "${pkg} is already installed.";
continue; continue;
fi; fi;
toInstall+=("${pkg}"); toInstall+=("${pkg}");
done; done;
@ -67,19 +65,32 @@ _installPackagesPacman() {
return; return;
fi; 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[@]}"; sudo pacman --noconfirm -S "${toInstall[@]}";
} }
_installPackagesYay() { _installPackagesYay() {
toInstall=(); toInstall=();
for pkg; do for pkg; do
if [[ $(_isInstalledYay "${pkg}") == 0 ]]; then if [[ $(_isInstalledYay "${pkg}") == 0 ]]; then
echo "${pkg} is already installed."; echo "${pkg} is already installed.";
continue; continue;
fi; fi;
toInstall+=("${pkg}"); toInstall+=("${pkg}");
done; done;
@ -88,7 +99,22 @@ _installPackagesYay() {
return; return;
fi; 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[@]}"; yay --noconfirm -S "${toInstall[@]}";
} }

View File

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

View File

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

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
_getHeader "$name" "$author" _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" cache_file="$HOME/.cache/current_wallpaper"

View File

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

View File

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

View File

@ -26,7 +26,12 @@ echo -e "${NONE}"
echo "Version: $version" echo "Version: $version"
echo "by Stephan Raabe 2023" echo "by Stephan Raabe 2023"
echo "" 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 "" echo ""
source .install/required.sh source .install/required.sh
source .install/confirm-start.sh source .install/confirm-start.sh
@ -34,6 +39,7 @@ source .install/backup.sh
source .install/preparation.sh source .install/preparation.sh
source .install/profile.sh source .install/profile.sh
source .install/yay.sh source .install/yay.sh
source .install/installer.sh
if [[ $profile == *"Hyprland"* ]]; then if [[ $profile == *"Hyprland"* ]]; then
source .install/hyprland.sh source .install/hyprland.sh
source .install/hyprland-packages.sh source .install/hyprland-packages.sh