What happens if I (or you, probably) try to execute abrowser as root may be of interest to understand the issue. Specifying the .Xauthority of the user who is currently logged in graphically:
$ pkexec env DISPLAY=:0 XAUTHORITY=/home/banana/.Xauthority abrowser
Running Abrowser as root in a regular user's session is not supported. ($XAUTHORITY is /home/banana/.Xauthority which is owned by banana.)

That error message is visibly output by Abrowser: pkexec works. In fact, using sudo, I get the same error:
$ sudo -H abrowser
Running Abrowser as root in a regular user's session is not supported. ($XAUTHORITY is /home/banana/.Xauthority which is owned by banana.)

Defining XAUTHORITY as /root/.Xauthority, which does not actually exist on my system:
$ pkexec env DISPLAY=:0 XAUTHORITY=/root/.Xauthority abrowser
No protocol specified
Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused
Error: cannot open display: :0

Again that message. This time using DISPLAY=:0. As a consequence, the problem Sabrinakitty faced using pkexec may have nothing to do with DISPLAY (as I thought) and everything to do with XAUTHORITY. Or not: I am a bit lost.

Reply via email to