Gentoo Archives: gentoo-user

From: "J. Roeleveld" <joost@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: Unlocking Plasma desktop in Gentoo without systemd
Date: Wed, 13 Sep 2017 09:07:51
Message-Id: 16558269.VYKaH625ab@eve
In Reply to: [gentoo-user] Re: Unlocking Plasma desktop in Gentoo without systemd by Michael Palimaka
1 On Tuesday, September 12, 2017 2:13:32 PM CEST Michael Palimaka wrote:
2 > On 09/12/2017 05:04 AM, Daniel Frey wrote:
3 > > According to a comment in the bug, you can try to figure out which
4 > > session it is (ck-list-sessions) and look for the X11 display property
5 > > set. This will not work (or could be difficult) if you have several
6 > > users using KDE at the same time and can't tell the sessions apart.
7 > >
8 > > Once you figure that out, remember the session name and:
9 > >
10 > > # su -c 'dbus-send --system --print-reply \
11 > > --dest="org.freedesktop.ConsoleKit" \
12 > >
13 > > /org/freedesktop/ConsoleKit/<session name> \
14 > >
15 > > org.freedesktop.ConsoleKit.Session.Unlock'
16 >
17 > If there a nice way to wrap this up in a script I'd be interesting in
18 > shipping this for non-logind systems.
19
20 There is:
21 joost@eve ~ $ cat /usr/local/bin/unlock-screens.sh
22 ck-list-sessions | grep Session | sed 's/\(.*\):/dbus-send --system --print-
23 reply --dest\=\"org.freedesktop.ConsoleKit\" \/org\/freedesktop\/ConsoleKit\/
24 \1 org.freedesktop.ConsoleKit.Session.Unlock/' | sh
25
26 joost@eve ~ $ cat /usr/local/bin/lock-screens.sh
27 ck-list-sessions | grep Session | sed 's/\(.*\):/dbus-send --system --print-
28 reply --dest\=\"org.freedesktop.ConsoleKit\" \/org\/freedesktop\/ConsoleKit\/
29 \1 org.freedesktop.ConsoleKit.Session.Lock/' | sh
30
31
32 I build these when I encountered this same issue nearly a year ago. I run them
33 as "root" and they will (un)lock ALL X-sessions.
34
35 > Another option is sys-auth/elogind, which provides the logind interface
36 > and tools (like loginctl) for non-systemd systems. This is what I've
37 > been testing with OpenRC for some time.
38
39 If it works better, I have no issue with it being pulled in.
40
41 > I read that ConsoleKit is also supporting the logind dbus interface now.
42 > This would in theory make it easy to create a tool to unlock the
43 > session, but I haven't had a chance to test it yet.
44
45 Better solutions are always welcome.
46
47 --
48 Joost