I've got mate-screensaver installed on a machine running Linux Mint 16. On that machine, I can open up a terminal and query the state of the screensaver:
dan@box1 ~ $ echo $DISPLAY
:0.0
dan@box1 ~ $ mate-screensaver-command -q
The screensaver is inactive
The screensaver is not inhibited
This all works fine and makes sense. However, when I SSH into that same machine, I don't get the results I expect:
dan@box2 ~ $ ssh box1
dan@box1 ~ $ export DISPLAY=:0.0
dan@box1 ~ $ echo $DISPLAY
:0.0
dan@box1 ~ $ mate-screensaver-command -q
** Message: Screensaver is not running!
This same method works on all my other computers, all running various versions of Mint. Nothing strange is getting logged to my ~/.xsession-errors
.
After reading this answer, I discovered that setting my DBUS_SESSION_BUS_ADDRESS
to unix:abstract=/tmp/dbus-ToCuEUyLn0,guid=9296df6ba791b044d4236e45545fbe55
(its value in a local terminal) makes things work as I expect over SSH. However, ~/.dbus/session-bus/*-0
contains a different value, which doesn't work, and I can't find a file containing the correct value for that variable.
Why would one of my machines require that value to be changed, while the rest don't? If that behavior makes sense or is complicated to correct, where else would I look to find the correct value for that variable?
DBUS_SESSION_BUS_ADDRESS=$(ps -fwu $(whoami) | sed -n 's/.*[d]bus.*--address=\(.*\)/\1/p')
Not perfect, not reliable, but should work most of the time.
– zeppelin Nov 01 '16 at 21:33