You are not logged in.

#1 2021-03-06 14:20:25

tea_niugnep
Member
Registered: 2021-02-16
Posts: 30

[Solved]xss-lock don't react to lock event from systemd-logind

I use i3wm as my window manager and I use i3lock as the screenlock application. And in my i3 config, I execute xss-lock:

exec --no-startup-id xss-lock --ignore-sleep i3lock

I only want xss-lock react the lock event.

I'm sure xss-lock is running by the pgrep command.

And althou I use acpid to manage acpi events, I still use the logind.conf to manage system idle event. (I think system idle is not a acpi event)
So in my logind.conf, I have

IdleAction=lock
IdleActionSec=2min

And by

systemctl status systemd-logind.service

, Im sure the Idle event is sent:

Mar 06 22:11:31 X1carbon systemd-logind[286]: System idle. Doing lock operation.
Mar 06 22:14:01 X1carbon systemd-logind[286]: System idle. Doing lock operation.
Mar 06 22:16:31 X1carbon systemd-logind[286]: System idle. Doing lock operation.
Mar 06 22:18:31 X1carbon systemd-logind[286]: System idle. Doing lock operation.

But xss-lock has no action... I don't where is the problem.

Of course I'm sure i3lock itself can work normally.

Anyone can give me a help? Thanks a lot.

Last edited by tea_niugnep (2021-03-06 17:14:23)

Offline

#2 2021-03-06 15:11:45

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: [Solved]xss-lock don't react to lock event from systemd-logind

Do you run i3wm with a login manager or from a terminal?

I use lightdm and run xss-lock with:

exec --no-startup-id xss-lock -l -- i3lock -n

You can test it with

loginctl lock-session

Last edited by progandy (2021-03-06 15:12:41)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#3 2021-03-06 16:26:25

tea_niugnep
Member
Registered: 2021-02-16
Posts: 30

Re: [Solved]xss-lock don't react to lock event from systemd-logind

@progandy
Thanks for your advice!

yes, I run i3wm, but without a login manager, just use startx from terminal

I use your code in my i3 config, and by

loginctl lock-session

, i3 lock started normally.

However, the xss-lock still has no response to SystemIdle event from systemd-logind.service, my laptop still can't start i3lock by xss-lock normally

I guess problem is from xss-lock?  Maybe SystemIdle is also an ACPI event and should be handled by acpid?

Offline

#4 2021-03-06 16:38:34

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,552

Re: [Solved]xss-lock don't react to lock event from systemd-logind

man logind.conf wrote:

       IdleAction=
           Configures the action to take when the system is idle. Takes one of "ignore",
           "poweroff", "reboot", "halt", "kexec", "suspend", "hibernate", "hybrid-sleep",
           "suspend-then-hibernate", and "lock". Defaults to "ignore".

           Note that this requires that user sessions correctly report the idle status to the
           system.
The system will execute the action after all sessions report that they are
           idle, no idle inhibitor lock is active, and subsequently, the time configured with
           IdleActionSec= (see below) has expired.

IdleAction is close to useless unless you use gnome (and maybe KDE)

=> https://wiki.archlinux.org/index.php/Se … k#xss-lock

Offline

#5 2021-03-06 16:42:45

tea_niugnep
Member
Registered: 2021-02-16
Posts: 30

Re: [Solved]xss-lock don't react to lock event from systemd-logind

Ok.. Thanks
So best way to listen system inactivity is to use xset with xss-lock? (not Gnome nor KDE)

Offline

#6 2021-03-06 17:13:46

tea_niugnep
Member
Registered: 2021-02-16
Posts: 30

Re: [Solved]xss-lock don't react to lock event from systemd-logind

Ok I use xautolock to implement the automatically screenlock after inactivity simply, thanks everyone

Offline

#7 2021-03-06 18:58:06

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: [Solved]xss-lock don't react to lock event from systemd-logind

You should not need xautolock, set up the xorg screensaver (xset s ...) and xss-lock should react to it.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#8 2021-03-06 20:32:58

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,552

Re: [Solved]xss-lock don't react to lock event from systemd-logind

As the link explains, you can have xss-lock respond to the screensaver or DPMS.
xautolock is an alternative approach to the problem, not a complementary.

Offline

#9 2021-03-07 03:18:07

tea_niugnep
Member
Registered: 2021-02-16
Posts: 30

Re: [Solved]xss-lock don't react to lock event from systemd-logind

Although solved, but I'm confused with that screen off after 10 minutes (I don't know how to describe it accurately, not lock nor sleep, just screen off, do anything the screen turns on)

This problem is related to DPMS or anything? Should I post a new title?

Offline

#10 2021-03-07 07:17:31

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,552

Re: [Solved]xss-lock don't react to lock event from systemd-logind

Probably. Check

xset q
xset -h
man xorg.conf

Offline

#11 2021-03-08 08:03:52

tea_niugnep
Member
Registered: 2021-02-16
Posts: 30

Re: [Solved]xss-lock don't react to lock event from systemd-logind

@seth
Again thanks a lot. I edit /etc/X11/xorg.conf/monitor.conf, and everything goes well.
Finally, I have a question. The DPMS process is blanking->standby->suspend->off, right? So is "DPMS suspend" independent to laptop suspend?

Offline

#12 2021-03-08 08:10:18

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,552

Offline

#13 2021-03-08 08:14:17

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: [Solved]xss-lock don't react to lock event from systemd-logind

Also https://wiki.archlinux.org/index.php/Di … _Signaling

Note that DPMS was developed for CRT monitors, and on LCD displays, there is normally no difference between the standby, suspend and off modes.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#14 2021-03-08 15:32:18

tea_niugnep
Member
Registered: 2021-02-16
Posts: 30

Re: [Solved]xss-lock don't react to lock event from systemd-logind

OK. Again thanks a lot.

Offline

Board footer

Powered by FluxBB