No buttons defined. Quitting


I don’t know if this is the right place to ask, but here’s my problem.
I’ve defined a function to display number of new mail in my mailbox in an FvwmButton popup:

[code]DestroyFunc MailPopup
AddToFunc MailPopup

  • I DestroyModuleConfig FvwmMail: *
  • I *FvwmMail: Geometry 150x50-250+17
  • I *FvwmMail: Rows 2
  • I *FvwmMail: Back black
  • I *FvwmMail: Fore green
  • I *FvwmMail: Font “xft:Andale Mono:style=Roman:size=8:bold”
  • I *FvwmMail: Frame 0
  • I *FvwmMail: Padding 5 5
  • I *FvwmMail: (1x1, Title “$0 messages in Mailbox”)
  • I *FvwmMail: (1x1, Title “$1 messages in Perso”)
  • I Module FvwmButtons FvwmMail
  • I Schedule 5000 KillModule FvwmButtons FvwmMail

I’ve made a script that check my maildir on a regular basis and the last lines of this script are:

if [ $total -gt 0 ]; then FvwmCommand "MailPopup $general $perso" fi

And basically, everything works fine, except that once in a while, I’ve got this message in my .xsession-errors:

FvwmMail: No buttons defined. Quitting

(and of course, no popup appears)

Do you have any ideas why this happens ? Because if I debug my script (which sh -x for example), the MailPopup is only called with two parameters…


What would be far easier, is if you used either xlassie (which as a standalone program is great – and can be swallowed into FvwmButtons). Or, instead of just undefining and recreating the button each time, which you seem to be doing, just use something like this:

DesrtoyModuleConfig FB-Mail:*
*FB-Mail: Columns 1
*FB-Mail: Rows 1
*FB-Mail: (1x1, Title "0", Id Mail)

Module FvwmButtons FB-Mail

Obviously for the above you can change it however you like. I happen to use fetchmail, not that it matters, but it runs the following script:


count=$(mboxcheck ~/Mail/* 2>/dev/null | awk 'BEGIN {a=0}; a+=$2; END{print a}' | tail -n 1)

[[ $count -gt 0 && -z "$@" ]] && beep -r 3 -l 40 --new

# Send to FVWM
FvwmCommand "SendToModule FB-Mail ChangeButton Mail Title $count"

I’d just use xlassie, frankly.

– Thomas Adam

Thank you for your answer Thomas.

What I’m trying to do here is a “mail popup notification”: a popup appears when I’ve got new mails.
That’s why I destroy it after 5 seconds.

Do you know any other way to do it ?