1

How can I correctly set the following environment variables in a .desktop launcher file?

To fix a problem with Davinci Resolve Studio it is necessary for my setup to set these two environment variables:

__NV_PRIME_RENDER_OFFLOAD=1 
__GLX_VENDOR_LIBRARY_NAME=nvidia 

Via the terminal I can launch Davinci Resolve Studio now with the following line successfully:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia /opt/resolve/bin/resolve

And I try to note these in the .desktop launcher like the following with no effect (see line 8, "Exec=..."). What do I have to alter in this .desktop file to get this working? I tried with and without the "env" command at the beginning so far.

[Desktop Entry]
Version=1.0
Type=Application
Name=DaVinci Resolve
GenericName=DaVinci Resolve
Comment=Revolutionary new tools for editing, visual effects, color correction, and professional audio post-production, all in a single application!
Path=/opt/resolve/
Exec=env __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia /opt/resolve/bin/resolve %u
Terminal=false
MimeType=application/x-resolveproj;
Icon=/opt/resolve/graphics/DV_Resolve.png
StartupNotify=true
Name[en_US]=DaVinci Resolve

The parameters are exemplary here. I wonder what is missing here to get this working via a launcher.

11
  • 1
    The way you post it should work. Maybe you have another .desktop file that masks this one? Try placing it in ~/.local/share/applications
    – vanadium
    Oct 13, 2022 at 18:32
  • Thanks @vanadium. After moving the file from the desktop to this directory it works!
    – Fuchsi
    Oct 13, 2022 at 18:51
  • Thanks @karel, I have seen that before, but this more general guide did not help me solve this problem.
    – Fuchsi
    Oct 14, 2022 at 8:34
  • Your comment "After moving the file from the desktop to this directory it works!" is the same as written in the accepted answer to How can I create launchers on my desktop? so how could it not be a duplicate of that question?
    – karel
    Oct 14, 2022 at 8:55
  • I see what you mean, if there is another post explaining how to add these enviromental parameters to the Exec line of the .desktop file, I would not mind to mark this question as a duplicate. Because this was my question initially. Somebody looking for these parameters would not find the answer in this previous question, would they?
    – Fuchsi
    Oct 14, 2022 at 13:53

1 Answer 1

1

As suggested by @vanadium I just had to move this .desktop file to ~/.local/share/applications.

See also this post for more information: How can I create launchers on my desktop?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .