A search for the
tmout flagged threads found one suggesting a script based on the
who command or just changing to the
ksh as your default, and the
ksh gives a 1 minute warning message prior to terminating the shell.
Note, however, that the
TMOUT variable is a
shell-specific setting, not a
session-specific one. If you look at the output of
who -uT you'll see something like this:
Code:
$ sudo who -uT
[sudo] password for Peter:
Peter ? :0 2009-05-15 05:58 ? 2658
Peter + pts/0 2009-05-15 05:59 00:37 2756 (:0)
Peter - pts/1 2009-05-15 06:23 . 5261 (:0.0)
Note that the X-session (
:0) is flagged as having an "unknown" message reception state, and an unknown idle time.
Bottom line: I think you'll need to write a "widget" to monitor your X-server activity and add it to the X-server
init script if you want to be able to automatically terminate an idle X session.
Or, here's a thought: Use one of the power management applications, and set the actions you want to happen after specific idle times.