#!/bin/bash
set -a
. $APPDIR/gui_misc

#geometry
HEIGHT=`xwininfo -root | grep -m 1 '\geometry' | cut -f4 -d ' ' | cut -f2 -d 'x' | cut -f1 -d '+'`
WIDTH=`xwininfo -root | grep -m 1 '\geometry' | cut -f4 -d ' ' | cut -f1 -d 'x'`

GUI='
<window title="Pmusic" icon-name="gtk-media-stop" default_height="'$HEIGHT'" default_width="'$WIDTH'" decorated="false" resizeable="false">
 <vbox space-expand="true" space-fill="true">
  <hbox>
   <vbox space-expand="false" space-fill="false">
    <text height-request="20"><label>""</label></text>
    <button can-focus="no" tooltip-text="'$(gettext 'Leave fullscreen')'">
     <input file stock="gtk-leave-fullscreen"></input>
     <action>exec pmusic</action>
    </button>
   </vbox>
   <text width-request="20"><label>""</label></text>
  </hbox>
 <vbox>
   <hbox homogeneous="true">
    <vbox space-expand="false" space-fill="false">
     <pixmap>
      <variable>ARTWORK</variable>
      <height>400</height>
      <input file>'$HOME'/.pmusic/nowplaying_albumart.jpg</input>
     </pixmap>
     <text height-request="25">
      <variable>SVG_NOWPLAYING</variable>
      <input>cut -d"|" -f1 '$HOME'/.pmusic/nowplaying</input>
     </text>
     '$GUI_PROGRESS'
    </vbox>
   </hbox>
 </vbox>
 </vbox>
</window>'
