Subject: Re: FVWM: Window placement

From: Marc-Jano Knopp <[email-masked]>
Date: Sun, 17 Feb 2002 20:50:56 +0100

On Sun, 17 Feb 2002 at 16:43:50 (+0000), Andy Arbon wrote:
> I'd like to be able to have new windows appear centered around the 
> location of the mouse pointer [...]. Is there any way to accomplish
> that with FVWM?

Yes :)

> I've not seen an existing placement style that sounds right.

That would be nice! Because my solution is a hack, I think:

~/.fvwm/modules:

  DestroyFunc FuncFocusWindow
  AddToFunc   FuncFocusWindow

  # Move WINDOW to MOUSE position
  + I WindowId $0 ("xterm-kb") Focus
  + I WindowId $0 ("xterm-kb") Move m-10p m-10p

  # Same for a window reading input for dict
  + I WindowId $0 ("DICT") Focus
  + I WindowId $0 ("DICT") Move m-10p m-10p

  # Move MOUSE to WINDOW position
  + I WindowId $0 ("xterm-ptr-kb") WarpToWindow 50 50

And in ~/.fvwm/bindings:

  Key n   A       CM      Exec exec xterm -title xterm-kb
  Key n   A       CM2     Exec exec xterm -title xterm-kb
  Key m   A       CM      Exec exec xterm -title xterm-ptr-kb
  Key m   A       CM2     Exec exec xterm -title xterm-ptr-kb

  Mouse 1         A       CM      Exec exec xterm -title DICT -e dict "$(xcb -p 0)"
  Mouse 1         A       CM2     Exec exec xterm -title DICT -e dict "$(xcb -p 0)"

  Key Return      A       SM      Exec exec xterm -title DICT -e /usr/local/bin/askdict
  Key Return      A       SM2     Exec exec xterm -title DICT -e /usr/local/bin/askdict

So, Ctrl-Alt-n pops up an xterm at the current mouse pointer position,
and Ctrl-Alt-m pops up an xterm and warps the mouse pointer to its
position.

Selecting a word with the mouse in an xterm and then pressing
Ctrl-Alt-LeftMouseButton anywhere pops up an xterm with dict $WORD
right under your mouse pointer.

Hitting Shift-Alt-Enter pops up a dict window under the mouse pointer.

Best regards

  Marc-Jano

--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].