FVWM: Using Schedule reliably

From: Tavis Ormandy <taviso_at_sdf.lonestar.org>
Date: Tue, 11 May 2004 14:50:47 +0100

Hi there, I'm having real trouble understanding how to use schedule
correctly so that my scheduled jobs will work (or at least remain queued)
during periods where, for example, the pointer is grabbed.

I have a function that I would like to continue running every few seconds
testing a condition, and performing an action, until the window is deleted.

basically, like this:

AddToFunc NewWindowFunc
+ I Test (foobar) Exec something
+ I Echo Still running!
+ I Schedule 5000 NewWindowFunc

The idea is to keep a xwd cache of windows while they are unobscured, so
that when they are obscured I can still use screenshots of them, I would
like to use FvwmEvent to start a function like this in the context of all
new windows, then just keep testing every few seconds (the overhead seems
pretty low in my tests). But my scheduled jobs keep dissapearing, can anyone
offer any suggestions?

This is what I have right now, it works, but I would like to be able to just
keep caching without some event happening:

# FvwmEvent runs on some events:
AddToFunc StartFunction I Module FvwmEvent ExposeCache
DestroyModuleConfig ExposeCache: *
*ExposeCache: add_window CacheWindow
*ExposeCache: raise_window CacheWindow
*ExposeCache: focus_change CacheWindow
*ExposeCache: dewindowshade CacheWindow
*ExposeCache: destroy_window "Exec rm -f $[FVWM_USERDIR]/cache.$[w.id].xwd"

# Take a picture
AddToFunc CacheWindow I ThisWindow (Raised, !Shaded, !Iconic) Exec nice xwd
-screen -silent -id $[w.id] -out $[FVWM_USERDIR]/cache.$[w.id].xwd

AddToFunc ExitFunction I Exec rm -f $[FVWM_USERDIR]/cache.*

# WindowList style command...
DestroyFunc FvwmExpose
AddToFunc FvwmExpose
+ I AddToMenu FvwmExposeMenu ".: e x p o s e :." Title
+ I + DynamicPopDownAction DestroyMenu FvwmExposeMenu
+ I All (CurrentDesk, AcceptsFocus) Test (f
$[FVWM_USERDIR]/cache.$[w.id].xwd) \
    PipeRead "convert -scale 128 -frame 1x1 -mattecolor black -quality 0
xwd:$[FVWM_USERDIR]/cache.$[w.id].xwd \
        png:$[FVWM_USERDIR]/icon.exp.$[w.id].png && echo AddToMenu FvwmExposeMenu
\
        %$[FVWM_USERDIR]/icon.exp.$[w.id].png%\\\'\"$[w.name]\"\\\' WindowID
$[w.id] WindowListFunc \
        && echo AddToMenu FvwmExposeMenu \\\"\\\" Nop || echo Nop"
+ I Popup FvwmExposeMenu
+ I Exec exec rm -f $[FVWM_USERDIR]/icon.exp.*

-- 
-------------------------------------
taviso_at_sdf.lonestar.org | finger me for my gpg key.
-------------------------------------------------------
--
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 majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Tue May 11 2004 - 08:52:31 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:56 BST