Difference between revisions of "Set all Qt app's to use GTK+ font & theme settings"

From Manjaro Linux
Jump to: navigation, search
(How do you do it?)
(replacing restart with source command)
(24 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 +
13-March-2018: Updated contents & method.
 +
 
=Introduction=
 
=Introduction=
  
Line 11: Line 13:
 
=How do you do it?=
 
=How do you do it?=
  
As root, create '''/etc/profile.d/qt.style.overide.sh'''
+
1) Install '''qt5ct'''  
  
To do that you will need to start your favourite text editor as ''root'' .
+
2) Set environment variables in '''/etc/profile''' and add the following lines:
  
You can achieve this by using the following command at the terminal '''$''' prompt (swap '''medit''' to the text editor of your choice):
+
'''export QT_QPA_PLATFORMTHEME="qt5ct"'''
  
sudo medit /etc/profile.d/qt.style.overide.sh
+
'''export QT_AUTO_SCREEN_SCALE_FACTOR=0'''
  
Then copy the following into your text editor's new empty file:
+
3) source the file by using: <code>source /etc/profile</code>
  
## Following was created to make Qt app's use GTK2
+
4) Start '''qt5ct'''  
## font & theme settings:
+
+
export QT_STYLE_OVERRIDE='gtk2'
+
+
'''Save''' the file & '''reboot'''.
+
  
<br clear="all"/>
+
5) In the first tab '''Appearance''' choose '''Standard Dialogs: default''' (some people get crashes if they choose GTK3)
  
=Results=
+
Because we used /etc/profile 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.
  
After saving the file & rebooting, I then, with trepidation, opened the Qt 5.5 program called PkgBrowser... It looked just like my other GTK+ app's on my Openbox system (there is no accounting for taste!). I was very happy.
+
(If you find that certain widget styles are missing, you can see if qt5-styleplugins brings a fix for you.)
  
 +
<br clear="all"/>
  
 +
=Links=
  
[[File:PkgBrowser.GTK+.png|thumb|left|375px]]
+
This ArchWiki page goes into far more detail:
  
Here is a picture of the Qt 5.5 PkgBrowser program open full screen on my 1080p Openbox (GTK2) box. It is using my custom dark theme & my large font settings. My eyes love it.
+
Uniform look for Qt and GTK applications [https://wiki.archlinux.org/index.php/Uniform_Look_for_Qt_and_GTK_Applications]
  
 
<br clear="all"/>
 
<br clear="all"/>
 
 
=Support=
 
=Support=
  
 
Following is a link to this page's forum counterpart where you
 
Following is a link to this page's forum counterpart where you
can post any related feedback: [https://forum.manjaro.org/index.php?topic=29026.0]
+
can post any related feedback: [https://forum.manjaro.org/t/wiki-set-all-qt-apps-to-use-your-gtk-theme-font-settings/17654]
  
 
<br clear="all"/>
 
<br clear="all"/>
 
[[Category:Contents Page]]
 
[[Category:Contents Page]]

Revision as of 19:53, 15 May 2018

13-March-2018: Updated contents & method.

Introduction

For those of us that use Desktop Environments &/or Window Managers that use GTK+ , this fix is particularly helpful.

For those such as myself that run 1080p or higher screen resolutions on largish monitors it can be quite a strain on the eyes when you can't control the size of the fonts that an application uses.

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/profile and add the following lines:

export QT_QPA_PLATFORMTHEME="qt5ct"

export QT_AUTO_SCREEN_SCALE_FACTOR=0

3) source the file by using: source /etc/profile

4) Start qt5ct

5) In the first tab Appearance choose Standard Dialogs: default (some people get crashes if they choose GTK3)

Because we used /etc/profile 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.)


Links

This ArchWiki page goes into far more detail:

Uniform look for Qt and GTK applications [1]


Support

Following is a link to this page's forum counterpart where you can post any related feedback: [2]