QT_QPA_PLATFORMTHEME=qt5ct environment variable [SOLVED]

Hello Group,
I am running FreeBSD 14.0 with the XFCE4 desktop and lightdm. I use KDE's Dolphin file manager because it's the only one I've found that shows me the duration of mp3 files. This is important as I do a lot of radio work, and need to know how long the songs are.
Anyhow, I use qt5ct to change the theme of Dolphin to dark, so that it matches the rest of my system. With Linux it was pretty simple: I had to add QT_QPA_PLATFORMTHEME=qt5ct to /etc/environment. How do I do this with FreeBSD? I'm using the bash shell, so I thought that using the EXPORT command within ~/.bashrc would work, but it doesn't seem to. Or maybe I just didn't do it right. I've tried creating /etc/environment and /usr/local/etc/environment, but that didn't work either.
So, any advice is configuring qt5ct with the Environment variable would be appreciated! It's really not crucial, as it's purely cosmetic.
Thanks!
 
Hi. Can you try adding QT_QPA_PLATFORMTHEME=qt5ct; export QT_QPA_PLATFORMTHEME to your ~/.profile and log out/log in back to see if theme is changed?

I'm viewing this thread:
 
Hi. Can you try adding QT_QPA_PLATFORMTHEME=qt5ct; export QT_QPA_PLATFORMTHEME to your ~/.profile and log out/log in back to see if theme is changed?

I'm viewing this thread:
Thanks for your reply. I did as you suggested, but it hasn't helped: qt5ct still gives me a Warning Message:
The QT_QPA_PLATFORMTHEME environment variable is not set (required values qt5ct or qt6ct).
 
Hmm, then can you try this suggestion too.
Try copy /usr/local/etc/xdg/xfce4/xinitrc to ~/.config/xfce4/ and export the environment variable there.
 
Hmm, then can you try this suggestion too.
Try copy /usr/local/etc/xdg/xfce4/xinitrc to ~/.config/xfce4/ and export the environment variable there.
I've tried that too. I also saw the thread that you're referring to, and went through it before posting.
Now here's the odd thing: When I logout/login or reboot and run qt5ct, I don't get the warning message. But, it has no effect: Dolphin's theme does not change. Then when I go back into qt5ct the warning message is back. Odd.
 
Hi, first you can try if xfce read your
~/.xinitrc
file
put at the top of the file
xterm &

if xterm is executed when you start xfce,only put the line
Code:
export QT_QPA_PLATFORMTHEME=qt5ct
in your ~/.xinitrc file

and check in your terminal emulator with
Code:
env
 
I am using tcsh and i added setenv QT_QPA_PLATFORMTHEME qt5ct to ~/.login and qt5ct configuration is applied to dolphin.
 
Hi, first you can try if xfce read your
~/.xinitrc
file
put at the top of the file
xterm &

if xterm is executed when you start xfce,only put the line
Code:
export QT_QPA_PLATFORMTHEME=qt5ct
in your ~/.xinitrc file

and check in your terminal emulator with
Code:
env
No joy. xterm didn't appear either.
 
Can you find dolphin's .desktop file in /usr/local/share/applications/ and edit it as follows?
Exec=env QT_QPA_PLATFORMTHEME=qt5ct /path/to/program
 
Can you find dolphin's .desktop file in /usr/local/share/applications/ and edit it as follows?
Exec=env QT_QPA_PLATFORMTHEME=qt5ct /path/to/program
Got it! Editing Dolphin's .desktop file didn't work, but you gave me the idea to edit qt5ct's desktop file and that did work!
So here's the solution that fixed it for me:

Edit: /usr/local/share/applications/org.kde.dolphin.desktop
Change Exec=dolphin %u to read: Exec=env QT_QPA_PLATFORMTHEME=qt5ct /usr/local/bin/dolphin %u
(I'm not sure if this is necessary, but it works and I'm not changing it!)
Edit: /usr/local/share/applications/qt5ct.desktop
Change Exec=qt5ct to read: Exec=env QT_QPA_PLATFORMTHEME=qt5ct qt5ct

Thanks so much for your help!
 
The only thing I'll need to remember is to update the .desktop file should pkg upgrade ever install a new version!
Ideally I should copy it to ~/.local/share/applications and run it from there.
 
Got it! Editing Dolphin's .desktop file didn't work, but you gave me the idea to edit qt5ct's desktop file and that did work!
So here's the solution that fixed it for me:

Edit: /usr/local/share/applications/org.kde.dolphin.desktop
Change Exec=dolphin %u to read: Exec=env QT_QPA_PLATFORMTHEME=qt5ct /usr/local/bin/dolphin %u
(I'm not sure if this is necessary, but it works and I'm not changing it!)
It is necessary!
Edit: /usr/local/share/applications/qt5ct.desktop
Change Exec= to read: Exec=env QT_QPA_PLATFORMTHEME=qt5ct qt5ct

Thanks so much for your help!
 
Hi, hope this isn't too bad of a necrobump

I've been racking my brain on this issue and how to globally set QT themes outside of KDE Plasma... but specifically if those themes have also already been set in KDE Plasma. I'm also new to FreeBeasting around ¦P

The way I have my systems set up is that I like to have both KDE Plasma as well as Sway (former preferred on desktop, latter preferred on laptop (on the go)), which means I tend to theme KDE Plasma first, and then Sway (or i3, any TWM really) second.

What this means is that I have a custom theme set in Breeze, which can be pointed to by (in my case) qt6ctl, so as long as I make qt6ctl use Breeze, all should be hunkydory. Due to my unfamiliarity with where each different OS sets things, I've had to do some experimenting. My end result to get my QT theme to match what I have set in KDE for FreeBSD is:

(1), set colour scheme in KDE System settings.
(2), set qt6ctl to use "Style: Breeze" and "Color scheme: Style's colors".
Then (and this was the tricky part) (3):
Code:
setenv QT_QPA_PLATFORMTHEME qt6ct
^^ Use that expression in my ~/.cshrc
 
Back
Top