How to execute a command with "=" sign in a desktop shortcut?

by pmichna   Last Updated August 14, 2019 04:02 AM - source

I'm trying to modify my Firefox shortcut in Unity so that it started with a specific parameter. From a terminal, I would start like this:

VDPAU_DRIVER=va_gl firefox

I tried modifying the firefox.desktop file so that the Exec line looked like

Exec=VDPAU_DRIVER=va_gl firefox

But this doesn't work (the application doesn't start). I thought it could be a problem with two "=" signs, so I tried

Exec="VDPAU_DRIVER=va_gl firefox"

but this doesn't work either. What should I do?

Answers 1

You should be able to use the env command

Exec=/usr/bin/env VDPAU_DRIVER=va_gl firefox

See the manpage at man env

ENV(1)                           User Commands                          ENV(1)

       env - run a program in a modified environment

       env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]

Alternatively, create a wrapper script and call that instead.

July 12, 2014 13:17 PM

Related Questions

Different environment variables depending on gui or shell

Updated September 27, 2015 19:01 PM