How to run GUI app as superuser?

I forgot that kdesu is fairly unmaintained:

pkexec

Consequently, I thought, recently, that pkexec might act as a solution, because I’d had success with it on the CLI:

However, it doesn’t appear to be an improvement:

  1. As unix.stackexchange.com/q/421853 explains, it doesn’t retain authorisation.

  2. It crashes applications it invokes:

    RokeJulianLockhart@Beedell:~$ sudo dolphin
    [sudo] password for RokeJulianLockhart: 
    Running Dolphin with sudo is discouraged. Please run “dolphin --sudo” instead.
    RokeJulianLockhart@Beedell:~$ pkexec dolphin
    qt.qpa.xcb: could not connect to display 
    qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
    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, vkkhrdisplay, vnc, xcb, wayland-egl, wayland.
    
    Aborted                    (core dumped) pkexec dolphin
    

    kdesu does not.

That might be because I’ve not configured it for the specific application. However, that’s not convenient for a non-developer:

run0

I’ve since ascertained that run0 is the authoritative, newest, and currently-worked on elevator. [1] However, it doesn’t work for my use case, either:


  1. reddit.com/r/linux/comments/1nax0uw/comment/np70qj7 ↩︎