LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File openbox-pipemenu of Package openbox (Project home:X0F:LXQt)

#!/bin/sh

PATH=/bin:/usr/bin

{
    cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xml" href="#stylesheet"?>
<!DOCTYPE doc [
<!ATTLIST xsl:stylesheet
  id    ID      #REQUIRED>
]>

<doc>
  <xsl:stylesheet id="stylesheet" version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:output omit-xml-declaration="yes" />
 
    <xsl:template match="/doc/openbox_pipe_menu">
      <openbox_pipe_menu>
      <xsl:choose>
        <xsl:when test="count(./menu) = 1">
          <xsl:copy-of select="./menu/*" />
        </xsl:when>
        <xsl:otherwise>
          <xsl:copy-of select="*" />
        </xsl:otherwise>
      </xsl:choose>
      </openbox_pipe_menu>
    </xsl:template>

    <xsl:template match="xsl:stylesheet" />

  </xsl:stylesheet>
EOF
    xdg_menu --format openbox3-pipe "$@"
    printf "</doc>\n"
} | xsltproc --nonet --novalid -