24.10 - How to get Konsole to use system theme?

As an experiment, I’m trying to set up Lubuntu 24.10 similar to how I have Xubuntu 22.04 set up. This includes using Konsole as terminal emulator, and the system Qt theme is set to Oxygen via qt5ct.

qt5ct and qt6ct are both installed and working in the 24.10 system, and both are set to Oxygen Qt theme. Most Qt apps (e.g. QTerminal and ScreenGrab) are successfully using the Oxygen theme. However, Konsole seems to be stuck on using the Breeze Qt theme?

This happens regardless of whether logging into Xfce (Xubuntu session) or LXQt session.

Konsole is installed from standard Ubuntu 24.10 repositories:

$ apt-cache policy konsole
konsole:
  Installed: 4:24.08.1-0ubuntu1
  Candidate: 4:24.08.1-0ubuntu1
  Version table:
 *** 4:24.08.1-0ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu oracular/universe amd64 Packages
        100 /var/lib/dpkg/status

On an Arch Linux system, I have Konsole 24.08.3 and Xfce desktop, and there Konsole has always used the qt6ct-set Oxygen theme without issue.

Konsole does use the qt6ct-selected font, just not the Qt theme: it continues using Breeze even when picking a different Qt theme e.g. Fusion.

How to get Konsole on Ubuntu 24.10 to use the configured qt6ct theme?

1 Like

@halogen2 how the heck are you? Now my effort to help.
This is what I use .bashrc

export GTK_THEME=MyFavoriteTheme

After that (log out/in)

I also have these installed

apt search qt6 theme|grep installed

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

qt6-gtk-platformtheme/noble,noble,noble,now 6.8.0-0zneon+24.04+noble+release+build17 all [installed,automatic]
1 Like

Hi @1fallen good to see you back in the Ubuntu community! :slight_smile:

Oops, forgot to note a couple details:

  1. I prefer different themes for Gtk apps (Greybird) and Qt apps (Oxygen).

  2. The Qt theme is being set by this code in ~/.profile -

  if [ x"$XDG_CURRENT_DESKTOP" != x'KDE' ];then
    if which qt6ct 2>/dev/null >/dev/null;then
      export QT_QPA_PLATFORMTHEME="qt5ct:qt6ct"
    elif which qt5ct 2>/dev/null >/dev/null;then
      export QT_QPA_PLATFORMTHEME="qt5ct"
    fi
  fi

And that part seems to be working -

$ env | grep -F QT
QT_ACCESSIBILITY=1
QT_QPA_PLATFORMTHEME=qt5ct:qt6ct

This issue isn’t happening for me in 24.04.

Dang I just never had a good experience with ~/.profile without installing qt5 themes or qt6 themes
On 24.10, I had better outcomes in " /etc/environment " with my exports.

I have to defer to someone else then.

EDIT: Also have a look in:

ls ~/.local/share/konsole/
 Breeze.colorscheme  'Profile 1.profile'

Well this turned out to be quite a rabbit hole. After getting very unexpected results when testing this in Kubuntu 24.10 live CD environment, ended up digging into source code and think I may have figured it out:

Konsole now has an optional build-time dependency on something called KStyleManager. If I’m understanding its code correctly, this component overrides the Qt style when QT_QPA_PLATFORMTHEME is not set to exactly kde: it applies configuration from ~/.config/kdeglobals, or falls back to applying the Breeze style, regardless of the setting of QT_QPA_PLATFORMTHEME.

So one solution is to insert the following text into ~/.config/kdeglobals -

[General]
widgetStyle=qt6ct-style

Another solution is to not have the Breeze Qt theme installed (this is why I didn’t have this issue in Arch Linux). Lubuntu 24.10 has the Breeze theme installed by default, so that involves sudo apt purge kde-style-breeze.

If I’m understanding correctly, the reasoning behind this KStyleManager behavior was supposed to be to help avoid weird theming issues in non-KDE environments (particularly related to icons). I haven’t noticed any issues with my current preferred combination of Oxygen style + Breeze icon theme, but now that I know this I’ll keep an eye out.

3 Likes