Automatic screen lock when leaving desk

Chad Perrin perrin at
Tue Jul 14 20:49:46 UTC 2009

On Tue, Jul 14, 2009 at 05:32:01PM +0200, Frederique Rijsdijk wrote:
> Hi,
> I'm looking for a way to automaticaly lock my X session when I leave my
> desk. Probably just using 'xlockmore -mode blank' or such. But how to
> detect?

Why does it have to be automatic?  Something like xlockmore or slock can
be tied to a keyboard shortcut, such as <Ctrl>+<Alt>+<L>.  If for some
reason you require automatic locking, though, you could perhaps set up
some kind of Bluetooth connection detection if you have a Bluetooth
enabled cellphone in your pocket (or something else that would work as a
Bluetooth token) and if your computer has the right hardware.  I imagine
writing a daemon in Perl or Ruby that checks for loss of a Bluetooth
connection would be easier than getting Bluetooth working in the first
place might be, depending on the state of Bluetooth support in FreeBSD.

I'm not really well-versed in the ephemera of what is used to determine
"inactivity" on a computer, but if it's reasonably easy (or if there's a
Perl module for it), that seems like the obvious way to handle it --
though of course that may present problems, such as false positives on
detecting "inactivity" when watching a movie on the computer or something
like that.

Chad Perrin [ original content licensed OWL: ]
Quoth Paul Graham: "SUVs are gross because they're the solution to a
gross problem. (How to make minivans look more masculine.)"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url :

More information about the freebsd-questions mailing list