Re: locking the console
On Tue, Dec 07, 1999 at 05:32:05PM -0900, Ethan Benson wrote:
> On 7/12/99 Rob Mahurin wrote:
>
> >
> >Is there a program that will lock my text consoles for me if I'm idle
> >for a while? Something like:
> >
> >while !KeyboardInterrupt /* nobody's typing */
> > sleep 5m /* OK, they're really gone forever */
> > clear
> > vlock --all
> >
> >Or something. xlock with the timer but without the X.
>
> this would be nice, but it would have to run in the background
like xscreensaver & xlockmore do, is what I had in mind.
> unattached to the tty, I don't think vlock will work properly if its
> started that way..
>
> just as a quick test i tried:
>
> [eb@plato ~]$ vlock &
Good point. Instead you can use 'openvt -sw -- vlock' (which is not
really useful without the -a). (the openvt man page says that this
should switch the console back when vlock is done, but it doesn't, bug
47132.)
After some playing I have something that works from tty1 (would be
better without the -s -w bug):
23:15 ~ $ cat > t
#!/bin/bash
openvt -w -s -- vlock
chvt 1
deallocvt
23:15 ~ $ chmod +x t
23:15 ~ $ chvt 2 ; sleep 1 ; ./t
So I could scan /dev/tty[1-9]* to make sure nobody has typed anything
recently, then run this from the background. Or something. If nobody
else has written it I'll do it over Christmas.
Rob
--
Today is what happened to yesterday.
Reply to: