FreeBSD-11, Mate, Terminal, Gvim

Polytropon freebsd at edvax.de
Tue Jul 25 22:52:49 UTC 2017


On Tue, 25 Jul 2017 22:40:57 +0000, Manish Jain wrote:
> 
> 
> On 07/26/17 03:19, Carl Johnson wrote:
> > I just have/root/.Xauthority as a symbolic link to ~/.Xauthority for my
> > user login.  I think that should be safe for me as the sole user on this
> > system, and I don't have to fool with xhost.
> > 
> 
> Either way (extract/symlink), your root user shell must set the DISPLAY
> 
> I think, for bash users, the best way would be put the following in 
> /root/.bash_profile :
> 
> export DISPLAY=:0 # if normal user exports :0.0, root should export that
> 
> [ -f /var/xauth.extract ] && \
> xauth merge /var/xauth.extract || \
> ln -sf /home/my_normal_user_name/.Xauthority  ~/.Xauthority
> 
> The normal user should put this in his .bash_profile :
> 
> export DISPLAY=:0 # not needed on my KDE konsole/terminator, but no harm
> 
> [ -f /var/xauth.extract ] && \
> xauth extract /var/xauth.extract $DISPLAY

If $DISPLAY is set or not usually depends on the terminal
emulator where the shell runs. For example, classic xterm
sets $DISPLAY to the correct display name. For remote
connections, you might need to set $DISPLAY manually (for
example with hostname / IP and display number, maybe with
a screen number or "sub-display" if needed).

See "man X" for details, section "DISPLAY NAMES", and also
the following section "ACCESS CONTROL". Yes, this stuff is
actually documented. ;-)




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list