[lug] Making QT apps follow GTK style

Jed S. Baer blug at jbaer.cotse.net
Sun Aug 1 13:48:03 MDT 2021


Posting this here as part of my distributed memory architecture - if I
forget, I might remember I e-mailed it to the list. Maybe it'll help
someone else too.

I mostly run GTK apps, but I have a few things I like which use Qt, and
they've never followed my theme. Last time I looked for this, I struck out,
but today the search-Fu deities came through. A few things combined from
StackOverflow and the Arch wiki got me to the 2 packages needed and other
steps.

Install: qt5ct, qt5-style-plugins

And, how you accomplish these two things will vary:
  export QT_QPA_PLATFORMTHEME=qt5ct
  unset QT_STYLE_OVERRIDE

In my case, QT_QPA_PLATFORMTHEME is in
  /etc/X11/Xsession.d/99qt5ct and
  /etc/profile.d/mate-qt.sh

For good measure, I also set it in ~/.materc and in my .bashrc

QT_STYLE_OVERRIDE was odd. I couldn't find anywhere it was set for my
session, but qt5ct complained it was set to the wrong value. The way I got
rid of that was to set it to a null string, run qt5ct and exit, then unset
it. But I put an unset in my .bashrc just in case.

I don't know the full scope of what qt5ct will do, but from what I've read,
you can get GTK2 or GTK3 theming. YMMV, of course.
-- 
All operating systems suck, but Linux just sucks less
 - Linus Torvalds


More information about the LUG mailing list