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-09-22 17:01:10 +01:00
|
|
|
printf "%b\n" "${YELLOW}Installing theme tools (qt6ct and kvantum)...${RC}"
|
2024-09-17 13:23:23 +01:00
|
|
|
case "$PACKAGER" in
|
2024-09-16 15:04:15 +01:00
|
|
|
apt-get|nala)
|
2024-09-19 01:03:32 +01:00
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" install -y qt6ct kvantum
|
2024-07-23 22:14:17 +01:00
|
|
|
;;
|
|
|
|
zypper)
|
2024-09-19 01:03:32 +01:00
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install qt6ct kvantum
|
2024-07-23 22:14:17 +01:00
|
|
|
;;
|
|
|
|
dnf)
|
2024-09-19 01:03:32 +01:00
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" install -y qt6ct kvantum
|
2024-07-23 22:14:17 +01:00
|
|
|
;;
|
|
|
|
pacman)
|
2024-09-19 01:03:32 +01:00
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm qt6ct kvantum
|
2024-07-23 22:14:17 +01:00
|
|
|
;;
|
2024-10-13 02:42:34 +01:00
|
|
|
apk)
|
2024-10-13 14:00:02 +01:00
|
|
|
alpine_version=$(grep . /etc/alpine-release | cut -d . -f 2)
|
|
|
|
if [ "$alpine_version" -le 20 ]; then
|
|
|
|
printf "%b\n" "${RED}Only available in edge release of alpine linux${RC}"
|
|
|
|
exit 1
|
|
|
|
fi
|
2024-10-13 02:42:34 +01:00
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" add qt6ct kvantum
|
|
|
|
;;
|
2024-07-23 22:14:17 +01:00
|
|
|
*)
|
2024-09-22 17:01:10 +01:00
|
|
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
2024-07-23 22:14:17 +01:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2024-09-23 00:32:59 +01:00
|
|
|
applyTheming() {
|
|
|
|
printf "%b\n" "${YELLOW}Applying global theming...${RC}"
|
|
|
|
case "$XDG_CURRENT_DESKTOP" in
|
|
|
|
KDE)
|
|
|
|
lookandfeeltool -a org.kde.breezedark.desktop
|
|
|
|
successOutput
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
GNOME)
|
|
|
|
gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark"
|
|
|
|
gsettings set org.gnome.desktop.interface icon-theme "Adwaita"
|
|
|
|
successOutput
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2024-07-23 22:14:17 +01:00
|
|
|
configure_qt6ct() {
|
2024-09-22 17:01:10 +01:00
|
|
|
printf "%b\n" "${YELLOW}Configuring qt6ct...${RC}"
|
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-09-22 17:01:10 +01:00
|
|
|
printf "%b\n" "${GREEN}qt6ct configured successfully.${RC}"
|
2024-07-25 23:01:11 +01:00
|
|
|
|
|
|
|
# Add QT_QPA_PLATFORMTHEME to /etc/environment
|
|
|
|
if ! grep -q "QT_QPA_PLATFORMTHEME=qt6ct" /etc/environment; then
|
2024-09-22 17:01:10 +01:00
|
|
|
printf "%b\n" "${YELLOW}Adding QT_QPA_PLATFORMTHEME to /etc/environment...${RC}"
|
2024-09-19 01:03:32 +01:00
|
|
|
echo "QT_QPA_PLATFORMTHEME=qt6ct" | "$ESCALATION_TOOL" tee -a /etc/environment > /dev/null
|
2024-09-22 17:01:10 +01:00
|
|
|
printf "%b\n" "${GREEN}QT_QPA_PLATFORMTHEME added to /etc/environment.${RC}"
|
2024-07-25 23:01:11 +01:00
|
|
|
else
|
2024-09-22 17:01:10 +01:00
|
|
|
printf "%b\n" "${GREEN}QT_QPA_PLATFORMTHEME already set in /etc/environment.${RC}"
|
2024-07-25 23:01:11 +01:00
|
|
|
fi
|
2024-07-23 22:14:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
configure_kvantum() {
|
2024-09-23 00:32:59 +01:00
|
|
|
printf "%b\n" "${YELLOW}Configuring Kvantum...${RC}"
|
2024-07-23 22:14:17 +01:00
|
|
|
mkdir -p "$HOME/.config/Kvantum"
|
|
|
|
cat <<EOF > "$HOME/.config/Kvantum/kvantum.kvconfig"
|
|
|
|
[General]
|
2024-09-23 00:32:59 +01:00
|
|
|
theme=KvArcDark
|
2024-07-23 22:14:17 +01:00
|
|
|
EOF
|
2024-09-22 17:01:10 +01:00
|
|
|
printf "%b\n" "${GREEN}Kvantum configured successfully.${RC}"
|
2024-07-23 22:14:17 +01:00
|
|
|
}
|
|
|
|
|
2024-09-23 00:32:59 +01:00
|
|
|
successOutput() {
|
|
|
|
printf "%b\n" "${GREEN}Global theming applied successfully.${RC}"
|
|
|
|
}
|
|
|
|
|
2024-07-23 22:14:17 +01:00
|
|
|
checkEnv
|
2024-08-23 14:12:47 +01:00
|
|
|
checkEscalationTool
|
2024-09-23 00:32:59 +01:00
|
|
|
applyTheming
|
2024-07-23 22:14:17 +01:00
|
|
|
install_theme_tools
|
|
|
|
configure_qt6ct
|
2024-07-28 16:32:05 +01:00
|
|
|
configure_kvantum
|
2024-09-23 00:32:59 +01:00
|
|
|
successOutput
|