On Tuesday, September 12, 2017 2:13:32 PM CEST Michael Palimaka wrote: > On 09/12/2017 05:04 AM, Daniel Frey wrote: > > According to a comment in the bug, you can try to figure out which > > session it is (ck-list-sessions) and look for the X11 display property > > set. This will not work (or could be difficult) if you have several > > users using KDE at the same time and can't tell the sessions apart. > > > > Once you figure that out, remember the session name and: > > > > # su -c 'dbus-send --system --print-reply \ > > --dest="org.freedesktop.ConsoleKit" \ > > > > /org/freedesktop/ConsoleKit/<session name> \ > > > > org.freedesktop.ConsoleKit.Session.Unlock' > > If there a nice way to wrap this up in a script I'd be interesting in > shipping this for non-logind systems.
There is: joost@eve ~ $ cat /usr/local/bin/unlock-screens.sh ck-list-sessions | grep Session | sed 's/\(.*\):/dbus-send --system --print- reply --dest\=\"org.freedesktop.ConsoleKit\" \/org\/freedesktop\/ConsoleKit\/ \1 org.freedesktop.ConsoleKit.Session.Unlock/' | sh joost@eve ~ $ cat /usr/local/bin/lock-screens.sh ck-list-sessions | grep Session | sed 's/\(.*\):/dbus-send --system --print- reply --dest\=\"org.freedesktop.ConsoleKit\" \/org\/freedesktop\/ConsoleKit\/ \1 org.freedesktop.ConsoleKit.Session.Lock/' | sh I build these when I encountered this same issue nearly a year ago. I run them as "root" and they will (un)lock ALL X-sessions. > Another option is sys-auth/elogind, which provides the logind interface > and tools (like loginctl) for non-systemd systems. This is what I've > been testing with OpenRC for some time. If it works better, I have no issue with it being pulled in. > I read that ConsoleKit is also supporting the logind dbus interface now. > This would in theory make it easy to create a tool to unlock the > session, but I haven't had a chance to test it yet. Better solutions are always welcome. -- Joost