<eww>

  <includes>

    <file path="./foo.xml"/>
  </includes>
  <definitions>

    <def name="pxbar">
      <progress value="{{volume}}" orientation="v" halign="start" flipped="true"/>
    </def>

    <def name="revtest">
      <box>
      <revealer reveal="{{reveal}}" transition="slideleft" duration="300ms">
        hello, world 
      </revealer>
    </box>
    </def>

    <def name="test">
      <box class="{{some_var}}"  space-evenly="false" spacing="10">
        <scale value="{{scaleval}}" orientation="v" min="0" max="100" flipped="true" />
        <box space-evenly="false" orientation="v">
          asdasdfflmao 


          <box> |  {{ round((EWW_NET["enp34s0"].NET_UP) * 8 / (1024 * 1024), 2)}} 
           {{ round((EWW_NET["enp34s0"].NET_DOWN) * 8 / (1024 * 1024), 2)}} 
          |  {{EWW_RAM}} 
          |  {{ round((EWW_DISK["/"].free) / (1024 * 1024 * 1024), 2)}} 
        </box>


        <!--{{(EWW_NET[kek].NET_UP) * 10}}-->

        asdf {{ round(0.1234, 2) }}
      </box>


      <button onclick="pgrep 'eww' &amp;&amp; echo '' || echo ''" cursor="wait">Test bug</button>
      <revealer reveal="{{reveal}}" transition="slideright" duration="300ms">
        <button 
          onclick="notify-send 'ree' 'this is {{shit}}'"
          onmiddleclick="notify-send 'ree' 'MITTE'"
          onrightclick="notify-send 'ree' 'RECHTS'"
          >
          click me
      </button>
    </revealer>
    <calendar show-heading="false" show-day-names="false" day="2" onclick="notify-send 'asdf' '{}'" />
    notify-send 'ree' 'this is {{shit}}'
    <multiple text="{{shit}}" />

    <!--<literal content="{{code}}"/>-->

  </box>
</def>

<def name="multiple">
  <box orientation="v" space-evenly="false">
    <box>{{text}}test</box>

    <box class="whatever lol">{{text}}</box>
    <box style="color: blue;">{{text}}</box>
    <box>{{text}}</box>
    <box>{{text}}</box>

    <label onscroll="notify-send '{{shit}}' {}" text="reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" limit-width="5" wrap="true" />
    <!--<input onchange="eww update code='{}'" />-->
    {{date}}
    {{date-tail}}
  </box>
</def>

<def name="volume_popup">
  <box orientation="v" space-evenly="true">
    <scale flipped="true" orientation="v" value="{{volume}}" min="0" max="100" onchange="amixer sset 'Master' {}%" />
  </box>
</def>

<def name="music">
  <box class="hi ho" orientation="h" valign="start" space-evenly="false" hexpand="true">
    <image visible="{{song-image-visible}}" path="{{song-image}}" width="150" height="150" />
    <box orientation="v" halign="fill" space-evenly="false" vexpand="true" hexpand="true">
      <box class="data" vexpand="true">
        <box orientation="v" halign="start">
          <label class="songname" halign="start" limit-width="30" text="{{song-name}}" />
          <box space-evenly="false" halign="start">
            <label class="key" text="Album: " />
            <label halign="start" limit-width="30" text="{{song-album}}" />
          </box>
          <box space-evenly="false" halign="start">
            <label class="key" text="By:    " />
            <label halign="start" limit-width="30" text="{{song-artist}}" />
          </box>
        </box>
      </box>
      <box class="buttons" hexpand="true">
        <button onclick="playerctl previous"></button>
        <button onclick="playerctl play-pause">{{song-playpause}}</button>
        <button onclick="playerctl next"></button>
      </box>
    </box>
  </box>
</def>

    </definitions>


    <variables>
      <script-var name="volume">
        amixer sget 'Master' | grep 'Front Left:' | sed 's/.*\[\(.*\)%\].*/\1/g';
        LANG=C pactl subscribe | grep --line-buffered sink | while read -r _; do
        amixer sget 'Master' | grep 'Front Left:' | sed 's/.*\[\(.*\)%\].*/\1/g'
        done
      </script-var>

      <var name="reveal">
        false
      </var>
      <var name="shit">
        enp34s0
      </var>
      <var name="some_var"></var>
      <var name="code"></var>

      <script-var name="scaleval" interval="50ms">
        echo 25
      </script-var>


      <var name="song-image"></var>
      <var name="song-image-visible">true</var>
      <var name="song-name"></var>
      <var name="song-album"></var>
      <var name="song-artist"></var>
      <var name="song-show-progress">false</var>
      <var name="song-playpause"></var>
      <!--<script-var name="date" interval="1s">-->
        <!--date-->
        <!--</script-var>-->
      <script-var name="date-tail">
        <!--while true; do-->
        <!--sleep 1;-->
        <!--notify-send 'hi' 'ho'-->
        date
        <!--done-->
      </script-var>

      <script-var name="date" interval="1s">
        date
      </script-var>


      <script-var interval="100ms" name="lmao">
        cat ~/fuck
      </script-var>


      <var name="bruh">
        {"hi": "ho", "hey": "fuck", "lol": "test" }
      </var>




      <script-var name="kek" interval="1s">
        /home/leon/reee.sh
      </script-var>



      <!--<script-var name="xyz">-->
        <!--tail -F /home/leon/test | while read -r _; do notify-send "Hi"; done-->
        <!--</script-var>-->

        <!--<script-var name="foo">-->
          <!--tail -F /home/leon/test-->
          <!--</script-var>-->
      </variables>


      <windows>
        <window screen="0" name="px" stacking="fg" focusable="false">
          <geometry anchor="center" width="10px" height="100%" x="1px" y="0px"/>
          <widget>
            <pxbar/>
          </widget>
        </window>
        <window screen="0" name="mw" stacking="fg" focusable="false" windowtype="dock" wm-ignore="false" sticky="false">
          <!--<window screen="2" name="mw" stacking="fg" focusable="false">-->
            <!--<geometry anchor="center" width="20%" height="20%" x="50px" y="50px"/>-->
            <geometry anchor="top center" width="20%" height="20%" x="0px" y="0px"/>
            <reserve side="left" distance="30%"/>
            <widget>
              <test ree="test" />
            </widget>
          </window>
          <window screen="0" name="rev">
            <geometry anchor="bottom center" width="0" height="0"/>
            <widget>

              <revtest/>
            </widget>
          </window>
          <window screen="0" name="mw2" stacking="fg">
            <geometry anchor="bottom right"/>
            <widget>
              <foo/>
              <!--<test ree="test" />-->
            </widget>
          </window>
          <window screen="0" name="volume_popup">
            <geometry />
            <widget>
              <volume_popup />
            </widget>
          </window>
          <window screen="0" name="music">
            <widget>
              <music />
            </widget>
          </window>
        </windows>
      </eww>
