[Nix-dev] xfce: 'lock screen' button

Kirill Elagin kirelagin at gmail.com
Tue May 20 11:01:04 CEST 2014


I do not actually use dm-tool for screen locking, I just thought that it
might work for you =).

For me it does actually work. Kind of.
It starts a new greeter on another VT and switches there. Once I enter my
password it switches back to the VT with my session. The funny thing is
that the active session is not actually locked.

I remember reading in the systemd mailing list, that's what they are going
to do in the future—reuse display managers for
screen locking, so there is no need for separate locking tools (and, AFAIK,
lightdm is currently the only DM that implements this).

I've attached the whole log for your reading pleasure, but here are the
most interesting lines:
11
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[+1554.59s] DEBUG: Seat: Locking
[+1554.59s] DEBUG: Seat: Creating greeter session
[+1554.59s] DEBUG: Seat: Creating display server of type x
[+1554.59s] DEBUG: Using VT 8
[+1554.59s] DEBUG: Seat: Starting local X display on VT 8
<...>
[+1554.59s] DEBUG: Launching process 7031: /usr/bin/X :1 -seat seat0 -auth
/var/run/lightdm/root/:1 -nolisten tcp vt8 -novtswitch
[+1554.59s] DEBUG: DisplayServer x-1: Waiting for ready signal from X
server :1
[+1555.01s] DEBUG: Got signal 10 from process 7031
[+1555.01s] DEBUG: DisplayServer x-1: Got signal from X server :1
[+1555.01s] DEBUG: DisplayServer x-1: Connecting to XServer :1
[+1555.01s] DEBUG: Seat: Display server ready, starting session
authentication
<...>
[+1555.28s] DEBUG: Activating VT 8
[+1555.28s] DEBUG: Locking login1 session /org/freedesktop/login1/session/c2
[+1555.28s] DEBUG: Activating login1 session
/org/freedesktop/login1/session/c3

#### I enter my password ####

[+1555.92s] DEBUG: Session pid=7041: Greeter connected version=1.10.1
[+1562.73s] DEBUG: Session pid=7041: Greeter start authentication for kirrun
[+1562.73s] DEBUG: Session pid=7097: Started with service 'lightdm',
username 'kirrun'
[+1562.75s] DEBUG: Session pid=7097: Got 1 message(s) from PAM
[+1562.75s] DEBUG: Session pid=7041: Prompt greeter with 1 message(s)
[+1562.75s] DEBUG: Session pid=7041: Continue authentication
[+1563.15s] DEBUG: Session pid=7097: Authentication complete with return
value 0: Success
[+1563.15s] DEBUG: Session pid=7041: Authenticate result for user kirrun:
Success
[+1563.15s] DEBUG: Session pid=7041: User kirrun authorized
[+1565.37s] DEBUG: Session pid=7041: Greeter requests session Xsession
[+1565.37s] DEBUG: Seat: Returning to existing user session kirrun
[+1565.37s] DEBUG: Unlocking login1 session
/org/freedesktop/login1/session/c2
[+1565.37s] DEBUG: Activating VT 7
<...>
[+1565.37s] DEBUG: Activating login1 session
/org/freedesktop/login1/session/c2
<...>
[+1565.49s] DEBUG: Seat: Display server stopped
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

As you can see, it actually _did_ tell logind to lock the session, but I'm
running KDE, and KDE's session manager does not respect logind's signals
yet. There exists a patch that implements this, and I saw it merged in the
tree. Probably it's just not in 4.12.5 yet.

So this was my long story of success (almost). Speaking about your log,
it's clear that dm-tool started a new X server on VT8 but the server
crashed for some reason. You should X server's log:

~~~~~~~~
[+1287786.07s] DEBUG: DisplayServer x-1: Logging to /var/log/x-1.log
~~~~~~~

P.S. Right now I'm on my Gentoo laptop so it very well might be that
dm-tool starts the new X server in some weird non-pure way and that's why
it's working here on Gentoo and not on your NixOS. I'll see if this works
for me on NixOS once I get home.


--
Кирилл Елагин


On Tue, May 20, 2014 at 10:53 AM, Sergey Mironov <grrwlf at gmail.com> wrote:

> Thanks! Didn't know i3lock. It works fine.
>
> For the dm-tool, it doesn't work as expected
>
> $ dm-tool lock
> command does nothing and /var/log/lightdm.log contains [see below].
> Could you please compare this snippet with your own?
>
> Regards,
> Sergey
>
> --
> /var/log/lightdm.log (after dm-tool)
>
> [+1287786.07s] DEBUG: Seat: Locking
> [+1287786.07s] DEBUG: Seat: Creating greeter session
> [+1287786.07s] DEBUG: Seat: Setting XDG_SEAT=seat0
> [+1287786.07s] DEBUG: Seat: Creating display server of type x
> [+1287786.07s] DEBUG: Seat: Starting local X display
> [+1287786.07s] DEBUG: Using VT 8
> [+1287786.07s] DEBUG: DisplayServer x-1: Logging to /var/log/x-1.log
> [+1287786.07s] DEBUG: DisplayServer x-1: Writing X server authority to
> /run/root/:1
> [+1287786.07s] DEBUG: DisplayServer x-1: Launching X Server
> [+1287786.07s] DEBUG: Launching process 11047:
> /nix/store/393nb5f1kg32f5m2z388ab2rfdny2q7d-xserver-wrapper :1 -auth
> /run/root/:1 -nolisten tcp vt8 -novtswitch
> [+1287786.07s] DEBUG: DisplayServer x-1: Waiting for ready signal from
> X server :1
> [+1287786.08s] DEBUG: Process 11047 exited with return value 1
> [+1287786.08s] DEBUG: DisplayServer x-1: X server stopped
> [+1287786.08s] DEBUG: Releasing VT 8
> [+1287786.08s] DEBUG: DisplayServer x-1: Removing X server authority
> /run/root/:1
> [+1287786.08s] DEBUG: Seat: Display server stopped
> [+1287786.08s] DEBUG: Seat: Stopping session
> [+1287786.08s] DEBUG: Seat: Session stopped
> [+1287786.08s] DEBUG: Seat: Stopping display server, no sessions require it
>
>
>
> 2014-05-16 17:32 GMT+04:00 Kirill Elagin <kirelagin at gmail.com>:
> > Yeah, and to ask lightdm to lock your session you do `dm-tool lock`.
> >
> >
> > --
> > Кирилл Елагин
> >
> >
> > On Fri, May 16, 2014 at 11:06 AM, Domen Kožar <domen at dev.si> wrote:
> >>
> >> That's how I override default:
> >>
> >> $ type -P xflock4
> >> /home/ielectric/bin/xflock4
> >>
> >> $ cat /home/ielectric/bin/xflock4
> >> scrot /tmp/screen_locked.png
> >> convert /tmp/screen_locked.png -scale 10% -scale 1000%
> >> /tmp/screen_locked.png
> >> killall -SIGUSR1 dunst
> >> DISPLAY=:0.0 i3lock -i /tmp/screen_locked.png --nofork -d
> >> killall -SIGUSR2 dunst
> >>
> >>
> >>
> >> On Fri, May 16, 2014 at 8:56 AM, Sergey Mironov <grrwlf at gmail.com>
> wrote:
> >>>
> >>> Hi. A question to Xfce gurus:
> >>>
> >>> In my current config the 'lock screen' button performs no action. If I
> >>> install xscreensaver, the button will run it, but the login prompt
> >>> window looks a bit .. Xy.  Does anybody know how to connect 'lock
> >>> screen' button with lightdm display manager?
> >>>
> >>> Regards,
> >>> Sergey
> >>> _______________________________________________
> >>> nix-dev mailing list
> >>> nix-dev at lists.science.uu.nl
> >>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
> >>
> >>
> >>
> >> _______________________________________________
> >> nix-dev mailing list
> >> nix-dev at lists.science.uu.nl
> >> http://lists.science.uu.nl/mailman/listinfo/nix-dev
> >>
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20140520/67e082d7/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dm-tool.log
Type: text/x-log
Size: 3615 bytes
Desc: not available
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20140520/67e082d7/attachment-0001.bin 


More information about the nix-dev mailing list