simple mpd status line...

hi folks! i’m new to fvwmscript and I just want to build a simple script that displays nothing but the currently playing mpd track! but I somehow ran into problems:
displaying the track is very simple, but I want a message like “stopped…” when mpd is stopped or paused. but as soon as I put an If-Loop in the script, nothing works!
this is my script:

WindowTitle {mpd}
WindowSize  400 16
Colorset 8


PeriodicTasks
Begin
  If (RemainderOfDiv (GetTime) 1)==0 Then
    Begin
      Set $track = (GetOutput {exec mpc --format "mpd: %artist% - %title%" | head -1} 1 -1)
      If (GetOutput {exec echo `mpc`|grep -o playing} 1 -1)=playing Then
       Begin
        ChangeTitle  1 $track
       End
      Else
       Begin
        Changetitle 1 stopped
       End    
    End
  End

Widget 1
  Property
    Size 400 16
    Position 0 0
    Colorset 8
    Font "xft:Segoe:size=7:minspace=False:antialias=True"
    Type ItemDraw
    Flags NoReliefString

another thing: I want the track to be updated every second [(RemainderOfDiv (GetTime) 1)==0], but the text flickers at every update. is it possible to avoid this flickering?

thanks in advance

trixx

See: viewtopic.php?f=7&t=454

– Thomas Adam

you can realize it with conky very easily, too

looks something like this

TEXT ${color white}Artist: ${color}$mpd_artist ${color white}Title: ${color}$mpd_title ${color white}Album: ${color}$mpd_album ${color white}$mpd_bar ${color white}${alignc}$mpd_status - $mpd_elapsed/$mpd_length ${mpd_bitrate}kbps