Use a function when a program does something?

I use tint2 and would like to call a thumbnail function when it minimizes a window. Is this possible? If not is my only alternative making a taskbar through FVWM so that it has the functionality I want?

Edit - Unfortunately it looks like I can’t use FvwmEvent because by the time FVWM tells the module the window is iconified there isn’t a screen to take a snapshot of, so I guess it’s time to use something besides tint2.

mail-archive.com/fvwm@lists. … 00082.html

Search these forums. Essentially:

DestroyModuleConfig a:*
*a: iconify run_something

AddToFunc StartFunction I Module FvwmEvent a

– Thomas Adam

So FVWM will detect that some other application iconified (or whatever else) a program? Neat!

I’m also trying to cycle through status windows by having FVWM close them then open up another one w/ different information. The problem is that since I have it close the window the function also closes the instance of the program I’m using. What can I put between these two commands so that FVWM doesn’t also close the new instance of the program I’m trying to launch?

[code]+ I All (name) Close

  • I None (name) Exec name -different -options[/code]

What are you talking about?

– Thomas Adam

I have some functions to launch the same program with different options. When I’m starting one I would like the function to kill whatever instance is already running before starting the program up with different options, however if I use Close it appears to kill both the existing program w/ whatever options and the new instance w/ different options I’m trying to run. What can I add to that function so that it kills the existing version, then runs the new version? I suppose I could just give each version w/ different options a different name and kill all the other versions when launching a specific one, but isn’t there something in fvwm like bash where I could run “killall program ; program -options” and have the old instance killed and a new one run w/o having to give everything a different name?

Put your config somewhere (in a pastebin).

– Thomas Adam

[code]DestroyFunc Elog
AdToFunc Elog

  • I All (monitor) Close
  • I None (monitor) Exec aterm -tr -name
    monitor -g 120x10+0-620 -e
    bash -c ‘tail -f /var/log/everything.log;read’&

DestroyFunc Dlog
AdToFunc Dlog

  • I All (monitor) Close
  • I None (monitor) Exec aterm -tr -name
    monitor -g 120x10+0-620 -e
    bash -c ‘top;read’&

Key 1 A C Elog
Key 2 A C Dlog

Style “monitor” NoTitle, WindowListSkip, NoHandles, Sticky, BorderWidth 0, Layer 0, StaysOnBottom, NoIcon[/code]

The short cuts will toggle aterm on/off instead of killing the old version and starting the new one immediately.

Well I’m not a power fvwm user, but why not to launch your terminals with different window names and then make fvwm close window with definite name?

I might also try something like Previous instead of All.

Previous doesn’t close “monitor” for some reason. I probably will give everything a different name, but it seems kinda kludgy. I would think I could use something like PipeRead or FvwmCommand but either those won’t work or I’m not using them properly.

How about you stop failing?

Of course what you’ve got is going to close every single instance and start a new one. To do what you want to do you have a few optons:

  1. Give the windows unique names (IndexedWindowName?)
  2. Give the windows unique names (IndexedWindowName?)
  3. Give the windows unique names (IndexedWindowName?)

Who’d have thought?

– Thomas Adam

Hmmm. Seems like this is exactly what I need for one of my strange ideas.

And get awesome? Having to paste and slightly modify styles/xdefaults is hard! :wink:

It just seems so weird that FVWM doesn’t have anything I could use that would have a function do something then stop doing that and do something else.

Yesterday I was misusing fvwm (again) and I needed it to do things one after another. Couple of tests showed that [code]+ I This

  • I That[/code] would be executed in seemingly random order, so I just wrapped the function into a bash script and then called it from my config. Barbaric yet did exactly what I wanted.

That’s a different question. Funnily enough I wrote this some time ago:

fvwmwiki.xteddy.org/Functions/Fu … onisation/

But please stop failing – there’s no need for a bash script here at all.

– Thomas Adam

Thanks Thomas.