[Gambas-user] EXEC ... WITH

jose.rodriguez at cenpalab.cu jose.rodriguez at cenpalab.cu
Mon Jul 19 03:12:56 CEST 2021

July 18, 2021 7:22 PM, "Tobias Boege via User" <user at lists.gambas-basic.org> wrote:

> Gambas does not interpret $DISPLAY and $XAUTHORITY. With this
> "With" statement, you are putting the literal string values
> "$DISPLAY" and "$XAUTHORITY" into these environment variables.
> The "$variable" syntax for environment variable expansion is
> a shell feature. With Exec, you bypass the shell and renounce
> its features.
> What you should do from Gambas is to use Env[] as I did above.
> But I suppose pkexec clears the environment, which is the reason
> why it has an "env" subcommand. If that's the case, then setting
> the environment using "With" will not get you anywhere. You should
> instead try what I suggest in my first paragraph.

Well, none of these worked:

Exec ["pkexec", Application.Path &/ "vcpufreq-gui.gambas"] With ["DISPLAY=" & Env["DISPLAY"],

'Exec ["pkexec", "env", "DISPLAY=" & Env["DISPLAY"], "XAUTHORITY=" & Env["XAUTHORITY"],
Application.Path &/ "vcpufreq-gui.gambas"] Wait

BTW, the wiki says "The first element in the list/array is the name of the command, and the other elements are the commands parameters (if any)", so I wouldn't expect the second variant to work.

Maybe I should try Shell?


More information about the User mailing list