[feature] check for check for plasma-workspace (in progress 4)

This commit is contained in:
Christian Schendel 2025-12-08 10:55:57 +00:00
parent 7d29b4e766
commit c450c07913
Signed by: doppelhelix
GPG key ID: 5874D2437CD5BBB3

View file

@ -74,6 +74,17 @@ if ! command -v gsettings >/dev/null 2>&1; then
echo -e "${red}==> ERROR:${all_off}${bold} ${mesg}${all_off}"
exit 1
fi
if ! command -v /usr/lib/plasma-changeicons >/dev/null 2>&1; then
notify-send \
'Missing dependency' \
'plasma-changeicons not found.\nPlease install plasma-workspace.' \
-h string:x-canonical-private-synchronous:sys-notify \
-u critical \
-i dialog-error
mesg="plasma-workspace is required to use this script."
echo -e "${red}==> ERROR:${all_off}${bold} ${mesg}${all_off}"
exit 1
fi
check_config() {
if [[ ! -f $default_config_file ]]; then
@ -154,6 +165,7 @@ _set_theme() {
gsettings set org.gnome.desktop.interface color-scheme "$gtk_color_scheme"
gsettings set org.gnome.desktop.interface gtk-theme "$gtk_theme"
gsettings set org.gnome.desktop.interface icon-theme "$icon_theme"
/usr/lib/plasma-changeicons "$icon_theme" >/dev/null 2>&1
## GTK2
if [[ -w "$HOME/.gtkrc-2.0" ]]; then
@ -195,10 +207,6 @@ _set_theme() {
sed -i "s,color_scheme_path=.*,color_scheme_path=$qt_color_scheme_path,g" \
"$HOME/.config/qt6ct/qt6ct.conf"
fi
## workaround if plasma-workspace is installed
if [ -x "$(command -v /usr/lib/plasma-changeicon)" ]; then
/usr/lib/plasma-changeicons "$icon_theme"
fi
}
switch-dark-light() {