FVWMEvent

so, here’s a thought, I am sure the answer is simple:

Can I specify in my FVWMEvent instance that if we enter FVWMEvent via an window exiting we will do FuncA, whereas if we enter FVWMEVent via the current window becoming iconfied, we do FuncB?

I looked at the man page, but couldnt’ quite identify how to do this… if it is possible.

If anyone has done something liek this before (maybe I’m just totally misreading the man pAGE) I’d appreciate an example.

Thanks,
Skender

You mean something like this:

DestroyModuleConfig FE: *
*FE: Cmd function
*FE: destroy_window FVWMFunc1
*FE: iconify FVWMFunc2

– Thomas Adam

that’s exactly it. Thanks.
-Skender

I have a question about fvwmevent, too…
I would like to have a event happen in a random amount of time (3h - 5h)
and that event would be random of two possibilities, either a random sound, or a random function.
I have no idea how to proceed. Could someone help?

You won’t need FvwmEvent for this (from what you’ve written there). There’s any number of ways you could do this — it might be more beneficial running an external script to do this – so FvwmCommand will probably help you here. You could even use cron for this purpose.

Can you supply a few more details about what you want to have happen?

– Thomas Adam

Well, the idea came from when I was reworking my shodan-theme to be fvwm-themes compliant and I thought it would be neat if I could somehow add to the theme something that made her say something (that is, play a .wav -file) every now and then to spook the user :smiling_imp: , or to swiggle around all the windows on screen, or some other distortion/distraction.
(Because she is a crazy AI and all that… :wink: )

I thought if the effect is always the same at the same time intervals, it would grow old real quick, hence some randomness would be nice.

FvwmScript should be a pretty easy way to go. Something along these lines…

[code]WindowTitle {RandomStuff}

Init
Begin
Set $randnum = (GetOutput {exec bash_script_random_number} 1 -1)
End

PeriodicTasks
Begin
If (RemainderOfDiv (GetTime) $randnum)==0 Then
Begin
do_weird_shit
Set $randnum = (GetOutput {exec bash_script_random_number} 1 -1)
End
End[/code]

Ok, that solves the random time issue, thanks :slight_smile:

But there’s still the issue of making randomness of the thing to perform.
Let’s say I have aaa.wav, bbb.wav, ccc.wav, FunctionA, FunctionB, FunctionC of which I’d like to randomly pick one to perform/play. Can it be added to the above FvwmScript?