2024-07-23 22:14:17 +01:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
2024-08-15 07:13:56 +01:00
|
|
|
. ../common-script.sh
|
2024-07-28 16:32:05 +01:00
|
|
|
|
2024-07-23 22:14:17 +01:00
|
|
|
install_theme_tools() {
|
2024-07-25 23:01:11 +01:00
|
|
|
printf "${YELLOW}Installing theme tools (qt6ct and kvantum)...${RC}\n"
|
2024-07-23 22:14:17 +01:00
|
|
|
case $PACKAGER in
|
|
|
|
apt-get)
|
2024-08-23 14:12:47 +01:00
|
|
|
$ESCALATION_TOOL apt-get update
|
|
|
|
$ESCALATION_TOOL apt-get install -y qt6ct kvantum
|
2024-07-23 22:14:17 +01:00
|
|
|
;;
|
|
|
|
zypper)
|
2024-08-23 14:12:47 +01:00
|
|
|
$ESCALATION_TOOL zypper refresh
|
|
|
|
$ESCALATION_TOOL zypper --non-interactive install qt6ct kvantum
|
2024-07-23 22:14:17 +01:00
|
|
|
;;
|
|
|
|
dnf)
|
2024-08-23 14:12:47 +01:00
|
|
|
$ESCALATION_TOOL dnf update
|
|
|
|
$ESCALATION_TOOL dnf install -y qt6ct kvantum
|
2024-07-23 22:14:17 +01:00
|
|
|
;;
|
|
|
|
pacman)
|
2024-08-23 14:12:47 +01:00
|
|
|
$ESCALATION_TOOL pacman -S --needed --noconfirm qt6ct kvantum
|
2024-07-23 22:14:17 +01:00
|
|
|
;;
|
|
|
|
*)
|
2024-07-25 23:01:11 +01:00
|
|
|
printf "${RED}Unsupported package manager. Please install qt6ct and kvantum manually.${RC}\n"
|
2024-07-23 22:14:17 +01:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
configure_qt6ct() {
|
2024-07-25 23:01:11 +01:00
|
|
|
printf "${YELLOW}Configuring qt6ct...${RC}\n"
|
2024-07-23 22:14:17 +01:00
|
|
|
mkdir -p "$HOME/.config/qt6ct"
|
|
|
|
cat <<EOF > "$HOME/.config/qt6ct/qt6ct.conf"
|
|
|
|
[Appearance]
|
|
|
|
style=kvantum
|
|
|
|
color_scheme=default
|
|
|
|
icon_theme=breeze
|
|
|
|
EOF
|
2024-07-25 23:01:11 +01:00
|
|
|
printf "${GREEN}qt6ct configured successfully.${RC}\n"
|
|
|
|
|
|
|
|
# Add QT_QPA_PLATFORMTHEME to /etc/environment
|
|
|
|
if ! grep -q "QT_QPA_PLATFORMTHEME=qt6ct" /etc/environment; then
|
|
|
|
printf "${YELLOW}Adding QT_QPA_PLATFORMTHEME to /etc/environment...${RC}\n"
|
2024-08-23 14:12:47 +01:00
|
|
|
echo "QT_QPA_PLATFORMTHEME=qt6ct" | $ESCALATION_TOOL tee -a /etc/environment > /dev/null
|
2024-07-25 23:01:11 +01:00
|
|
|
printf "${GREEN}QT_QPA_PLATFORMTHEME added to /etc/environment.${RC}\n"
|
|
|
|
else
|
|
|
|
printf "${GREEN}QT_QPA_PLATFORMTHEME already set in /etc/environment.${RC}\n"
|
|
|
|
fi
|
2024-07-23 22:14:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
configure_kvantum() {
|
2024-07-25 23:01:11 +01:00
|
|
|
printf "${YELLOW}Configuring Kvantum...${RC}\n"
|
2024-07-23 22:14:17 +01:00
|
|
|
mkdir -p "$HOME/.config/Kvantum"
|
|
|
|
cat <<EOF > "$HOME/.config/Kvantum/kvantum.kvconfig"
|
|
|
|
[General]
|
|
|
|
theme=Breeze
|
|
|
|
EOF
|
2024-07-25 23:01:11 +01:00
|
|
|
printf "${GREEN}Kvantum configured successfully.${RC}\n"
|
2024-07-23 22:14:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
checkEnv
|
2024-08-23 14:12:47 +01:00
|
|
|
checkEscalationTool
|
2024-07-23 22:14:17 +01:00
|
|
|
install_theme_tools
|
|
|
|
configure_qt6ct
|
2024-07-28 16:32:05 +01:00
|
|
|
configure_kvantum
|