diff --git a/.install/confirm-start.sh b/.install/confirm-start.sh index 34580ea..8545021 100644 --- a/.install/confirm-start.sh +++ b/.install/confirm-start.sh @@ -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 diff --git a/.install/done.sh b/.install/done.sh index 7df4884..976cde6 100644 --- a/.install/done.sh +++ b/.install/done.sh @@ -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 "" diff --git a/.install/hook.sh b/.install/hook.sh index 51feb23..de93086 100755 --- a/.install/hook.sh +++ b/.install/hook.sh @@ -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 diff --git a/.install/hyprland-packages.sh b/.install/hyprland-packages.sh index 0ff357e..b3ff204 100644 --- a/.install/hyprland-packages.sh +++ b/.install/hyprland-packages.sh @@ -47,7 +47,6 @@ packagesPacman=( ); packagesYay=( - "brave-bin" "pfetch" "bibata-cursor-theme" "trizen" diff --git a/.install/install-packages.sh b/.install/install-packages.sh index c339fa9..12ec170 100644 --- a/.install/install-packages.sh +++ b/.install/install-packages.sh @@ -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 "" \ No newline at end of file diff --git a/.install/installer.sh b/.install/installer.sh new file mode 100644 index 0000000..69a8248 --- /dev/null +++ b/.install/installer.sh @@ -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 diff --git a/.install/library.sh b/.install/library.sh index 74c4316..21f2ccc 100755 --- a/.install/library.sh +++ b/.install/library.sh @@ -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[@]}"; } diff --git a/.install/qtile-packages.sh b/.install/qtile-packages.sh index 6adf518..8a11be6 100644 --- a/.install/qtile-packages.sh +++ b/.install/qtile-packages.sh @@ -47,7 +47,6 @@ packagesPacman=( ); packagesYay=( - "brave-bin" "pfetch" "bibata-cursor-theme" "trizen" diff --git a/hypr/settings/modules/sddm/background/config.sh b/hypr/settings/modules/sddm/background/config.sh index e74d3a4..05ce1f5 100644 --- a/hypr/settings/modules/sddm/background/config.sh +++ b/hypr/settings/modules/sddm/background/config.sh @@ -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" diff --git a/hypr/settings/modules/sddm/background/module.sh b/hypr/settings/modules/sddm/background/module.sh index dee0309..1b0a0af 100755 --- a/hypr/settings/modules/sddm/background/module.sh +++ b/hypr/settings/modules/sddm/background/module.sh @@ -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" diff --git a/hypr/settings/modules/sddm/config.sh b/hypr/settings/modules/sddm/config.sh index 2a1bbd0..e4b6856 100644 --- a/hypr/settings/modules/sddm/config.sh +++ b/hypr/settings/modules/sddm/config.sh @@ -1,2 +1,2 @@ -name="SDDM" +name="SDDM Display Manager" order=40 \ No newline at end of file diff --git a/hypr/settings/modules/sddm/enabledisable/config.sh b/hypr/settings/modules/sddm/enabledisable/config.sh index bd52b11..2a529cc 100644 --- a/hypr/settings/modules/sddm/enabledisable/config.sh +++ b/hypr/settings/modules/sddm/enabledisable/config.sh @@ -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" diff --git a/install.sh b/install.sh index 6c09782..c7c6733 100755 --- a/install.sh +++ b/install.sh @@ -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