On Wed, 28 Sep 2005, Zack Brown wrote:

Hi folks,

I wasn't able to find this in any FAQ, so maybe it should be added.

Basically, when I switch desktops (I use alt-F* key bindings for this), I
want the screen to remember which page it was in on each desktop, and jump
there so I can pick up what I was working on without further navigation
through the desktop. (I use a 30x40 desktop or larger, so this is a really
good
feature for me).

I figured out a way that works. Check it out:



DestroyFunc RememberDesk
AddToFunc RememberDesk
+ I SetEnv VillageDeskX$[desk.n] $[page.nx]
+ I SetEnv VillageDeskY$[desk.n] $[page.ny]
+ I PipeRead `echo "GotoDeskAndPage $0 ${VillageDeskX$0} ${VillageDeskY$0}"`

# move from desktop to desktop
Key F1           A       M       RememberDesk 0
Key F2           A       M       RememberDesk 1



It took me awhile to figure out that PipeRead could be used to merge variable
names together like that.

My question is this:

The above method works, but because it invokes a new shell each time, it is
relatively slow, taking maybe half a second on my system. I'm wondering if
anyone on this list could come up with something faster.

A friend of mine accomplished the fast behavior I want with a custom module,
but that seems a bit heavy handed for this sort of problem. Is there a
better way than either of our solutions?

Be well,
Zack

With the current CVS version (or any snapshot after September 19) FVWM is capable of nested variable expansion.

That is you will be able to do
 + I GotoDeskAndPage $0 $[VillageDeskX$0] $[VillageDeskY$0]
istead of the PipeRead invoking a shell.

/Viktor

Reply via email to