Hi, Am Mittwoch, 7. Oktober 2020, 12:52:02 CEST schrieb Martin Jambor:
Hi,
On Thu, Sep 03 2020, Hans-Peter Jansen wrote:
Am Donnerstag, 3. September 2020, 20:45:30 CEST schrieb Hans-Peter Jansen:
Hi,
what's the canonical way to run scripts (eg. from crontab), that want to access the X session, (eg. xprop, wmctrl), now that xauth is a random file in /run/user/$UID?
Before the switch, it was possible to run such scripts from crontab, using the pattern:
XAUTHORITY=~/.Xauthority DISPLAY=:0 ~/bin/script
Scratch that.
Florian provided the magic spell: "xhost +si:localuser:$USER" does the trick.
This week I installed a new Tumbleweed desktop (snapshot 20201002) where I use lightdm and fluxbox window manager. Each X application (xeyes, xterm, Firefox) seemed to work fine but complained to stderr with error message "No protocol specified" sometimes several times ...until I added the above xhost command to the fluxbox startup script. After doing that the message is gone.
The .Xauthority entry contains the hostname used for the X11 connection. So if the local hostname changes, it would no longer find the correct entry. To work around that, DMs and libxcb are patched to set and read the $XAUTHLOCALHOSTNAME environment variable, which is used as a fallback. In case the first try with the current hostname doesn't work, it prints the error message and tries again with the fallback.
Is this anything to be concerned about? Can anyone guess what the problem is/was? The applications working but not having permission to access some protocol specification?
This is harmless and works as intended, though you can avoid that by making the hostname fixed. You can compare the value of $XAUTHLOCALHOSTNAME with the output of "hostname". The "modern" way is to use FamilyWild as wildcard entry which matches anything, but those only really work if the $XAUTHORITY file is temporary per session. Cheers, Fabian
Thanks,
Martin
-- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org