PEM's stuff

Hi charlottechurch. I don’t get the error you’re talking about … so :slight_smile:

Anyway, it may be related to the configuration of the IconBox as these commands shows up in this section. In the main configuration file ~/.fvwm/config, you can redefine the behaviour of the IconBox. Namely, this feature sets up an area on your desktop where the icon are placed for iconified application. Check the value there, maybe are they unappropriately set. :question:

Hello Pem,

i really like your weather icon in your dock. I thought it was a swallow desklet but it seems to be a perl script with weather.com.
I do not understand anything with scripts ! Can you explain me a little bit how do it works ?

Thank you.

Hi Lucky, of course I can make some explanations.

First thing, I like to use /dev/shm to hold little temporary logs or status. As it’s a file system in memory that only grows if you use it, it’s really fast, does not harm your hdd and consumes very little ressources 8) If you don’t got it already, validate it in your kernel like this:

File systems ---> Pseudo filesystems ---> [*] Virtual memory file system support (former shm fs)
Once done, we have to check if the script that I use for retrieving the weather value is able to work on your box. It’s based on a PERL script and some PERL modules. I’ve found it on the Gentoo forum but I can’t remember the thread. It was related to BlackBox so it required some adaptation. To check if the script work, just test it on the command line:

~/.fvwm/script/weather_log.plx

If everything’s OK, it will display its results like this:

45.png 10ºC 50 % 28.png ...
To tune this script to your country or city, you have to modify the 4th line of it:

my $content = get("http://www.w3.weather.com/weather/print/FRXX0076");

As I leave in Paris, I’ve set FRXX0076. This values is extracted from the URL (the address) in your browser when you check the weather for your location on weather.com.
I"ve provided 2 iconsets for the weather icon. The first one comes from the terrible iconset of Mattahan (the guy behind the Gnant iconset weather.con. In the future, I will provide other iconsets that I’ve found on devianart (I’ve got 5 other ones that I need to treat). To choose the icon that you want to get displayed, just update the Fvwm’s variable fvwm_weather in the main configuration file, ~/.fvwm/config.
Pfeew … Now the explanation of how it works. When Fvwm is started, it executes in background the script to retrieve the information and logs the results in the /dev/shm:

+ I exec exec   $[fvwm_script]/weather_log.plx $./img/weather/$[fvwm_weather]/ > /dev/shm/weather.log

This is done in the background to avoid fvwm to get stupidly stucked while retrieving info from weather.com as it’s a bit long (even on my fast ADSL2+ line :wink: )
The dockbar launches an FvwmScript, ~/.fvwm/script/WeatherIconAndTemp, which starts quick because it uses default values. After 60 seconds, the FvwmScript checks if there are values available in the /dev/shm/weather.log and uses them to display its icon and temperature.

Note that the dockbar also connects this aera to a menu that you may have seen in former posts in this thread. On the same basis, the perl script, ~/.fvwm/script/weather_menu.plx, uses the /dev/shm/weather.log to build up a piperead menu displaying the forecasts for the next days.

And that’s it :exclamation:

Thank you very much, i have understand everything :smiley:
Really great. I havn’t lucky because i am so bad in graphics, i am not able to use gimp, even for a minimal use :frowning:
In consequence, i can’t improve my config with pixmaps :frowning:

Ok, with some good explanations it is more easy. So it works well !
I have just one problem, i am able to “Popup” the MenuWeather from my Menu and any buttons of my dock without the button which swallow WeatherIconAndTemp :frowning:
Have you an idea ? Here my dock config :

[code]SetEnv dock_x 199

DestroyModuleConfig Dock: *
*Dock: Rows 89
*Dock: Columns 680
*Dock: Geometry 680x89-$[dock_x]-15
*Dock: BoxSize fixed
*Dock: Frame 0
*Dock: Padding 0 0
*Dock: (12x12, Icon bg-nw.png)
*Dock: (656x12, Icon bg-n.png)
*Dock: (12x12, Icon bg-ne.png)
*Dock: (12x65, Icon bg-w.png)
*Dock: (1x65, Colorset 35)
*Dock: (82x65, Icon konsole.png, Colorset 35, Action(Mouse 1) Exec rxvt, Action(Mouse 3) Menu MenuWeather)
*Dock: (82x65, Icon kfm_home.png, Colorset 35, Action(Mouse 1) Exec rox)
*Dock: (82x65, Icon browser.png, Colorset 35, Action(Mouse 1) Exec firefox)
*Dock: (82x65, Icon kmail.png, Colorset 35, Action(Mouse 1) Exec thunderbird)
*Dock: (82x65, Icon kopete.png, Colorset 35, Action(Mouse 1) Exec rxvt -g 95x50 -e irssi)
*Dock: (82x65, Icon xmms_neige.png, Colorset 35, Action(Mouse 1) Exec xmms)
*Dock: (82x65, Icon gimp_snow.png, Colorset 35, Action(Mouse 1) Exec gimp-2.2)
*Dock: (64x65, Colorset 35, Swallow “WeatherIconAndTemp” FvwmScript $[scripts]/WeatherIconAndTemp na.png, Action(Mouse 3) Menu MenuWeather)
*Dock: (16x13, Icon next.png, Colorset 35, Action(Mouse 1) Exec xmms -f,
Action(Mouse 4) Exec aumix -v+5, Action(Mouse 5) Exec aumix -v-5)
*Dock: (1x65, Colorset 35)
*Dock: (12x65, Icon bg-e.png)
*Dock: (16x13, Icon prev.png, Colorset 35, Action(Mouse 1) Exec xmms -r,
Action(Mouse 4) Exec aumix -v+5, Action(Mouse 5) Exec aumix -v-5)
*Dock: (16x13, Icon play.png, Colorset 35, Action(Mouse 1) Exec xmms -p,
Action(Mouse 4) Exec aumix -v+5, Action(Mouse 5) Exec aumix -v-5)
*Dock: (16x13, Icon pause.png, Colorset 35, Action(Mouse 1) Exec xmms -u,
Action(Mouse 4) Exec aumix -v+5, Action(Mouse 5) Exec aumix -v-5)
*Dock: (16x13, Icon stop.png, Colorset 35, Action(Mouse 1) Exec killall xmms,
Action(Mouse 4) Exec aumix -v+5, Action(Mouse 5) Exec aumix -v-5)
*Dock: (12x12, Icon bg-sw.png)
*Dock: (656x12, Icon bg-s.png)
*Dock: (12x12, Icon bg-se.png)
*Dock: Colorset 31
[/code]

Popup MenuWeather on the “konsole button” works but no on the WeatherIconAndTemp button :frowning:

Lucky, that may be a silly question, but it seems that you’ve linked the menu action on the 3rd mouse button (presumably the right one). Did you do that intentionnaly because that’s the only one action you’ve set with this button?

Apart that, it is pretty close to my config except that I use Popup menu instead of Menu (it’s a bit less transient, but classic menu a quite nice for screenshot: it provides you the possibility to open multiple menu). I also like to set ever mouse buttons, it’s easier.

Ah no i have set an error in my config copy. Well it works on the konsole button but no in the Meteo button (either bouton 1 or 3). I don’t know why :frowning:

:bulb: All right, I think I got it. The mouse click event could be swallowed by the FvwmScript and therefore would not be transmitted (even if not used) to the Action command in your FvwmButtons (your dock). Thus, to counter this behaviour, I would recommend the keyword ActionOnPress which modify the way the mouse click event is transmitted. It would be analysed quicker and therefore transmitted to the Menu action.

ActionOnPress Usually the action is executed on the button release except for the Popup action. This option changes this behavior, the action is executed on the button press. This may be good, for example, with Menu or SendToModule that generates popups, or when Frame is 0 and the button would look unresponsive otherwise.
That’s a bit wild guessing. This should lead you to the following:

*Dock: (64x65, ActionOnPress, Colorset 35, \ Swallow "WeatherIconAndTemp" `FvwmScript $[scripts]/WeatherIconAndTemp na.png`, \ Action(Mouse 1) `Menu MenuWeather`, \ Action(Mouse 2) `Menu MenuWeather`, \ Action(Mouse 3) `Menu MenuWeather`)
I’ve tripled the mouse action, just to be sure :wink:

It’s gonna be rainy today on Paris:

Yes i’ve tried this before but it is always the same thing. It doesn’t work yet :’(
I call MenuWeather from my standard menu and it works perfectly but it doesn’t want from the dock with either Menu or Popup.

Humm, I’m starting to get dry :confused: Could you combine a Popup menu as well as the ActionOnPress keyword? (just in case)

*Dock: (64x65, ActionOnPress, Colorset 35, \ Swallow "WeatherIconAndTemp" `FvwmScript $[scripts]/WeatherIconAndTemp na.png`, \ Action(Mouse 1) `Popup MenuWeather`, \ Action(Mouse 2) `Popup MenuWeather`, \ Action(Mouse 3) `Popup MenuWeather`)

It is the same ! I give up…

Thank you pem

I ,ve sort the problems out and enjoying in it.

:question: hello i like to know how do you put transparent your menu.
i tried with

  • RootTransparent, Tint #ffffff 60
    or
  • RootTransparent buffer, Tint #ffffff 60
    and
  • Translucent white 60 (with this i see all menu whit solid white color!)
    but nothing continue maping tranparencies for de background

That should do the trick. For my normal menu, I use:

Colorset 60 fg white, bg white, hi black, sh black, fgsh black, Translucent black 50

Depending on your packager or installation, your Fvwm may be patched with the transluency feature that miss. The screenshot that you’ve seen on this thread are taken on a Gentoo Linux. The Fvwm package in this distro incorporates the transluency by default (it’s so l33t 8) )
POST EDIT
You can get it the patch here:

 wget http://mirrors.tds.net/ftp_root/gentoo-portage/x11-wm/fvwm/files/fvwm-2.5.9-translucent-menus.diff.gz

:smiley: thanks!. i will patch and recompilated my fvwm i hope its works.

PEM, I’ve just discovered that FVWM has been improving all these years and I’ve been stuck in the dark ages. I got Themes running Friday and downloaded your theme, but can’t figure out how to add it to my themes.

I see that the tar contains a .fvwm directory. If I untar it in my home directory the subdirectories line up with existing directories, but I get nothing on my Theme menu and even restarting doesn’t alter my X appearance. Can you give me the quick version of how to make your theme an option?

It’s not part of fvwm-themes – you run it separate from that. You should (judging from the process you underwent) be able to do:

exec fvwm

from within your ~/.xinitrc or ~/.xsession file – assuming your method of logging into X11 supports reading those files.

– Thomas Adam.

Yep Alex. The Fvwm’s improvements are quite impressive. When you think that this WM was started in 1993 … My gosh. 8)

Unfortunately for your fvwm-themes integration, my mods are a bit too complicate to comply with their requirements. So, as Thomas has gently said it, it’s a standalone theme, though, there’re a lot of possibilities for ehancements. In the archive that you’ve downloaded, I provide 2 customizations: Arctic and Smokey.

Pem, i have a question.

What’s happend if i don’t restart Fvwm for a week ? Do the weather is refresh ? I know the FvwmScript refresh every 60s but the /dev/shm/weather.log ?

In this case, the perl script that creates the /dev/shm/weather.log is called only once: at the beginning of Fvwm. Thus the value would not get refreshed.

Actually, I haven’t implemented it :blush: caus’ it’s not my way of using my box. I generally try to spare power. I’m not an ‘uptime’ junky :wink:

Anyway, if you really need an update on the weather, I would suggest to put a call to this script in your crontab every 2 or 3 hours: that should be sufficient.