Gnome Sotware is not compatible with Cinnamon system theme

Gnome Software and a few other gnome applications are not using my Cinnamon system theme. Others on the other hand are using it. :point_down:

How can I fix this?

GNOME apps do not support theming, and are designed with different guidelines in mind compared to Cinnamon apps. Linux Mint comes with its own set of apps and applets that do what these apps do (e.g. a software manager), I’d advise you to use those instead

The problem is that Cairo Dock doesn’t work well with Linux Mint. Plus, I prefer Fedora over Debian. It is a lot more stable for me. Since it is only a few apps, I can deal with it. Maybe in the future, someone will figure out how to deal with this tiny issue.

Cairo Dock appears to be unmaintained, I suggest to either find someone to begin maintaining it again or switch to something else.

They do support themeing. You can download any theme that has GTK4 support (or implement your own if you know how to) and then define a global variable “GTK_THEME” in either ~/.bash-profile or /etc/enviroment
Currently my ~/.bash-profile has this entry in it:
export GTK_THEME=Fluent-Dark

and the theme works for both GTK3 and GTK4 perfectly (as it supports) both. I can also theme my qt apps with qt5ct and quantum. And everything works with both system and flatpak application thanks to some flatpak exports I have. Here is the current script I have for the GTK theme. I’m planning on adding qt5ct support to it too, as well as support for some special application that require their own css files in the future.

#!/bin/bash

####################################################
# WELCOME

echo "##################################################"
echo "Only works if themes are in ~/.local/share/themes"
echo "Each theme must have a gtk-4.0 folder to be listed"
echo "##################################################"
echo ""
echo "List current theme for root user? y/N"
read suin
suin=$(echo "$suin" | xargs) # trim
suin=$(echo "$suin" | tr '[:upper:]' '[:lower:]') # lower case
echo ""
echo "CURRENT (LIKELY) USER THEME: $(gsettings get org.gnome.desktop.interface gtk-theme)"
if [[ "$suin" == "y" ]]; then
    echo "CURRENT (LIKELY) ROOT THEME: $(sudo gsettings get org.gnome.desktop.interface gtk-theme)"
fi

####################################################
# INIT / CHECK

[ ! -d "$HOME/.local/share/themes" ] && echo "No themes in $HOME/.local/share/themes" && read -p "PRESS ENTER TO CLOSE" hold && exit

####################################################
# GET VALID THEMES

declare -a validThemeNamesArr=()

for indexThemeDir in $(find "$HOME/.local/share/themes" -type f -name 'index.theme'); do
    themeDir=$(dirname "$indexThemeDir")
    [ ! -d "$themeDir/gtk-4.0" ] && continue # no gtk-4.0 = theme won't be compatible

    themeName=$(basename $themeDir)
    validThemeNamesArr+=("$themeName")
done

validThemeNamesArr=($(printf '%s\n' "${validThemeNamesArr[@]}" | sort)) # sort array
validThemeNamesArr=('Reset' "${validThemeNamesArr[@]}") # add reset as the first option

####################################################
# GET DESIRED THEME USER INPUT

echo ""
echo "SELECT AN OPTION AND CLICK ENTER:"
for ((i=0; i<${#validThemeNamesArr[@]}; i++)); do
    echo "[$i] ${validThemeNamesArr[$i]}"
done

while true; do
    read tuin
    tuin=$(echo "$tuin" | xargs) # trim
    if [[ "$tuin" =~ ^[0-9]+$ && -v validThemeNamesArr[$tuin] ]]; then
        break
    else
        echo "Invalid input, try again."
    fi
done

####################################################
# APPLY THEME

chosenThemeName=${validThemeNamesArr[$tuin]}

# remove previous .bash-profile export - always done
grep -v "export GTK_THEME=" "$HOME/.bash_profile" > tmpfile && mv tmpfile "$HOME/.bash_profile"

if [[ "$tuin" == "0" ]]; then
    gsettings reset org.gnome.desktop.interface gtk-theme
    grep -v "GTK_THEME=" "$HOME/.local/share/flatpak/overrides/global" > tmpfile && mv tmpfile "$HOME/.local/share/flatpak/overrides/global"
    clear
    echo "CUSTOM USER THEME RESET"
    echo "RESTART FOR EVERYTHING TO BE CHANGED"
else
    # gsettings gtk (needed for window decorations in non-flatpak apps)
    gsettings set org.gnome.desktop.interface gtk-theme "$chosenThemeName"

    # add new export
    echo "export GTK_THEME=$chosenThemeName" >> "$HOME/.bash_profile"

    # flatpak
    flatpak override --user --filesystem=xdg-data/themes # only way to give access to /.local/share/themes
    flatpak override --user --env=GTK_THEME="$chosenThemeName"

    echo "CUSTOM USER THEME APPLIED"
    echo "LOGOUT FOR EVERYTHING TO BE CHANGED"
fi

echo "ALSO APPLY TO ROOT USER? y/N"
read suin
suin=$(echo "$suin" | xargs) # trim
suin=$(echo "$suin" | tr '[:upper:]' '[:lower:]') # lower case
if [[ "$suin" == "y" ]]; then
    sudo [ ! -d "/root/.local/share/themes" ] && sudo mkdir -p "/root/.local/share/themes" # create root themes folder if not already there
    sudo [ ! -d "/root/.local/share/themes/$chosenThemeName" ] && sudo cp -r "$HOME/.local/share/themes/$chosenThemeName" "/root/.local/share/themes/$chosenThemeName" # copy chosen theme to root if it's not there
    
    # remove previous .bash-profile export - always done
    sudo grep -v "export GTK_THEME=" "/root/.bash_profile" > tmpfile && sudo mv tmpfile "/root/.bash_profile"
    
    if [[ "$tuin" == "0" ]]; then
        sudo gsettings reset org.gnome.desktop.interface gtk-theme
    else
        # gsettings gtk (needed for window decorations in non-flatpak apps)
        sudo gsettings set org.gnome.desktop.interface gtk-theme "$chosenThemeName"

        # add new export
        echo "export GTK_THEME=$chosenThemeName" | sudo tee --append "/root/.bash_profile" > /dev/null 2>&1
    fi
    
    echo "ROOT ACCOUNT UPDATED"
fi

read -p "PRESS ENTER TO CLOSE" hold

And also I prefer this method of changing themes over anything else. It’s all manual and have full control. Thankfully Fedora doesn’t implement any special theming configs like ubuntu and mint, because I don’t know what they’re doing, and don’t want to guess. Also this method with setting the variable, although not the most robust, in the sense that you have to sign out to take effect, it doesn’t change anytihng in ~/.config/gtk* folders, which I really don’t want happening. I have custom stuff there and setting up a script to edit the gtk3-0 and gtk4-0 css files in those folders manually would be a total pain. I also tried some flatpak application in the past (forgot its name that lets you theme Libadawaita, and I couldn’t even figure it out. I didn’t need to though because it altered the ~/.gtk* folders)

While overriding the stylesheet of GTK apps is technically possible, GNOME still doesn’t have official support for this kind of «theming», as in: if something breaks (which is likely to happen) it’s not considered a bug, and you get to keep both pieces. That’s what I meant with my comment.

1 Like

Inserting random CSS themes into apps is a sure way to break them in strange ways. I have also seen many Qt apps broken by qt5ct and kvantum.

I have said this many times before but, I strongly recommend against trying to use themes like this. Writing giant scripts to hack around this with environment variables is also IMO a bad idea. If the app is not built to be compatible with a theme then that’s simply the way the app is, either you need to fork the app, or use a supported theme.

1 Like

I wasn’t talking about adding full blown themes to individual apps I’m talking about minor stuff. The Geary email client for example doesn’t support making the body of emails dark by default (while of course the rest of the components of the app do follow your theme). You can add file “user-style.css” to either
~/.config/geary/
or
~/.var/app/org.gnome.Geary/config/geary

with the following text

:root, *:not(a) 
{
        color: #eeeeec !important;
        background-color: #353535 !important;
}

and you get dark email body.

As for qt5ct, it’s much better than qgnomeplatform. It’s been working perfectly for me thus far.

1 Like

If there is a bug in the theme in dark mode you should just report that to the app, instead of hacking around it. Also, you should never use !important in CSS for theming. See this tweet for more info: https://twitter.com/stevenpemberton/status/1505839184287870981

Yes Qt themes may work fine, until the app changes, or until you use an app that doesn’t support it properly, then the script falls apart and your only option is to stop using it. I stopped using qt5ct for this very reason. It’s very frustrating when everything appears to be working only for some app to accidentally break your workflow and you have to disrupt everything just to spend hours fixing the theme. It may turn out that the app is just not built for theming and then you will waste even more time trying to make it do that. Many Qt apps are built this way on purpose because they want to ship their own QStyle.

I get the appeal of the whole “hack your own desktop together out of shell scripts” thing, I did that for a while too. Now I wouldn’t recommend it to anybody.

It’s not a bug. Emails are supposed to be the color in which the sender intended (typically white with black text). Geary simply shows you that by default, and the above change forces all emails to have a dark background with white text. The same you would get with the Thunderbird and the “Dark Reader” extension installed. Geary could add this as a feature I guess, but it’s defiantly not a bug.

And just out of curiosity, how do you theme your qt apps then? A small inconsistency, or even a button icon missing is way better than having a dark theme that isn’t applied to everything IMO. I use qt5ct with Kvantum. Set the theme to kvantum in q5ct and in Kvantum manager you can change to a whole bunch of themes. Why does it matter if an app changes? It should still work. If an app changes so much that basic theming procedures don’t work anymore, it’s the app developers fault, and I will probably stop using the app if possible.

By the way what’s with that tweet? I don’t care about what anyone intended, as long as I get my way. :smiley:

If it’s not a bug then it should not be themed because that is what the sender intended, apps should not mess with it. HTML emails will just break if you try to mess with some of the colors but not other ones.

But I would guess if you view the email in text mode then it should respect the dark mode setting, so if that is not a bug already, maybe it would be a good idea to report it.

I don’t theme any apps, in my experience Qt apps are just as broken with custom themes as GTK and GNOME apps, because the apps are simply not built or tested to be used with more than one or two themes.

No, this not how Qt works. There is no “basic theming”, an app can require or not require any style. The styles can even be required per-window or per-widget, this is a built-in feature of Qt. See the QStyle documentation. If I try to mess with this and it breaks everything then it is actually my fault, not the app developer’s fault.

This is even worse, now you are preventing yourself from using whole apps just because of a broken theme.

I hope you don’t mean this. Please don’t celebrate unethical and illegal actions. Maybe you want to edit this comment? No one is try to get in the way, the point is that’s a misuse of the feature that will probably cause things to break even more.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.