4

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?

2
  • 1
    Exec="VDPAU_DRIVER=va_gl && firefox" ?
    – Rinzwind
    Jul 12, 2014 at 13:12
  • @Rinzwind Not working.
    – pmichna
    Jul 12, 2014 at 13:17

1 Answer 1

3

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)

NAME
       env - run a program in a modified environment

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

Alternatively, create a wrapper script and call that instead.

2
  • "Should be able to" is all well and good, but "/usr/bin/env VAR=val command" on the command line works, whereas "Exec=/usr/bin/env VAR=val command" in .Desktop entry does not (using 20.04).
    – Lexible
    Sep 28, 2020 at 16:14
  • @Lexible, did you find any fix for this? Feb 2, 2022 at 10:31

You must log in to answer this question.

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