qdbus /ScreenSaver Lock fails

Kevin Krammer krammer at kde.org
Sun Jan 5 15:53:41 GMT 2014


On Sunday, 2014-01-05, 07:16:51, David L wrote:
> On Fri, Jan 3, 2014 at 10:28 PM, Duncan wrote:

> > Seriously, a dbus call to org.FreeDesktop.ScreenSaver might happen to
> > work on a kde desktop (or not, thus this thread), but it's not
> > org.kde... , which should be a hint that perhaps either your distro lists/
> > forums or the freedesktop.org lists/forums might be more appropriate.
> > (I'd try the distro first.)

The service name or its prefix does not need to be org.kde in order to be 
relevant here.
org.freedesktop prefixed service names usually refer to things that work 
across different desktops/worspace implementations.
Whether the service in question is always the same (shared implementation) or 
vendor specific (shared interface/specification) is sometimes hard to tell.

D-Bus viewers such as qdbusviewer, D-Feet or, on the commandline, qdbus 
usually enable us to see the difference.

For example the relevant output of qdbus on my session is:
:1.10
 org.freedesktop.ScreenSaver
 org.kde.ksmserver
 org.kde.ksmserver-3932
 org.kde.screensaver

Meaning the D-Bus connection ":1.10" is also known as 
org.freedesktop.ScreenSaver, org.kde.ksmserver and so on.
Since KDE applications that use D-Bus usually register their name-PID 
combination as one of those names automatically, we can identify the actual 
service implementor as KDE's session manager KSMServer.

> Did that, no luck.  And I thought qdbus was related to KDE, so I tried
> here.

qdbus is a tool shipped by Qt, a commandline tools to interact with D-Bus 
services.
So it is not related to KDE but very likely present on a system that runs KDE 
Plasm workspace.

> I guess a more appropriate question for here is how do I lock my KDE
> desktop from a script run from cron?

Since your script used to work and still works when run inside the KDE session 
then I guess the best way forward is to find out why it does not work anymore 
when run by cron.

Since you have confirmed in your other reply that it works if the D-Bus 
address is available to the script, do you get any error when you run qdbus in 
the SSH session and have just exported DISPLAY?

Regarding your idea to write the address into a file, that actually already 
happens as well, see ~/.dbus/session-bus

Cheers,
Kevin
-- 
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/20140105/71ba776e/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