FvwmBanner

Hi all. I’m having a few issues trying to use FvwmBanner to display graphics on the screen for various reasons. For example, a coffee cooker. This is a simple 5 minute timer, after which a banner is displayed to tell me my coffee’s ready. The function is: [code]DestroyFunc FuncCoffeeCooked
AddToFunc FuncCoffeeCooked

  • I DestroyModuleConfig FvwmBanner: *
  • I *FvwmBanner: NoDecor
  • I *FvwmBanner: PixMap coffee.png
  • I *FvwmBanner: Timeout 5
  • I Module FvwmBanner
  • I WindowId (FvwmBanner) Layer 0 10[/code]
    I’ve also used it to display volume increasing/decreasing and mute on/off banners for a few seconds at a time when relavent media keys are pressed. However, none of these work when I first start Fvwm. In fact I have to restart it twice before anything works. At that point the coffee cooker and volume control work, but the mute banner is still intermittent. Relavent stuff:

[code]#--------------------------------

Display a banner whenever the system is muted or unmuted, or volume is changed

DestroyFunc FuncDecreaseVolume
AddToFunc FuncDecreaseVolume

  • I Exec exec aumix -v-3
  • I DestroyModuleConfig FvwmBanner: *
  • I *FvwmBanner: NoDecor
  • I *FvwmBanner: PixMap voldown.png
  • I *FvwmBanner: Timeout 1
  • I Module FvwmBanner
  • I WindowId (FvwmBanner) Layer 0 10

DestroyFunc FuncIncreaseVolume
AddToFunc FuncIncreaseVolume

  • I Exec exec aumix -v+3
  • I DestroyModuleConfig FvwmBanner: *
  • I *FvwmBanner: NoDecor
  • I *FvwmBanner: PixMap volup.png
  • I *FvwmBanner: Timeout 1
  • I Module FvwmBanner
  • I WindowId (FvwmBanner) Layer 0 10

DestroyFunc FuncMuteUnmute
AddToFunc FuncMuteUnmute

  • I PipeRead “$[FVWM_USERDIR]/scripts/mute.sh”[/code]
    And “mute.sh”:[code]#! /bin/sh

$Aumix: aumix/src/mute,v 1.1 2002/03/19 01:09:18 trevor Exp $

Copyright © 2001, Ben Ford and Trevor Johnson

Modified to display stuff in FVWM by Andrew Simpson, 04/2005

Run this script to mute, then again to un-mute.

Note: it will clobber your saved settings.

volumes=$(aumix -vq |tr -d ,)
if [ $(echo $volumes | awk ‘{print $2}’) -ne 0 -o
$(echo $volumes | awk ‘{print $3}’) -ne 0 ]; then
aumix -S -v 0
echo “+ I DestroyModuleConfig FvwmBanner: *”
echo “+ I *FvwmBanner: NoDecor”
echo “+ I *FvwmBanner: PixMap mute.png”
echo “+ I *FvwmBanner: Timeout 2”
echo “+ I Module FvwmBanner”
else
aumix -L > /dev/null
echo “+ I DestroyModuleConfig FvwmBanner: *”
echo “+ I *FvwmBanner: NoDecor”
echo “+ I *FvwmBanner: PixMap unmute.png”
echo “+ I *FvwmBanner: Timeout 2”
echo “+ I Module FvwmBanner”
fi[/code]
(largely taken from the “mute” script included with aumix)

The behaviour is sort of intermittent, which is what confuses me. Is there anything obviously wrong, or easily improveable, with these functions? Is there a simpler way to achieve the same effect?

I don’t know why you need to restart a couple of times - I get the occasinal silliness like that and I rarely get to the bottom of them.

I can suggest a couple of improvements to your setup tho’.

The first one is that FvwmBanner takes a file as an optional argument. This means you can probably configure FvwmBanner outside your functiion, once, and then the funcs only need call FvwmBanner specifing the file.

If you need multiple configurations for FvwmBanner, (if, for example, you wanted different timeouts), the best thing is to declare and configure aliases for the different usages.

OK, so basically the advice is “live with it.” Fair enough!

I see your point about the different aliases though, that’s probably a good idea to save worry.

Just out of interest, is there any other way to display a banner in this sort of way?

Except that FvwmBanner doesn’t support aliasing.

You can use a function that makes use of ‘Schedule’ and ‘Deschedule’. You could (although not graphically related) use ‘osdcat’ to display the desk number, etc, when you change between them.

– Thomas Adam

Well, it was more of a “I don’t know, but this might make like simpler”, really.

Well, I do have plans for a module to do something similar, but with some fancy graphical options. Mind, it’ll probably work with FvwmBanner rather than replace it.

First of all though I need to figure out how to make X11 reparenting work.