qdbus /ScreenSaver Lock fails

Kevin Krammer krammer at kde.org
Sat Jan 4 12:17:23 GMT 2014

On Friday, 2014-01-03, 22:01:07, Rex Dieter wrote:
> David L wrote:
> > I just upgraded to 13.10 and a script that used to work for me stopped
> > working.  Specifically, I had a script that I ran from a cron job that
> > locked the screen.  The script looks like this:
> > 
> > #!/bin/bash
> > export DISPLAY=:0.0
> > export PATH=/usr/lib/x86_64-linux-gnu/qt4/bin:$PATH
> > qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock
> > 
> > The same thing happened after upgrading from Mint 15 to Mint 16.
> > 
> > Now I get this error when I use this previously working script from ssh or
> > a cron job:
> > 
> > Service 'org.freedesktop.ScreenSaver' does not exist.
> > 
> > It still works from a local KDE session.
> > 
> > How do I get the old behavior back?  I used it to limit my kids screen
> > time.
> It shouldn't have ever worked if run from outside the kde session.  (ie,
> only processes inside the session have access to the session bus).

Setting DISPLAY should allow that I think.
If I launch qdbus on an ssh session to localhost, I get this

Could not connect to D-Bus server: org.freedesktop.DBus.Error.NotSupported: 
Unable to autolaunch a dbus-daemon without a $DISPLAY for X11

If I set DISPLAY=:0 and run qdbus again, it correctly lists the registered 
connections on my session's bus.

@David: just to see if it would work with the actual bus address being 
- in your main session, get the value of $DBUS_SESSION_BUS_ADDRESS
- in your ssh session, set that variable to that value and try qdbus again


Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde/attachments/20140104/d2ed6c64/attachment.sig>
-------------- next part --------------
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.

More information about the kde mailing list