@@ -93,6 +93,23 @@ install_package() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to just install packages with either yay or paru without checking if installed
|
||||||
|
install_package_f() {
|
||||||
|
(
|
||||||
|
stdbuf -oL $ISAUR -S --noconfirm "$1" 2>&1
|
||||||
|
) >> "$LOG" 2>&1 &
|
||||||
|
PID=$!
|
||||||
|
show_progress $PID "$1"
|
||||||
|
|
||||||
|
# Double check if package is installed
|
||||||
|
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||||
|
echo -e "${OK} Package ${YELLOW}$1${RESET} has been successfully installed!"
|
||||||
|
else
|
||||||
|
# Something is missing, exiting to review log
|
||||||
|
echo -e "\n${ERROR} ${YELLOW}$1${RESET} failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :("
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Function for removing packages
|
# Function for removing packages
|
||||||
uninstall_package() {
|
uninstall_package() {
|
||||||
local pkg="$1"
|
local pkg="$1"
|
||||||
|
|||||||
@@ -75,12 +75,20 @@ if git clone --depth 1 "$source_theme" "$theme_name"; then
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
# If the directory doesn't exist, create it and set up the new theme
|
|
||||||
echo "$CAT - $sddm_conf_dir not found, creating..." | tee -a "$LOG"
|
echo "$CAT - $sddm_conf_dir not found, creating..." | tee -a "$LOG"
|
||||||
sudo mkdir -p "$sddm_conf_dir" 2>&1 | tee -a "$LOG"
|
sudo mkdir -p "$sddm_conf_dir" 2>&1 | tee -a "$LOG"
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e "[Theme]\nCurrent=$theme_name" | sudo tee "$sddm_conf_dir/theme.conf.user" 2>&1 | tee -a "$LOG"
|
if [ ! -f "$sddm_conf_dir/theme.conf.user" ]; then
|
||||||
|
echo -e "[Theme]\nCurrent = $theme_name" | sudo tee "$sddm_conf_dir/theme.conf.user" > /dev/null
|
||||||
|
|
||||||
|
if [ -f "$sddm_conf_dir/theme.conf.user" ]; then
|
||||||
echo "Created and configured $sddm_conf_dir/theme.conf.user with theme $theme_name" | tee -a "$LOG"
|
echo "Created and configured $sddm_conf_dir/theme.conf.user with theme $theme_name" | tee -a "$LOG"
|
||||||
|
else
|
||||||
|
echo "Failed to create $sddm_conf_dir/theme.conf.user" | tee -a "$LOG"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "$sddm_conf_dir/theme.conf.user already exists, skipping creation." | tee -a "$LOG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Replace current background from assets
|
# Replace current background from assets
|
||||||
|
|||||||
@@ -17,20 +17,10 @@ LOG="Install-Logs/install-$(date +%d-%H%M%S)_zsh_pokemon.log"
|
|||||||
|
|
||||||
printf "${NOTE} Removing any traces of ${SKY_BLUE}Pokemon Color Scripts${RESET}\n"
|
printf "${NOTE} Removing any traces of ${SKY_BLUE}Pokemon Color Scripts${RESET}\n"
|
||||||
|
|
||||||
# Check if the pokemon directory exists
|
|
||||||
if [ -d "/usr/local/opt/pokemon-colorscripts" ]; then
|
|
||||||
sudo rm -rf /usr/local/opt/pokemon-colorscripts
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if the pokemon file exists
|
|
||||||
if [ -f "/usr/local/bin/pokemon-colorscripts" ]; then
|
|
||||||
sudo rm -f /usr/local/bin/pokemon-colorscripts
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install Pokemon Color Scripts
|
# Install Pokemon Color Scripts
|
||||||
printf "${NOTE} Installing ${SKY_BLUE}Pokemon Color Scripts${RESET}\n"
|
printf "${NOTE} Installing ${SKY_BLUE}Pokemon Color Scripts${RESET}\n"
|
||||||
for pok in "pokemon-colorscripts-git"; do
|
for pok in "pokemon-colorscripts-git"; do
|
||||||
install_package "$pok" "$LOG"
|
install_package_f "$pok" "$LOG"
|
||||||
done
|
done
|
||||||
|
|
||||||
printf "\n%.0s" {1..1}
|
printf "\n%.0s" {1..1}
|
||||||
|
|||||||
Reference in New Issue
Block a user