[wiki] Set All Qt app's to use your GTK+ theme & font settings:

Are you sure of your modifications?

From man environment :

The /etc/environment file specifies the environment variables to be set. The file must consist of simple NAME=VALUE pairs on separate lines.

Yep, I’m sure in that it works. :slight_smile:

1 Like

Heres a gathering of info, which leads me to believe the wiki should be edited again.

Global configuration files of your shell, initializes variables and runs scripts.

So export should only be used in things like /etc/profile

Instead in /etc/environment we would use just

QT_QPA_PLATFORMTHEME=qt5ct
QT_AUTO_SCREEN_SCALE_FACTOR=0

The difference is also important, because

/etc/profile initializes variables for login shells only

and also

The dbus daemon and the user instance of systemd do not inherit any of the environment variables set in places like ~/.bashrc etc. This means that, for example, dbus activated programs like Gnome Files will not use them by default

So.
With as systemd is default in manjaro if we want to do this per-user, no root required, and fully recognized we could issue the variables somehwere like
~/.config/environment.d/qtusegtk.conf
In which case we would again use the name=value (no export) convention.

https://wiki.archlinux.org/index.php/Environment_variable
https://wiki.archlinux.org/index.php/Systemd/User#Environment_variables
https://jlk.fjfi.cvut.cz/arch/manpages/man/environment.d.5

1 Like

@cscs Please change the wiki to suit systemd better? I said in the wiki &/or in the wiki support page that this works fine for Artix (no systemd) & that it may be bit soon upgrade wise for Manjaro (when I wrote the wiki page as Artix is usually ahead of Manjaro in its upgrades from Arch) & that any specific changes that need to be made to suit Manjaro (if any) will be made when discovered. :slight_smile:

So go for it cscs (I only know what I know, & what I can test myself). :slight_smile:

I still wanted your go-ahead :wink:

1 Like

@handy could you convert your first post to wiki so it can be edited, please?
Or copy (this is wikified) and paste the following just to have the info included here as well.
I just tested how easy/difficult is copying from wiki.manjaro to the forum wiki/tutorial topics.
I find it pretty easy. I have also created a kind-of TOC to try unifying the two sites. Am I moving too fast? :thinking:


This fix makes your Qt app’s use your GTK+ theme (colours & such) & your chosen font settings.


How do you do it?

  1. Install qt5ct
  2. Set environment variables in /etc/environment and add the following lines:
export QT_QPA_PLATFORMTHEME=qt5ct
export QT_AUTO_SCREEN_SCALE_FACTOR=0
  1. Restart the system
  2. Start qt5ct
  3. In the first tab Appearance choose Standard Dialogs: default (some people get crashes if they choose GTK3)

Because we used /etc/environment to set the environment variables back in step 2), after you reboot, both the user & root accounts will be able to benefit from these changes.

(If you find that certain widget styles are missing, you can see if qt5-styleplugins brings a fix for you.)

1 Like

@AgentS I learned some years back, not to have two pages with the wiki info’ on it. If only the wiki has the info’ then only the wiki has to be maintained. That is the long & the short of it.

You’ll find that all of the support pages that I have connected to the wiki page, only give a heads up of what’s on the wiki page & thereafter any changes get notified (one way or the other) in the support page, so that people in the forum know that there has been a change in the wiki.

Does that make sense?

More than perfect and I more than absolutely agree!
What about…

It’s on the same spirit, IMHO.

If every wiki page had a Support page here in the forum, then any changes to the wiki, or errors, updates needed… posts could be put into that Support page here in the forum. That way the community knows about updates, & the wiki maintainers know about the need to create an update.

Having such support pages imho is the ideal interface between the forum & the wiki.

The wiki needs to be used; to use the wiki, you go there & use it. Diffusing the wiki with the same info’ in more than one place doesn’t make sense to me.

I don’t really understand what you are doing by making an index of the wiki on the forum. Are you going to have a copy of the wiki index here on the forum where people select a heading/link & go to the wiki?

If so, that sounds like a lot of work. Wouldn’t a link to the wiki on the forum be enough?

I set environment with this wiki but I have some qt scaling problems (vlc, and other qt based apps). I find solution. Wiki need just a little bit change. When I change this line
export QT_QPA_PLATFORMTHEME=qt5ct
to this
export QT_QPA_PLATFORMTHEME=“qt5ct”
my qt scaling problems solved :wink: Please change this wiki page
Best regards

I wonder if this was the actual reason, but since it doesn’t hurt, I added the quotation marks in the wiki. :slight_smile:

For the record, my instance has no quotation marks.

Configuration of Qt5 apps under environments other than KDE Plasma

Unlike Qt4, Qt5 doesn’t ship a qtconfig utility to configure fonts, icons or styles. Instead, it will try to use the settings from the running DE. In KDE Plasma or GNOME this works well, but in other less popular DEs or WM it can lead to missing icons in Qt5 applications. One way to solve this is to fake the running desktop environment by setting XDG_CURRENT_DESKTOP=KDE or GNOME, and then using the corresponding configuration application to set the desired icon set.

Another solution is provided by the qt5ct package, which provides a DE independent Qt5 QPA and a configuration utility. After installing the package, run qt5ct to set an icon theme, and set the environment variable QT_QPA_PLATFORMTHEME=“qt5ct” so that the settings are picked up by Qt applications. Alternatively, use --platformtheme qt5ct as argument to the Qt5 application.

To automatically set QT_QPA_PLATFORMTHEME for user session, add the following line to ~/.xprofile.

[ “$XDG_CURRENT_DESKTOP” = “KDE” ] || [ “$XDG_CURRENT_DESKTOP” = “GNOME” ] || export QT_QPA_PLATFORMTHEME=“qt5ct”

Neither does mine. :slight_smile:

So the Arch wiki is wrong then I think not.

According to ArchWiki it is
QT_QPA_PLATFORMTHEME="qt5ct"

I looked here: https://github.com/RomanVolak/qt5ct

qt5ct
qt5ct - Qt5 Configuration Tool

This program allows users to configure Qt5 settings (theme, font, icons, etc.) under DE/WM without Qt integration.

Official home page: https://sourceforge.net/projects/qt5ct/

Requirements:

GNU Linux or FreeBSD
qtbase >= 5.4.0
qtsvg >= 5.4.0 (For svg icons)
qttools >= 5.4.0 (For build only)
Installation:

qmake PREFIX= make make install (under root)

Add line 'export QT_QPA_PLATFORMTHEME=qt5ct' to ~/.profile and re-login.

Extra build options (for advanced users only): qmake DISABLE_WIDGETS=1 - compiles platform plugin without QtWidgets (useful only for QML applications) qmake PLUGINDIR= - changes a path of the platform plugin (libqt5ct.so)

Files and directories:

qt5ct - Qt5 configuration tool libqt5ct.so - qt5ct platform plugin ~/.config/qt5ct/qt5ct.conf - configuration file ~/.config/qt5ct/qss/ - style sheets

Oh, while you guys are here, I’ve noticed that someone has been marking wiki pages (mine at least) saying that things are out of date (in so many words). Why on earth doesn’t that person use the link at the bottom of the wiki page - the Support link - & notify me (or someone) here in the forum, so the error can be fixed?

Personally I think that it is a stupid & inefficient thing to do. As it tells future readers not to trust the page, but does absolutely nothing re. solving the problem.

Handy how sad is that it never ceases to amaze me lately how callas some users are, Lol :grinning:

YOU go chase your tail @mandog!

Wow Wow That was not aimed at you that was sympathy for you I know how much you have put into the Wiki come on do you really think i’d insult you like that.

Forum kindly sponsored by Bytemark