Closed Tatsh closed 4 years ago
Thanks, I'm aware of this, but what do you want me to do with it? It's not something you can set through the port unless you want to force a specific platform theme on everyone.
Where does the QT_QPA_PLATFORMTHEME2
variable come from?
My mistake. I think I mistyped it at some point a long time ago and thought it was relevant.
I think the best solution is to provide a note about this in the Qt Portfile.
For KDE apps I think the best solution is to add these values to the generated Info.plist prior to installation:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSEnvironment</key>
<dict>
<key>QT_QPA_PLATFORMTHEME</key>
<string>kde</string>
<key>KDE_SESSION_VERSION</key>
<string>5</string>
</dict>
</dict>
</plist>
This could be done with /usr/libexec/PlistBuddy
. Have a file with the above contents (env-vars.plist
) and then run:
/usr/libexec/PlistBuddy -xc 'Merge env-vars.plist' somewhere/kate.app/Contents/Info.plist
I've been manually patching these after install.
I'd have to put that into a variant, and I'd have to figure out a way to do this that doesn't oblige me to know exactly where each port puts its plists. That's not something very high on my lists, to be honest.
The current instructions should be clear enough that users set the variables in their environment via a 1-time edit of a single or handful of files, and to the exact values they want to set them to.
I am setting
QT_QPA_PLATFORMTHEME
globally with~/.MacOSX/environment.plist
.I found that some Qt apps like Wireshark (which I am not installing with MacPorts due to conflicts with the original Qt 5 packages) will read the environment variables
QT_QPA_PLATFORMTHEME
and will either look incorrect or will crash. In general they are buggy.The workaround for any app bundle is to set the
LSEnvironment
key inInfo.plist
:You have to force macOS to reread
Info.plist
. One way is to usetouch(1)
.