Ahh. Thanks. It's obvious when pointed out.
 It was the fact that it worked in the root window that threw me
off. But then looking at the man page, $[w.id] resolves to the text
if there is no window bound at the time of the command. So
it gets passed as is to the ALL command in that case.

Thanks for the help.

Tom.

On Tuesday, June 24, 2003, at 02:55 AM, Dominik Vogt wrote:

On Mon, Jun 23, 2003 at 09:16:59PM -0400, Thomas R. Dean wrote:
Hi. I've been using fvwm since I don't remember when, somewhere back
around Redhat 5 anyways. Great WM, not as heavyweight as some
of the others, and not as visually busy as the others as well.

Anyhow, I just recently upgraded the Motherboard in my system and
the keyboard.  The new keyboard has multimedia keys and I wanted
to used them to control XMMS.  I also have a mac powerbook and having
the volume keys work regardless of the application is very convenient.

Target System is RedHat 9,  FVWM version 2.4.16.

So i've done the following:
 Used xmodmap in .xinitrc to bind XF86AudioRaiseVolume, etc. to the
  appropriate keycodes. (and verified with xev)

Added the following to my .fvwm2rc:

Key XF86AudioRaiseVolume A A    ALL (XMMS*) Echo up $[w.id] $[w.name]
Key XF86AudioLowerVolume A A ALL (XMMS*) Echo down $[w.id] $[w.name]
Key XF86AudioMute A A    ALL (XMMS*) Echo mute $[w.id] $[w.name]

I was going to replace echo with an exec to execute a command that will
send an KP_Up or KP_Down event directly to the XMMS window (which
will adjust the volume).  As I understand the man page, the $[w.id] is
supposed to return
the window id that the command is called on. There are two xmms windows, the
main control and the playlist window.  Each press of the button should
echo two window
ids (and the window name).

If the focus is on the root, then the correct window ids and titles are
echoed:

 0x1400066 XMMS - song title info
 0x14000cf  XMMS Playlist

All is well so far. However, if any window has the focus then I get the
window id of the window with the focus -- twice. So if the focus is on
an xterm, I get two lines of:
   up 0x1200026 xterm.

I've looked through several months worth of archive and used google to
search
the site, but I haven't found any help.

Do I have the correct interpretation of $[w.id]? If not, what should I use?

  All (XMMS*) Echo $[w.id]

is actually two commands and thus the $[w.id] string is expanded
twice.  The first time is *before* the All command is run.  At
that moment, the context window is the window with the focus and
$[w.id] is replaced by its window id.  You need to protect the
$[w.id] from this step of variable expansion by adding additional
'$'s in front of it (even for me it's usually trial and error to
find out the correct number of '$'s):

  Key foo a a  All (XMMS*) Echo $$$[w.id]
                               ^^^^^

Bye

Dominik ^_^  ^_^
--
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 PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]


--
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 PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]

Reply via email to