linutil/core/tabs/system-setup/global-theme.sh
Nyx cca2660c3b
fix every issue related to printf (#596)
* 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 <adas1per@protonmail.com>

* fix extra comma

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* change to ()

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* change to ()

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* change to ()

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* change to ()

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* remove extra comma

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* remove "please"

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* add support for caps

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* add support for caps

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* add support for caps

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

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

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* add an extra quote

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* add extra quotes

* fix remaining sn

* fix remaining new lines

---------

Co-authored-by: nnyyxxxx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-09-22 11:01:10 -05:00

63 lines
1.8 KiB
Bash

#!/bin/sh -e
. ../common-script.sh
install_theme_tools() {
printf "%b\n" "${YELLOW}Installing theme tools (qt6ct and kvantum)...${RC}"
case "$PACKAGER" in
apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y qt6ct kvantum
;;
zypper)
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install qt6ct kvantum
;;
dnf)
"$ESCALATION_TOOL" "$PACKAGER" install -y qt6ct kvantum
;;
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm qt6ct kvantum
;;
*)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;;
esac
}
configure_qt6ct() {
printf "%b\n" "${YELLOW}Configuring qt6ct...${RC}"
mkdir -p "$HOME/.config/qt6ct"
cat <<EOF > "$HOME/.config/qt6ct/qt6ct.conf"
[Appearance]
style=kvantum
color_scheme=default
icon_theme=breeze
EOF
printf "%b\n" "${GREEN}qt6ct configured successfully.${RC}"
# Add QT_QPA_PLATFORMTHEME to /etc/environment
if ! grep -q "QT_QPA_PLATFORMTHEME=qt6ct" /etc/environment; then
printf "%b\n" "${YELLOW}Adding QT_QPA_PLATFORMTHEME to /etc/environment...${RC}"
echo "QT_QPA_PLATFORMTHEME=qt6ct" | "$ESCALATION_TOOL" tee -a /etc/environment > /dev/null
printf "%b\n" "${GREEN}QT_QPA_PLATFORMTHEME added to /etc/environment.${RC}"
else
printf "%b\n" "${GREEN}QT_QPA_PLATFORMTHEME already set in /etc/environment.${RC}"
fi
}
configure_kvantum() {
printf "%b\n" "${YELLOW}Configuring Kvantum...${RC}\n"
mkdir -p "$HOME/.config/Kvantum"
cat <<EOF > "$HOME/.config/Kvantum/kvantum.kvconfig"
[General]
theme=Breeze
EOF
printf "%b\n" "${GREEN}Kvantum configured successfully.${RC}"
}
checkEnv
checkEscalationTool
install_theme_tools
configure_qt6ct
configure_kvantum