Notification buttons for various things


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][/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)][/url]

Now the scripts

script to draw buttons][/url]

script to look for new mails (taken from fvwm-winter-theme and modified)][/url]

copy those to /usr/local/bin

and finally some fvwm-functions you need to ‘Read’ into your config][/url]

Note: all paths in the fvwm-functions (and one in the 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 which looks for new mails and generates the menu-content seen in the screenshot

Then calls 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: add (refresh|weather|weahterfail|sat|satfail)    # these have static messages add mail $MailMenuContent del $ButtonId                                    # e.g.: aaa, aab, aac, ... delall reorder

Adding a button: looks for present buttons on the desktop and generates unique names like these:


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/ (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/ and thereafter the reorder-function will be called

The reorder-function AnimatedMoves the remaining buttons in /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