I have a few scripts that need to be started as root and from cron, and need basic user interaction with zenity
. To start zenity
on user screen, I was used to this form of command:
DIPLAY=:0 sudo -u some_user zenity ...
But if the user is running a Wayland
session:
who
now shows/dev/tty2
instead of:0
- the above command does not work (regardless
:0
or/dev/tty2
asDISPLAY
value), and returnsError: Can't open display: /dev/tty2
Do you know the "Wayland way" to achieve a similar goal? (Although I am less interested, a MIR equivalent would be an interesting bonus...)
Again, to be clearer, my question is about Wayland
user session: I have no problem when user session is running under Xorg
. If you still think my question is a duplicate of this one, please explain why.
sudo
may very well clear your environment. – Kusalananda Feb 13 '17 at 14:37zenity
undercron
. FWIW after your clarification I've now voted to reopen so we'll see what happens. – Chris Davies Feb 13 '17 at 20:05who
reports/dev/tty2
instead of the usual:0
, the command works from TTY using:0
(which is indeed theDISPLAY
value you can get from inside the Wayland session):DISPLAY=:0 sudo -u user some_command
. This question is solved, sorry for the noise. – Yvan Feb 14 '17 at 16:50