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!
 
Back
Top