Scripting the lock-screen function in xscreensaver?

Louis LeBlanc FreeBSD at keyslapper.org
Wed Nov 10 08:48:47 PST 2004


On 11/10/04 09:20 AM, Jesse Sheidlower sat at the `puter and typed:
> 
> I'm running xscreensaver as part of Gnome, and would like to be able
> to control it in a way I can't figure out.
> 
> Most panel icons can right-click to a "properties" window that gives,
> among other things, the command that will be executed by clicking on
> that icon. The "lock" icon does not have this; the properties window
> just controls the aspects of the display, the timing of the blanking,
> etc.
> 
> I'd like to change the action of this icon so that, before locking
> the screen, it executes (for example) "ssh-add -D" to clear all of
> my ssh-agent's identities.
> 
> Similarly, I'd like to know the command for locking so that I can put
> it elsewhere; for example, into an rc.suspend file, so that if I
> close my laptop's cover it will automatically lock the screen.
> 
> This at least I would have expected to find in the man page, but 
> perhaps I missed it.

Not sure how to do it in gnome, but I use fvwm2 and I've tied the scroll
lock key to a macro as follows:

Key Scroll_Lock A       A       Function Sleep

The function Sleep is defined as follows:

DestroyFunc Sleep
AddToFunc Sleep
+ "I" Exec exec /usr/X11R6/bin/xscreensaver-command -lock

So anytime I get up from my desk, I just tap the ScrLk key and
xscreensaver locks up.

Gnome is a backend desktop that runs another WM, isn't it?  I've
actually been thinking about trying to get fvwm2 running over gnome (now
that I have a decent machine with some stones).  This is the way I'd do
it though.  Check the documentation for your WM for keybindings, and
that should give you the rest.

Good luck
Lou
-- 
Louis LeBlanc               FreeBSD at keyslapper.org
Fully Funded Hobbyist, KeySlapper Extrordinaire :)
http://www.keyslapper.org                     Ô¿Ô¬

Research is to see what everybody else has seen, and think what nobody
else has thought.


More information about the freebsd-questions mailing list