QT Theme management in Sway
from jaagruk@mander.xyz to linux@lemmy.ml on 13 Jun 20:00
https://mander.xyz/post/14104868

I use VLC,Keepass,Kdenlive and few other QT Apps on my sway setup. So, wanted to configure their themes from Sway. I installed qt5ct and qt6ct and did export QT_QPA_PLATFORMTHEME=qt5ct in bashrc and .profile. While runnin echo $QT_QPA_PLATFORMTHEME it is showing qt5ct but it is not working showing that error message that QT_QPA_PLATFORMTHEME need to be set as qt5ct or qt6ct when launching from .desktop But when launching from terminal they start and function properly but do not change any theming.

qt5ct-error

from-terminal error

#linux

threaded - newest

exu@feditown.com on 13 Jun 21:04 next collapse

In my experience setting environment variables is pretty inconsistent. The easiest way would be using /etc/environment. This sets stuff globally for all users and definitely works.

PAM also used to support a per-user environment file, but that’s deprecated or removed even. The best you can do for per-user config is setting variables both in your login shell and the systemd user environments file.

yardy_sardley@lemmy.ca on 13 Jun 21:15 next collapse

A really common issue with sway is that it doesn’t run as a login shell, so none of your .profile or other environment settings get sourced when you login. I think that might be the problem here.

Try closing your sway session, then login to a tty and run sway. If the qt themes work properly then it’s definitely an environment issue.

Static_Rocket@lemmy.world on 13 Jun 21:57 next collapse

Depending on the launcher and launch method you may need to set systemd variables. Look at the way 50-systemd-user.conf works wiki.archlinux.org/title/Sway#Configuration

I use the following fragment to make sure the cursor theme propagates to applications launched with wofi: github.com/StaticRocket/…/systemd-user.conf

Communist@lemmy.ml on 13 Jun 22:25 collapse

Test setting it in /etc/environment