[Gambas-user] EXEC ... WITH

Bruce Steers bsteers4 at gmail.com
Mon Jul 19 00:29:14 CEST 2021


Just an initial thought as it's working in the cli so I assume all
configured okay.

I sometimes making sure bash is the shell an not the default sh can help
fix some glitches.

System.Shell = System.Find("bash")

Also I wrote a simple gambas called groot that I've found works where
pkexec does not. It simply creates a hidden window with a terminalview and
launches the application via sudo.
It's on the gambas application repository
http://gambaswiki.org/wiki/app/groot
Might give you some alternative ideas at least?

BruceS

On Sun, 18 Jul 2021, 23:08 , <jose.rodriguez at cenpalab.cu> wrote:

> This works in cli:
>
> pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY
> /home/joe1962/0-develop/MyDev/vcpufreq/trunk/vcpufreq-gui/vcpufreq-gui.gambas
>
> However, none of the following attempts have worked in Gambas code:
>
> Exec ["pkexec", "env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY " &
> Application.Path &/ "vcpufreq-gui.gambas"] Wait
>
> Exec ["pkexec", Application.Path &/ "vcpufreq-gui.gambas"] With
> ["DISPLAY=$DISPLAY", "XAUTHORITY=$XAUTHORITY"] Wait
>
> This is for some old code I had and am updating to current Gambas. The
> problem actually came about because the code tested for kdesu, ktsuss, gksu
> and would relaunch itself as root, then quit. However, on Linux Mint you're
> supposed to use pkexec now...
>
> The error is the typical one when trying to run a gui program in a root
> console:
>
> qt.qpa.xcb: could not connect to display
> qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even
> though it was found.
> This application failed to start because no Qt platform plugin could be
> initialized. Reinstalling the application may fix this problem.
>
> Available platform plugins are: eglfs, linuxfb, minimal, minimalegl,
> offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl,
> wayland-xcomposite-glx, xcb.
>
>
> Appreciate any ideas.
>
> Regards,
> Joe1962
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210718/f085001a/attachment.htm>


More information about the User mailing list