On 24 Nov 2003 12:35:28 +0000, Tavis Ormandy wrote:
> 
> Can anyone think of a way to restore a window's Icon after changing it,
> or is there a way of getting that information from within an function?
> 
> I'm writing a simple Eye-Candy function, like this:
> 
> ExecUseShell /bin/ksh
> 
> DestroyFunc IconifyWithScreenshot
> AddToFunc IconifyWithScreenshot
> + I Raise
> + I PipeRead "import -window $[w.id] -frame -silent -quality 0 
> $[HOME]/.fvwm/tmp.$[w.id].png \
>       && convert -resize 64 -frame 1x1 -bordercolor white -quality 0 \
>               png:$[HOME]/.fvwm/tmp.$[w.id].png 
> png:$[HOME]/.fvwm/icon.tmp.$[w.id].png \
>       && echo WindowStyle IconOverride, Icon $[HOME]/.fvwm/icon.tmp.$[w.id].png \
>       || echo Nop"
> + I Iconify
> + I Schedule 1000 Exec rm $[HOME]/.fvwm/?(icon|tmp)*.png
> 
> example:
> 
> before: 
> http://dev.gentoo.org/~taviso/step1.png
> 
> after: 
> http://dev.gentoo.org/~taviso/step2.png
> 
> After removing the icons, I'd like to restore it to it's original Icon,
> so that if I Iconify the window without using this function, it doesnt
> just dissapear. Maybe theres a better way?

You can't push/pop Icon files for a window, only one icon is stored.
Hovewer you may do DestroyWindowStyle on deiconify if this helps.

You may also listen to destroy_window packet and then remove the icons,
not immediately after one second.

I would use "import -geometry 64 -resize 64 -silent" without additional
convert and use *IconTitle* and *IconBackground* style options instead.
Should be faster.

Regards,
Mikhael.
--
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