Why Does Text For QT Apps Appear Bigger in i3WM?

So, I switched to using i3 as my daily driver about a year ago after using Cinnamon almost exclusively. It’s been great! I love it! Made me try a bunch of other WMs but now I’ve settled.

One thing I noticed but didn’t really care about is the fact that the text for some apps - dunst, dolphin, etc. - is bigger in i3. Meaning if I set the text size to 10 in both Cinnamon and i3, the text is visibly 2 or 3 font sizes bigger on i3 even though I set it to the same size.

Is this normal?

As I said, it’s not an actual issue, but I’d like to know if I’m doing something wrong.

Oh, and yes, I am using the same font too. :sweat_smile:

Text of dunst is configured by the dunst config in: ~/.config/dunst/dunstrc
As for dolphin so its a qt app, you would probably need to look at this:
https://wiki.archlinux.org/title/qt#Configuration_of_Qt_5_applications_under_environments_other_than_KDE_Plasma

Also the font config in i3 is just for the window titles and i3 bars if you are using that. It won’t affect anything else.

And if you have configured the fonts correctly as per this, it might be due to scaling. desktop environments usually use fractional scaling and other scaling, i3 doesn’t support it as of now as far as I know.

Strangely enough, even though dunst has an independent config, it still responds to the different environments with text at different sizes. It may just be fractional scaling like you mentioned. But what is very strange about it is that I set the font to Open Sans 8 (which is very small), and yet my notifications look like they are at a font size of 12.

image

As for qt5ct, I have been using it, but without setting the environment variable as mentioned in the wiki. Didn’t know I also needed to do that. Will try it to see if anything changes.

Thanks for the info btw. :+1: :grinning:

So I did set QT_QPA_PLATFORMTHEME qt5ct and the terminal didn’t return any errors.

Then I also put --platformtheme qt5ct as an argument to launch Dolphin. Neither worked. Even logged out and restarted.

Did I do something wrong? I’ve actually never set an environment variable before. I just followed what the terminal told me to do. :sweat_smile:

Did some more reading here: https://wiki.archlinux.org/title/Uniform_look_for_Qt_and_GTK_applications

Tried set DESKTOP_SESSION qt5ct. No luck.

Will look at this another time. It’s time for food. :yum:

If you had configured fonts etc in qt5ct and passed the argument to the program
i.e: dolphin --platformtheme qt5ct
It should pick up the settings.
I have just put: export QT_QPA_PLATFORMTHEME=qt5ct
in my ~/.xprofile as I’m using lightdm and it sources this file upon login.
Remember to always put environment variables that are needed for graphical applications in ~/.xprofile or ~/.profile as they are not limited to stuff inside a terminal.
And just a tip, if you want to configure the same for qt applications run as root just launch the qt5ct app as root and configure there, that will work on root qt applications too if you had set the environment variable in your current user i.e ~/.xprofile or ~/.profile

There are other ways to set environment variables for graphical applications too but I use this method.

per user and if you run i3 using a DM… best way is to use ~/.xprofile
with this:
export QT_QPA_PLATFORMTHEME=qt5ct and use qt5ct to set the wanted font and size (e.t.c.)

If you want both qt5 and qt 6 applications using the changes better go to add

export QT_QPA_PLATFORMTHEME=qt6ct

and use both qt5ct and qt6ct to set them up the same… (current state)

To confirm this is what I should do right?

image

I’ve tried all three of these individually but none have worked.

I tried the terminal method but it did not create the .xprofile file automatically. I created the file myself.

I do use exactly this two methods both working for me:
~/.xprofile
export QT_QPA_PLATFORMTHEME=qt6ct

and /etc/environment
QT_QPA_PLATFORMTHEME=qt6ct

But i do use this together with kvantum manager…

Currently seems the best way to apply theming consistency over gtk and qt apps…

Yeah… So it looks like my QT apps just don’t like me. :smiling_face_with_tear:

I downloaded qt6ct, set it up from scratch with all the same fonts and settings, but still no luck. I use Kvantum too.

Would zsh/bash affect this? I know it shouldn’t because as far as I know, those are just for terminals but… :person_shrugging:

To be clear, the themes are just fine. It’s just the text sizing that’s different.

on my i3 setup i use zsh too… but graphical env should not be related to shell env stuff…

text sizing in qt5 apps? or both qt5 and qt6?

Thought so.

The only app that I know for sure is Qt6 would be qbittorrent. Just checked the sizing - it’s actually correct. So, it’s probably just Qt5 apps.

qbittorrent is using integrated theming not sure about fonts.

I just forced it to use my system font and theming. The text was correct. Looked ugly though! :face_vomiting:

eos-quickstart is qt6 …

and only to bail out… you do use qt5/6ct to create a fonts.conf? i remember that this can cause issues…

Do you mean it causes an issue if I use it or if I don’t use it?

To confirm: I used it for both qt5ct and qt6ct… But I didn’t use it initially and have always had this problem. Only used it for the first time a few days ago when I decided to try to fix the font size.

in this case it will not be the reason of the font issue… but it could be in the way of solving it.


dolphin qt5ct and two gtk based apps and i3 bar… no font issue.

you are using any
~/.xprofile
~/.Xresources
?

The only line in my .xprofile is
export QT_QPA_PLATFORMTHEME=qt5ct

The only things I have called “xresources” are some Steam folders and files within those folders.