Skip to content

Commit

Permalink
fix every issue related to printf (#596)
Browse files Browse the repository at this point in the history
* increase synergy between scripts

* Fix newlines Fix packagers etc

* fix an issue with no new line being created

* fix formatting

Co-authored-by: Adam Perkowski <[email protected]>

* fix extra comma

Co-authored-by: Adam Perkowski <[email protected]>

* change to ()

Co-authored-by: Adam Perkowski <[email protected]>

* change to ()

Co-authored-by: Adam Perkowski <[email protected]>

* change to ()

Co-authored-by: Adam Perkowski <[email protected]>

* change to ()

Co-authored-by: Adam Perkowski <[email protected]>

* remove extra comma

Co-authored-by: Adam Perkowski <[email protected]>

* remove "please"

Co-authored-by: Adam Perkowski <[email protected]>

* add support for caps

Co-authored-by: Adam Perkowski <[email protected]>

* add support for caps

Co-authored-by: Adam Perkowski <[email protected]>

* add support for caps

Co-authored-by: Adam Perkowski <[email protected]>

* remove \n and make the default option "N"

Co-authored-by: Adam Perkowski <[email protected]>

* add an extra quote

Co-authored-by: Adam Perkowski <[email protected]>

* add extra quotes

* fix remaining sn

* fix remaining new lines

---------

Co-authored-by: nnyyxxxx <[email protected]>
Co-authored-by: Adam Perkowski <[email protected]>
  • Loading branch information
3 people authored Sep 22, 2024
1 parent 76a4ffc commit cca2660
Show file tree
Hide file tree
Showing 42 changed files with 291 additions and 284 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ installGithubDesktop() {
"$ESCALATION_TOOL" "$PACKAGER" install github-desktop
;;
*)
printf "%b\n" "${RED}Unsupported package manager. Please install Github Desktop manually.${RC}"
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;;
esac
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ installNeovim() {
"$ESCALATION_TOOL" "$PACKAGER" install -y neovim ripgrep fzf python3-virtualenv luarocks golang ShellCheck git
;;
*)
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}" # The packages above were grabbed out of the original nvim-setup-script.
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;;
esac
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ installSublime() {
"$ESCALATION_TOOL" "$PACKAGER" install sublime-text
;;
*)
printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}"
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;;
esac
else
Expand Down
3 changes: 2 additions & 1 deletion core/tabs/applications-setup/Developer-tools/vscode-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ installVsCode() {
"$ESCALATION_TOOL" "$PACKAGER" install code
;;
*)
printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}"
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;;
esac
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ installVsCodium() {
printf "%b\n" "[gitlab.com_paulcarroty_vscodium_repo]\nname=download.vscodium.com\nbaseurl=https://download.vscodium.com/rpms/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg\nmetadata_expire=1h" | "$ESCALATION_TOOL" tee -a /etc/yum.repos.d/vscodium.repo
;;
*)
printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}"
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;;
esac
else
Expand Down
20 changes: 11 additions & 9 deletions core/tabs/applications-setup/browser-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ install_chrome() {
"$ESCALATION_TOOL" "$PACKAGER" install -y google-chrome-stable
;;
*)
printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}"
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
;;
esac
else
Expand All @@ -43,15 +43,14 @@ install_thorium() {
;;
zypper|dnf)
url=$(curl -s https://api.github.com/repos/Alex313031/Thorium/releases/latest | grep -oP '(?<=browser_download_url": ")[^"]*\.rpm')
echo $url && curl -L $url -o thorium-latest.rpm
echo "$url" && curl -L "$url" -o thorium-latest.rpm
"$ESCALATION_TOOL" rpm -i thorium-latest.rpm && rm thorium-latest.rpm
;;
pacman)
"$AUR_HELPER" -S --needed --noconfirm thorium-browser-bin
;;
*)
printf "%b\n" "${RED}Unsupported package manager. Please install Thorium manually.${RC}"
exit 1
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
;;
esac
else
Expand All @@ -76,7 +75,8 @@ install_firefox() {
"$ESCALATION_TOOL" "$PACKAGER" install -y firefox
;;
*)
printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}"
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;;
esac
else
Expand Down Expand Up @@ -117,7 +117,7 @@ Signed-By: /usr/share/keyrings/librewolf.gpg" | "$ESCALATION_TOOL" tee /etc/apt/
"$AUR_HELPER" -S --needed --noconfirm librewolf-bin
;;
*)
printf "%b\n" "${RED}Unsupported package manager. Please install Librewolf manually.${RC}"
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;;
esac
Expand Down Expand Up @@ -152,7 +152,8 @@ install_brave() {
"$ESCALATION_TOOL" "$PACKAGER" install -y brave-browser
;;
*)
printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}"
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;;
esac
else
Expand Down Expand Up @@ -189,7 +190,8 @@ install_chromium() {
"$ESCALATION_TOOL" "$PACKAGER" install -y chromium
;;
*)
printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}"
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;;
esac
else
Expand Down Expand Up @@ -227,7 +229,7 @@ browserSetup() {
printf "%b\n" "7. Thorium"
printf "%b\n" "8. Lynx"
printf "%b\n" "----------------------------"
printf "%b\n" "Enter your choices (e.g., 1 3 5): "
printf "%b" "Enter your choices (e.g. 1 3 5): "
read -r choice
for ch in $choice; do
case $ch in
Expand Down
2 changes: 1 addition & 1 deletion core/tabs/applications-setup/dwmtitus-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ setupDWM() {
"$ESCALATION_TOOL" "$PACKAGER" install -y libX11-devel libXinerama-devel libXft-devel imlib2-devel libxcb-devel unzip flameshot lxappearance feh # no need to include git here as it should be already installed via "Development Tools"
;;
*)
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;;
esac
Expand Down
2 changes: 1 addition & 1 deletion core/tabs/applications-setup/linutil-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ installLinutil() {
;;
*)
printf "%b\n" "${RED}There are no official packages for your distro.${RC}"
printf "%b" "${YELLOW}Do you want to install the crates.io package? (y/N) ${RC}"
printf "%b" "${YELLOW}Do you want to install the crates.io package? (y/N): ${RC}"
read -r choice
case $choice in
y|Y)
Expand Down
2 changes: 1 addition & 1 deletion core/tabs/applications-setup/mybash-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ installDepend() {
"$ESCALATION_TOOL" "$PACKAGER" install -y bash bash-completion tar bat tree unzip fontconfig git
;;
*)
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}" # The packages above were grabbed out of the original mybash-setup-script.
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;;
esac
Expand Down
34 changes: 18 additions & 16 deletions core/tabs/applications-setup/office-suite-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ install_onlyoffice() {
"$AUR_HELPER" -S --needed --noconfirm onlyoffice
;;
*)
printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}"
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;;
esac
else
Expand All @@ -30,20 +31,20 @@ install_libreoffice() {
printf "%b\n" "${YELLOW}Installing Libre Office...${RC}"
if ! command_exists libreoffice; then
case "$PACKAGER" in
apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y libreoffice-core
;;
zypper|dnf)
. ./setup-flatpak.sh
flatpak install -y flathub org.libreoffice.LibreOffice
;;
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm libreoffice-fresh
;;
apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y libreoffice-core
;;
zypper|dnf)
. ./setup-flatpak.sh
flatpak install -y flathub org.libreoffice.LibreOffice
;;
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm libreoffice-fresh
;;
*)
printf "%b\n" "${RED}Unsupported package manager. Please install Thorium manually.${RC}"
exit 1
;;
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;;
esac
else
printf "%b\n" "${GREEN}Libre Office is already installed.${RC}"
Expand Down Expand Up @@ -88,7 +89,8 @@ install_freeoffice() {
"$ESCALATION_TOOL" "$PACKAGER" install -y softmaker-freeoffice-2024
;;
*)
printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}"
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;;
esac
}
Expand Down Expand Up @@ -174,7 +176,7 @@ officeSuiteSetup() {
printf "%b\n" "7. PDF Studio Viewer"
printf "%b\n" "8. PDF Studio (Paid Software)"
printf "%b\n" "----------------------------"
printf "%b\n" "Enter your choices (e.g., 1 3 5): "
printf "%b" "Enter your choices (e.g., 1 3 5): "
read -r choice
for ch in $choice; do
case $ch in
Expand Down
8 changes: 4 additions & 4 deletions core/tabs/applications-setup/setup-flatpak.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ setup_flatpak() {
"$ESCALATION_TOOL" "$PACKAGER" install -S flatpak
;;
*)
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;;
esac
Expand All @@ -50,7 +50,7 @@ setup_flatpak() {
else
if command -v flatpak >/dev/null 2>&1; then
if ! flatpak remotes | grep -q "flathub"; then
printf "%b\n" "${YELLOW}Detected Flatpak package manager but Flathub remote is not added. Would you like to add it? (y/n)${RC}"
printf "%b" "${YELLOW}Detected Flatpak package manager but Flathub remote is not added. Would you like to add it? (y/N): ${RC}"
read -r add_remote
case "$add_remote" in
[Yy]*)
Expand All @@ -70,14 +70,14 @@ setup_flatpak() {
# Only used for Ubuntu GNOME. Ubuntu GNOME doesnt allow flathub to be added as a remote to their store.
# So in case the user wants to use a GUI siftware manager they can setup it here
if [ "$DE" = "GNOME" ]; then
printf "%b\n" "${YELLOW}Detected GNOME desktop environment. Would you like to install GNOME Software plugin for Flatpak? (y/n)${RC}"
printf "%b" "${YELLOW}Detected GNOME desktop environment. Would you like to install GNOME Software plugin for Flatpak? (y/N): ${RC}"
read -r install_gnome
if [ "$install_gnome" = "y" ] || [ "$install_gnome" = "Y" ]; then
"$ESCALATION_TOOL" "$PACKAGER" install -y gnome-software-plugin-flatpak
fi
# Useful for Debian KDE spin as well
elif [ "$DE" = "KDE" ]; then
printf "%b\n" "${YELLOW}Detected KDE desktop environment. Would you like to install KDE Plasma Discover backend for Flatpak? (y/n)${RC}"
printf "%b" "${YELLOW}Detected KDE desktop environment. Would you like to install KDE Plasma Discover backend for Flatpak? (y/N): ${RC}"
read -r install_kde
if [ "$install_kde" = "y" ] || [ "$install_kde" = "Y" ]; then
"$ESCALATION_TOOL" "$PACKAGER" install -y plasma-discover-backend-flatpak
Expand Down
2 changes: 1 addition & 1 deletion core/tabs/applications-setup/zsh-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RPROMPT='%F{15}(%F{166}%D{%H:%M}%F{15})%f'
EOL

# Ensure /etc/zsh/zshenv sets ZDOTDIR to the user's config directory
echo 'export ZDOTDIR="$HOME/.config/zsh"' | "$ESCALATION_TOOL" tee -a /etc/zsh/zshenv
echo "export ZDOTDIR=\"$HOME/.config/zsh\"" | "$ESCALATION_TOOL" tee -a /etc/zsh/zshenv
}

checkEnv
Expand Down
38 changes: 19 additions & 19 deletions core/tabs/gaming/diablo-ii/d2r-loot-filters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
# Check for required commands
for cmd in find curl unzip stty; do
if ! command -v "$cmd" >/dev/null 2>&1; then
printf "%s\n" "Error: $cmd is not installed."
printf "%b\n" "Error: $cmd is not installed."
exit 1
fi
done

# Search for possible Diablo II Resurrected folder locations
printf "%s\n" "Searching for Diablo II Resurrected folders..."
printf "%b\n" "Searching for Diablo II Resurrected folders..."
possible_paths=$(find "$HOME" -type d -path "*/drive_c/Program Files (x86)/Diablo II Resurrected" 2>/dev/null)

if [ -z "$possible_paths" ]; then
printf "%s\n" "Error: No Diablo II Resurrected folders found."
printf "%b\n" "Error: No Diablo II Resurrected folders found."
exit 1
fi

# Display possible paths and allow selection
printf "%s\n" "Possible Diablo II Resurrected folder locations:"
printf "%b\n" "Possible Diablo II Resurrected folder locations:"
paths_string=""
i=0
IFS='
Expand All @@ -42,7 +42,7 @@ print_menu() {
if [ $((start + max_display)) -gt $total ]; then start=$((total - max_display)); fi
if [ $start -lt 0 ]; then start=0; fi

printf "%s\n" "Please select the Diablo II: Resurrected installation path:"
printf "%b\n" "Please select the Diablo II: Resurrected installation path:"
i=0
echo "$paths_string" | tr '|' '\n' | while IFS= read -r path; do
if [ $i -ge $start ] && [ $i -lt $((start + max_display)) ]; then
Expand Down Expand Up @@ -95,7 +95,7 @@ select_path

# Validate the path
if [ ! -d "$d2r_path" ]; then
printf "%s\n" "Error: The specified path does not exist."
printf "%b\n" "Error: The specified path does not exist."
exit 1
fi

Expand All @@ -104,29 +104,29 @@ mods_path="$d2r_path/mods"
mkdir -p "$mods_path"

# Download the latest release
printf "%s\n" "Downloading the latest loot filter..."
printf "%b\n" "Downloading the latest loot filter..."
if ! curl -sSLo /tmp/lootfilter.zip https://github.com/ChrisTitusTech/d2r-loot-filter/releases/latest/download/lootfilter.zip; then
printf "%s\n" "Error: Failed to download the loot filter."
printf "%b\n" "Error: Failed to download the loot filter."
exit 1
fi

# Extract the contents to the mods folder
printf "%s\n" "Extracting loot filter to $mods_path..."
printf "%b\n" "Extracting loot filter to $mods_path..."
if ! unzip -q -o /tmp/lootfilter.zip -d "$mods_path"; then
printf "%s\n" "Error: Failed to extract the loot filter."
printf "%b\n" "Error: Failed to extract the loot filter."
exit 1
fi

# Clean up
rm /tmp/lootfilter.zip

printf "%s\n" "Loot filter installed successfully in $mods_path"
printf "%b\n" "Loot filter installed successfully in $mods_path"

printf "\nTo complete the setup, please follow these steps to add launch options in Battle.net:\n"
printf "1. Open the Battle.net launcher\n"
printf "2. Select Diablo II: Resurrected\n"
printf "3. Click the gear icon next to the 'Play' button\n"
printf "4. Select 'Game Settings'\n"
printf "5. In the 'Additional command line arguments' field, enter: -mod lootfilter -txt\n"
printf "6. Click 'Done' to save the changes\n"
printf "\nAfter completing these steps, launch Diablo II: Resurrected through Battle.net to use the loot filter.\n"
printf "%b\n" "To complete the setup, please follow these steps to add launch options in Battle.net:"
printf "%b\n" "1. Open the Battle.net launcher"
printf "%b\n" "2. Select Diablo II: Resurrected"
printf "%b\n" "3. Click the gear icon next to the 'Play' button"
printf "%b\n" "4. Select 'Game Settings'"
printf "%b\n" "5. In the 'Additional command line arguments' field, enter: -mod lootfilter -txt"
printf "%b\n" "6. Click 'Done' to save the changes"
printf "%b\n" "After completing these steps, launch Diablo II: Resurrected through Battle.net to use the loot filter."
2 changes: 1 addition & 1 deletion core/tabs/system-setup/arch/paru-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ installDepend() {
fi
;;
*)
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
;;
esac
}
Expand Down
2 changes: 1 addition & 1 deletion core/tabs/system-setup/arch/yay-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ installDepend() {
fi
;;
*)
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
;;
esac
}
Expand Down
6 changes: 3 additions & 3 deletions core/tabs/system-setup/compile-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ installDepend() {
"$ESCALATION_TOOL" "$PACKAGER" update
"$ESCALATION_TOOL" dpkg --add-architecture i386
"$ESCALATION_TOOL" "$PACKAGER" update
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES $COMPILEDEPS
"$ESCALATION_TOOL" "$PACKAGER" install -y "$DEPENDENCIES" "$COMPILEDEPS"
;;
dnf)
COMPILEDEPS='@development-tools'
Expand All @@ -34,11 +34,11 @@ installDepend() {
zypper)
COMPILEDEPS='patterns-devel-base-devel_basis'
"$ESCALATION_TOOL" "$PACKAGER" refresh
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install "$DEPENDENCIES" $COMPILEDEPS
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install "$DEPENDENCIES" "$COMPILEDEPS"
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install libgcc_s1-gcc7-32bit glibc-devel-32bit
;;
*)
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES # Fixed bug where no packages found on debian-based
"$ESCALATION_TOOL" "$PACKAGER" install -y "$DEPENDENCIES"
;;
esac
}
Expand Down
Loading

0 comments on commit cca2660

Please sign in to comment.