Merge Arch config as main #1

Closed
baobeld wants to merge 228 commits from arch(btw) into master
3 changed files with 54 additions and 88 deletions
Showing only changes of commit aed8ceea7e - Show all commits

View file

@ -13,94 +13,64 @@
# Function: Is package installed
# ------------------------------------------------------
_isInstalledPacman() {
package="$1";
check="$(sudo pacman -Qs --color always "${package}" | grep "local" | grep "${package} ")";
if [ -n "${check}" ] ; then
echo 0; #'0' means 'true' in Bash
return; #true
fi;
echo 1; #'1' means 'false' in Bash
return; #false
package="$1"
check="$(sudo pacman -Qs --color always "${package}" | grep "local" | grep "${package} ")"
if [ -n "${check}" ]; then
echo 0 #'0' means 'true' in Bash
return #true
fi
echo 1 #'1' means 'false' in Bash
return #false
}
_isInstalledYay() {
package="$1";
check="$(yay -Qs --color always "${package}" | grep "local" | grep "\." | grep "${package} ")";
if [ -n "${check}" ] ; then
echo 0; #'0' means 'true' in Bash
return; #true
fi;
echo 1; #'1' means 'false' in Bash
return; #false
}
_isInstalledBrew() {
package="$1";
check="$(brew list | grep "${package} ")";
if [ -n "${check}" ] ; then
echo 0; #'0' means 'true' in Bash
return; #true
fi;
echo 1; #'1' means 'false' in Bash
return; #false
package="$1"
check="$(yay -Qs --color always "${package}" | grep "local" | grep "\." | grep "${package} ")"
if [ -n "${check}" ]; then
echo 0 #'0' means 'true' in Bash
return #true
fi
echo 1 #'1' means 'false' in Bash
return #false
}
# ------------------------------------------------------
# Function Install all package if not installed
# ------------------------------------------------------
_installPackagesPacman() {
toInstall=();
for pkg; do
if [[ $(_isInstalledPacman "${pkg}") == 0 ]]; then
echo ":: ${pkg} is already installed.";
continue;
fi;
toInstall+=("${pkg}");
done;
toInstall=()
for pkg; do
if [[ $(_isInstalledPacman "${pkg}") == 0 ]]; then
echo ":: ${pkg} is already installed."
continue
fi
toInstall+=("${pkg}")
done
if [[ "${toInstall[@]}" == "" ]] ; then
# echo "All pacman packages are already installed.";
return;
fi;
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[@]}";
# 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;
toInstall=()
for pkg; do
if [[ $(_isInstalledYay "${pkg}") == 0 ]]; then
echo ":: ${pkg} is already installed."
continue
fi
toInstall+=("${pkg}")
done
if [[ "${toInstall[@]}" == "" ]] ; then
# echo "All packages are already installed.";
return;
fi;
if [[ "${toInstall[@]}" == "" ]]; then
# echo "All packages are already installed.";
return
fi
# printf "AUR packags not installed:\n%s\n" "${toInstall[@]}";
yay --noconfirm -S "${toInstall[@]}";
# printf "AUR packags not installed:\n%s\n" "${toInstall[@]}";
yay --noconfirm -S "${toInstall[@]}"
}
_installPackagesBrew() {
toInstall=();
for pkg; do
if [[ $(_isInstalledBrew "${pkg}") == 0 ]]; then
echo ":: ${pkg} is already installed.";
continue;
fi;
toInstall+=("${pkg}");
done;
if [[ "${toInstall[@]}" == "" ]] ; then
echo "All brew packages are already installed.";
return;
fi;
brew install "${toInstall[@]}";
}

View file

@ -11,8 +11,3 @@ packagesPacman=(
packagesYay=(
"emote"
)
packagesBrew=(
"asdf"
"lazydocker"
)

View file

@ -6,6 +6,7 @@ packagesPacman=(
"git"
"github-cli"
"lazygit"
"lazydocker"
"neofetch"
"ripgrep"
"neovim"