forked from pool/openbox
OBS-URL: https://build.opensuse.org/package/show/X11:lxde/openbox?expand=0&rev=b500ade9d065afe28b8925f95d8c66bc
41 lines
891 B
Bash
41 lines
891 B
Bash
#!/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 -
|
|
|