[Gambas-user] EXEC ... WITH

jose.rodriguez at cenpalab.cu jose.rodriguez at cenpalab.cu
Mon Jul 19 00:06:03 CEST 2021

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.


More information about the User mailing list