Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Set Qt env vars (e.g., for GTK2 platform themes) #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TheAssassin opened this issue Jun 30, 2019 · 10 comments
Closed

Set Qt env vars (e.g., for GTK2 platform themes) #33

TheAssassin opened this issue Jun 30, 2019 · 10 comments
Labels
enhancement New feature or request

Comments

@TheAssassin
Copy link
Member

Should be set accordingly once linuxdeploy/linuxdeploy#81 is implemented.

@TheAssassin
Copy link
Member Author

@probonopd now that the feature has been implemented in linuxdeploy, we could realize this. How to detect when we need to set that environment variable?

@TheAssassin TheAssassin added the enhancement New feature or request label Aug 14, 2019
@probonopd
Copy link

probonopd commented Aug 15, 2019

Scribus is currently using:

case "${XDG_CURRENT_DESKTOP}" in
    *GNOME*|*gnome*)
        export QT_QPA_PLATFORMTHEME=gtk2
        ;;
esac

I think we also need to consider Xfce and some others.

@TheAssassin
Copy link
Member Author

Is there any documentation on the effect of setting this variable? I can't spot a difference really on my computer...

@TheAssassin
Copy link
Member Author

Do we even ship the required style plugins? Is that the segfault-producing thing you once suggested to include in AppImageLauncher that we removed for causing segfaults?

https://www.linuxuprising.com/2018/05/get-qt5-apps-to-use-native-gtk-style-in.html

@probonopd
Copy link

probonopd commented Aug 16, 2019

I think we are not shipping those yet. One needs to compile them and deploy them (but not their dependencies, since we want to use the native Gtk of the target system and just let the plugin fail in cause they are not there).

@probonopd
Copy link

Setting those variables makes a big difference. If you want to try it for yourself, download the continuous Scribus AppImage and run it on Gnome. Looks pretty native, right? Then extract it and comment out that section in the AppRun, and run again. Looks pretty ugly then...

@TheAssassin
Copy link
Member Author

We can set the variables. It's the up to the user to include those style plugins. I don't think we have to automate that.

Do you want to ask Stephan Binner to include those plugins in his Qt PPAs?

@probonopd
Copy link

I think (not 100% sure though) that at some point the upstream Qt project separated the plugins out from the main project into its own subproject. I'd suspect that Stephan Binner wants to stay close to upstream. Shall we ask upstream to re-include them? (Imho Qt on Linux has been broken ever since they removed them from the default installation...)

@TheAssassin
Copy link
Member Author

So you once suggested the following code for inclusion in the obsolete AppRun.c:

case "${XDG_CURRENT_DESKTOP}" in
    *GNOME*|*gnome*|*XFCE*|)
        export QT_QPA_PLATFORMTHEME=gtk2
esac

The code is broken for multiple reasons:

  • section catches empty values of XDG_CURRENT_DESKTOP, overwrites the env var nevertheless
  • broken syntax: missing ;;

The Scribus code you posted is also broken. I've corrected it just like the code in the original issue over at AppImageKit, so people won't pick up broken code by accident.

I'm including the following now:

case "${XDG_CURRENT_DESKTOP}" in
    *GNOME*|*gnome*|*XFCE*)
        export QT_QPA_PLATFORMTHEME=gtk2
        ;;
esac

@probonopd
Copy link

Which is "the obsolete" AppRun.c? I don't consider it as "obsolete", as I am still actively using it in some scenarios (i.e., where I can't use linuxdeploy*).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants