I need to set GDK_BACKEND=x11 prior to launching Eclipse, because of https://bugs.kde.org/show_bug.cgi?id=389495.

I tried the following in the .desktop file:

Exec=GDK_BACKEND=x11 /home/glodt/Software/eclipse-4.7/eclipse
Exec=env GDK_BACKEND=x11 /home/glodt/Software/eclipse-4.7/eclipse
Exec=export GDK_BACKEND=x11; /home/glodt/Software/eclipse-4.7/eclipse

but none of them yield the expected result.

When I launch Eclipse from the command-line like this it works:

GDK_BACKEND=x11 /home/glodt/Software/eclipse-4.7/eclipse

How can I set this environment variable in the desktop file ?

  • You could try Exec=/usr/bin/env GDK_BACKEND=x11 home/glodt/Software/eclipse-4.7/eclipse, but since I don't run KDE I can't really test it. – Kusalananda Feb 26 '18 at 7:38
  • Thanks for the hint. It mkes no differences unfortunaltely. – yglodt Feb 26 '18 at 8:22

You can try this:

Exec=bash -c "GDK_BACKEND=x11 /home/glodt/Software/eclipse-4.7/eclipse"

you can also try sh

Exec=sh -c "GDK_BACKEND=x11 /home/glodt/Software/eclipse-4.7/eclipse"

I'm not sure whether you need Terminal=true

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.