On Thu, Dec 31, 2020 at 11:02:18PM +0100, to...@tuxteam.de wrote: > On Thu, Dec 31, 2020 at 02:50:18PM -0700, Charles Curley wrote: > > I am using Bullseye as updated to yesterday. It is my custom to log in > > to XFCE as my regular user, then "su -" in order to run as root, > > including GUI programs. In the process, in the past $DISPLAY has been > > set. > > > > I now find on bullseye that $DISPLAY is not being set.
It's worth pointing out that even on buster, "su -" does in fact clear the value of DISPLAY, which is not really a surprise, since you explicitly requested a "clean" login session as the new user. Perhaps you are mis-remembering what you used to do. Perhaps you used to use regular "su" without the infernal Red Hat "-" option. unicorn:~$ su Password: root@unicorn:/home/greg# env | grep DISPLAY= HOSTDISPLAY=unicorn:0 DISPLAY=:0 root@unicorn:/home/greg# exit unicorn:~$ su - Password: root@unicorn:~# env | grep DISPLAY= root@unicorn:~# Quite a difference, eh? Almost certainly this is not a thing that has changed during bullseye's run as testing. > > I set DISPLAY manually or run 'su -w DISPLAY -', programs like xclock > > complain that they cannot open the display. > > > > How do I allow root to use the display? > > Most probably you have to copy the user's [1] ~/.Xauthority file to > root's home. More typically, since root can usually read the user's files,[2] all that's needed is to export the XAUTHORITY variable with the full pathname of the user's .Xauthority file. [2] Unless of course the user's home directory is on a network file system.