You are not logged in.

#1 2017-10-09 16:50:03

svanberg
Member
Registered: 2009-07-16
Posts: 88

Automatically lock X session or console after inactivity

Hi,

I would like to lock my computer after a couple of minutes of inactivity (using, in this case physlock) and it shouldn't matter if I'm in a X session or console. What is the best or preferred way to do it? Thanks!

Offline

#2 2017-10-09 17:01:29

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,532
Website

Re: Automatically lock X session or console after inactivity

/etc/systemd/logind.conf

IdleAction=lock


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2017-10-09 17:08:20

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Automatically lock X session or console after inactivity

In a console - TMOUT.

Offline

#4 2017-10-09 17:50:08

seth
Member
Registered: 2012-09-03
Posts: 51,273

Re: Automatically lock X session or console after inactivity

on x11 use xautolock - logind afaik only will work with gnome atm. (requires a signal from the desktop sedssion)

Online

#5 2018-02-03 21:08:27

svanberg
Member
Registered: 2009-07-16
Posts: 88

Re: Automatically lock X session or console after inactivity

Good suggestions! I think I go with xautolock. How can I achieve automatically lock for console and not for e.g. terminals when X is running?

Offline

#6 2018-02-03 21:20:58

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,532
Website

Re: Automatically lock X session or console after inactivity

vlock.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2018-02-03 21:21:26

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

Re: Automatically lock X session or console after inactivity

https://github.com/WhyNotHugo/systemd-lock-handler
Maybe you can use this (or a script similar to handler.py) to react to the lock event of systemd-logind and then run physlock.

Last edited by progandy (2018-02-03 21:23:32)


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

Offline

Board footer

Powered by FluxBB