Notification buttons for various things

Hi

I’ve come up with a perl-script (thanks two a friend of mine) that draws buttons on the desktop each time a certain fvwm-function is executed.
Mainly I use it for E-Mail notification

I’m using fvwm-crystal (don’t hurt me please) but while testing some !crystal-configs I recognised it worked (unasked) there as well so I thought some people here might be interested

I made a small animation as I don’t really know how to explain that thing]http://antonpopov.de/fvwm/fvwm-notify.mpeg[/url]
Sorry for the quality (it was made upon a vnc-session) - It usually runs pretty smooth
Once I get xvidcap working on my laptop I’ll update it

A screenshot can be found here (it’s in the lower right corner)]http://antonpopov.de/fvwm/fvwm-notify.png[/url]

Now the scripts

script to draw buttons]http://antonpopov.de/fvwm/fvwm-crystal.notify.pl[/url]

script to look for new mails (taken from fvwm-winter-theme and modified)]http://antonpopov.de/fvwm/fvwm-crystal.imap.pl[/url]

copy those to /usr/local/bin

and finally some fvwm-functions you need to ‘Read’ into your config]http://antonpopov.de/fvwm/Notify[/url]

Note: all paths in the fvwm-functions (and one in the fvwm-crystal.imap.pl) point to /usr/local/bin - in case you don’t like this path

How the E-Mail-script works:

I setup a cronjob that executes this command every 10 minutes:

FvwmCommand NotifyMailCheck

This function calls fvwm-crystal.imap.pl which looks for new mails and generates the menu-content seen in the screenshot

Then fvwm-crystal.imap.pl calls fvwm-crystal.notify.pl and committs this menu-content to it

How the button-script works:

It requires arguments in order to add/delete/move a button
These are:

fvwm-crystal.notify.pl add (refresh|weather|weahterfail|sat|satfail)    # these have static messages
fvwm-crystal.notify.pl add mail $MailMenuContent
fvwm-crystal.notify.pl del $ButtonId                                    # e.g.: aaa, aab, aac, ...
fvwm-crystal.notify.pl delall
fvwm-crystal.notify.pl reorder

Adding a button:

fvwm-crystal.notify.pl looks for present buttons on the desktop and generates unique names like these:

FvwmNotify-aaa
FvwmNotify-aab
FvwmNotify-aac
...

These names also mark the order of the buttons

Once the name is generated (and with it the button-config and menu-name) it writes it to /tmp/fvwmnotify.pl.tmp (and this is where it looks for the “present” buttons as well) and launches the button at a “free” position

Deleting a button:

Buttons can be removed by right-clicking them or by calling “NotifyClose aaa” within the FvwmConsole

The entry of the clicked button will be removed from /tmp/fvwmnotify.pl.tmp and thereafter the reorder-function will be called

The reorder-function AnimatedMoves the remaining buttons in /tmp/fvwmnotify.pl.tmp as seen in the animation

So you might have to load FvwmAnimate on startup (I may be wrong) in order to see some animation

And while reordering the buttons you wont be able to do anything than wait till it’s over (as usual for Piperead)
It might be annoying when having many buttons but I for myself can live with it

The best would be to look at the fvwm-functions to see how to use the whole thing

And that’s it 8)

I hope this was understandable somehow (and works…) :confused:

gl & hf

Thanks for your effort – pointless to me. Try using FvwmPerl instead to do this, it’s why it was created.

– Thomas Adam

I know there are better ways but hey… it works :slight_smile:
Thanks for your suggestion though. I also thought of FvwmPerl - will do it some day