<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jan 4, 2014 at 4:17 AM, Kevin Krammer <span dir="ltr"></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im"><br>
> David L wrote:<br>
> > I just upgraded to Kubuntu 13.10 and a script that used to work for me stopped<br>
> > working.  Specifically, I had a script that I ran from a cron job that<br>
> > locked the screen.  The script looks like this:<br>
> ><br>
> > #!/bin/bash<br>
> > export DISPLAY=:0.0<br>
> > export PATH=/usr/lib/x86_64-linux-gnu/qt4/bin:$PATH<br>
> > qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock<br>
> ><br>
> > The same thing happened after upgrading from Mint 15 to Mint 16.<br>
> ><br>
> > Now I get this error when I use this previously working script from ssh or<br>
> > a cron job:<br>
> ><br>
> > Service 'org.freedesktop.ScreenSaver' does not exist.<br>
> ><br>
> > It still works from a local KDE session.<br>
> ><br>
<br></div></blockquote><div><snip> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">
</div><br>
@David: just to see if it would work with the actual bus address being<br>
available:<br>
- in your main session, get the value of $DBUS_SESSION_BUS_ADDRESS<br>
- in your ssh session, set that variable to that value and try qdbus again<br>
<br></blockquote><div>That worked.  Thanks!  So I guess if I run a startup script that copies that variable to a file and then read that file from my cron job, that should do it.  I'll try it later and respond if it doesn't work.<br>
<br></div><div>Sorry if this wasn't an appropriate question for this list, but I thought this was the way to lock the screensaver from the command line in KDE per this (admittedly Ubuntu) answer:<br><br><a href="http://askubuntu.com/questions/61339/what-is-the-screen-locking-mechanism-under-kde">http://askubuntu.com/questions/61339/what-is-the-screen-locking-mechanism-under-kde</a><br>
</div><div><br></div><div>So, if there is a better way to lock/unlock the screen in KDE, let me know what it is.  I use this to unlock:<br><br>qdbus | perl -ne 'qx/kquitapp $1/ if /(kscreenlocker_greet-\d+)/'<br><br>
</div><div>Thanks again,<br><br></div><div>      David<br><br></div></div></div></div>