I want to write a FvwmScript to manage mpc. (I know it’s already done, but I want do it by myself).
I use the following code:
# Heading
WindowTitle {soundPanel}
WindowSize 200 40
#Colorset 4
#Initalisation
Init
Begin
#ShowWidget 1;
#ShowWidget 2;
#ShowWidget 3;
#ShowWidget 4;
#ShowWidget 5;
#ShowWidget 6;
End
#Periodic Task
Periodic Task
Begin
ShowWidget 1;
End
#Mainpart
Widget 1
Property
Type ItemDraw
Size 32 32
Position 0 0
Icon $[fvwm_icons]/32x32/player_start.png
Main
Case message of:
SingleClic:
Begin
End
End
[...]
I use 6 Widget, all the same syntax, only the image is an other. But I don’t see any image, just an light grey background. I’ve also tried to use the full pathname to the image, but this want work too.
FvwmScript doesn’t know how to directly interpolate environment variables in this way. Your best bet is to place your icons in a location specified in your ImagePath, and then to do:
I never quite understood why people do this, and indeed I realise it probably doesn’t mean a thing to do, and why should it? There’s nothing wrong with those two lines above, right?
Again, I’ll reiterate that it does work, providing said icon is in your ImagePath. Still, since there seems to be some discrepency here, let’s go through the motions, shall we?
What version of FVWM are you running?
Does anything log to $HOME/.xsession-errors when you load the said FvwmScript?
And again for the record, here’s an example that works for me:
WindowTitle {soundPanel}
WindowSize 200 40
Init
Begin
End
Widget 1
Property
Type ItemDraw
Size 32 32
Position 0 0
Icon Mosaic.xpm
Main
Case message of:
SingleClic:
Begin
End
End
1.) I use fvwm 2.5.12
2.) There are 3 Errors, they belong to Style options:2x “Bad style option: !Border”. 1x somewhat with animate. (I will try to solve them today or tomorrow.) But there are no errors that belongs to the script or something I don’t know…
I use 32x32 Icons. The position of each widget, is the position of the previous widget plus 3 pixel space. First at 0 0, second at 35 0, and so on. (First I hat the different between the positions just 32 pix, but i thought that this could be the problem, so I changed it…)
I’m sorry that the explanation in my first post wasn’t clear.
I will try your example today evening, Thomas.
I see you use an xpm file. Is it possible that my FvwmScript doesn’t support png? Fvwm itself is compiled with png support. (And works fine.)
Thanks for this interesting site. I will cleanup my environment in the future.
I’ve just removed this part of the script. Than it shows all Icons…don’t know why…
With an empty Periodic Task Part you will also don’t see any images.
Well, for starters, that is invalid syntax. Semicolons don’t go on the end of lines. And it’s “PeriodicTasks”, not “Periodic Task”. And finally, is that really what you want to do? You want to show (re-show?) the widget every second?
No, that’s not what I want to do. It was just for testing. I wasn’t sure if I have to write an PeriodicTasks so I 've simply added one.
Wrong Syntax? That’s what “man FvwmScript” says:
PERIODIC TASKS
This part of the script contains instructions that are executed every
second. For example:
Periodic Task
Begin
If (RemainderOfDiv (GetTime) 10)==0 Then
Do {Exec xcalc}
End
But thanks for the hint! I didn’t ever noticed the semicolon…too much C and Java those days…
That’s an old FVWM version, the error in the manpage was no doubt fixed recently. It’s always worth it to stay current on FVWM releases, if only for this sort of fixes.