Updates
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 ""
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -47,7 +47,6 @@ packagesPacman=(
|
||||
);
|
||||
|
||||
packagesYay=(
|
||||
"brave-bin"
|
||||
"pfetch"
|
||||
"bibata-cursor-theme"
|
||||
"trizen"
|
||||
|
||||
@@ -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
29
.install/installer.sh
Normal 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
|
||||
@@ -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[@]}";
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@ packagesPacman=(
|
||||
);
|
||||
|
||||
packagesYay=(
|
||||
"brave-bin"
|
||||
"pfetch"
|
||||
"bibata-cursor-theme"
|
||||
"trizen"
|
||||
|
||||
Reference in New Issue
Block a user