Change an Icon depending on the state of a program

Is there a possibility to change a icon in the FvwmButton depending on the state of a program?

I have a Icon like this in my FvwmButton

*FvwmButton: (3x2 Frame 0, Colorset 18, Icon player_play.png Action(Mouse 1) `Exec exec echo -e "play\\nclose"|nc $mpd_host $mpd_port`)
to control my mpd. And i want to change the Icon to the “player_pause.png”, when mpd is playing a song, and the “player_play.png”-Icon, when the player is paused…
With FvwmScript it is no problem, but there are the Buttons so big, that i have not enough space in my Buttonbar, and i don´t like the 3D-effect. How can i do this with FvwmButton?
Or is there a possibility in FvwmScript to deactivate the 3D-PushButton-effect?


– Thomas Adam

Sounds good. BUT… There is always a but… :wink:

How is the command out of a FvwmScript? I have a periodic update of the mpd-status in a Script. There i want to make this job, because, i can control the mpd with different clients, and the icon should always be the right.

  If $status == [playing]  Then
      HideWidget 3
      ShowWidget 2
      SendToModule FvwmShelf ChangeButton "A" Icon player_pause.png

segfaults the Applet…

==> /home/jakob/.xsession-errors <==
[FvwmApplet-MpdSongInfo] Line 56: syntax error

==> /var/log/syslog <==
Apr 26 16:50:11 pluto kernel: [555974.831685] FvwmScript[5651]: segfault at 90 ip 000000000040d623 sp 00007fff56f0a480 error 4 in FvwmScript[400000+59000]

I changed the Line in FvwmButton to

	*FvwmShelf: (3x2 Frame 0, Colorset 18, Id "A", Icon player_play.png PressIcon player_pause.png Action(Mouse 1) `Exec exec /usr/bin/mpc status|grep -q '\[playing\]\|\[paused\]' && /usr/bin/mpc -h $mpd_host -p $mpd_port toggle|| /usr/bin/mpc -h $mpd_host -p $mpd_port play`)

Without the “SendToModule”-line, the script works fine… (without changing the Icon of the Button!)


That shouldn’t happen. Can you recompile FVWM per these instructions: … #index29h2

Specifically about turning on “-g -ggdb” – because hopefully then you can get me a core file.

– Thomas Adam

I found the solution:

This is my mpd-control for FvwmButton.

Thx for the hint.


I will do this tomorrow, no time left tody, to recompile my fvwm.