1

I would like any user's GUI session to be logged out in 15 minutes of inactivity. stock Ubuntu Desktop 18.04 (gnome, systemd, etc). The optimal solution is native (shell script, built in file setting, etc), and not from a PPA (gov space restrictions).

I am aware of How do I restrict my kids' computing time?, but this question addresses a specific time-of-day, not inactivity.

cawwot
  • 332
  • you can already do something like that inside System parameter -> Luminosity and lock, just change the time to shutdown the screen to 15 min and enable "Lock" after "Screen shutdown" – damadam Jul 23 '18 at 15:00
  • The fact is that "inactivity" cannot be well defined programmatically, and so this is not a very feasible thing to do. Is locking the screen not enough here? – dobey Jul 23 '18 at 15:01
  • The session must be actually logged out, unfortunately. I would be ok with the timer used for the screen lock being applied to log out though; that logic seems good enough. – cawwot Jul 23 '18 at 15:17
  • Lock screen after 15 minutes us better than logging out because you could loose all your unsaved work in open files. – WinEunuuchs2Unix Jul 23 '18 at 17:47

1 Answers1

2

It looks like the autolog package fills this requirement:

autolog - Log out idle users http://manpages.ubuntu.com/manpages/bionic/man8/autolog.8.html

The time to logout can be set in /etc/autolog.conf for users, groups, etc. Additionally it provides warnings and grace periods so work is not lost.

cawwot
  • 332