2

I have a couple of services running in a GNU-screen session on top of Bash. Because one of the services contain sensitive data I have to constantly either close the terminal completely or lock the screen session using C^a X. Sometimes I forget to close or lock this window when leaving my desk which is not good so I want to know.

How can I get GNU-screen to automatically lock the window after XX minutes of non-use or get Bash/terminal emulator to execute the C^a X command after a time interval? I am aware I can lock the screen using the window manager, but I would like this in addition just in case.

Cheers.

2 Answers 2

4

See the idle option from screen:

idle [timeout [cmd args]]

Sets a command that is run after the specified number of seconds inac‐ tivity is reached. This command will normally be the "blanker" command to create a screen blanker, but it can be any screen command. If no command is specified, only the timeout is set. A timeout of zero (ot the special timeout off) disables the timer. If no arguments are given, the current settings are displayed.

2
  • 3
    Just to clearify: To get screen to lock itself after for example 4 minutes you would add a line in your ~/.screenrc file containing the following idle 300 lockscreen.
    – Mogget
    May 22, 2013 at 10:20
  • @Mogget: You should post an answer, because without your comment the answer is not usable. Jul 9, 2017 at 7:31
2

@problemofficer mentioned I should put an answer in this thread since withouth the comment I made, the answer made to this post is not complete.

To make a screen session automatically lock itself after for example 5 minutes do the following; Add a line in your ~/.screenrc file containing the following.

idle 300 lockscreen

Any current screen sessions has to be re

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .