Moose On The Loose wrote:Perhaps this is a better way:MochiMoppel wrote:@smokey01. Not really a Gtkdialog issue. See here.
The long # string is there to prevent the file to be mistakenly recognized as a svg image.
It is based on something commonly done for making html tags in javascriptCode: Select all
THING="SVG" echo "<$THING" '.... more stuff ....
Yea that worked
Code: Select all
#!/bin/sh
SVG=svg
svg_buttons () {
echo '<'$SVG' width="100%" height="100%" viewBox="0 0 60 20">
<defs>
<linearGradient id="button_surface" gradientUnits="objectBoundingBox"
x1="1" x2="1" y1="0" y2="1">
<stop stop-color="#D26F6F" offset="0"/>
<stop stop-color="#FF0000" offset="0.67"/>
</linearGradient>
<linearGradient id="virtual_light" gradientUnits="objectBoundingBox"
x1="0" x2="0" y1="0" y2="1">
<stop stop-color="#EEEEEE" offset="0" stop-opacity="0.8"/>
<stop stop-color="#EEEEEE" offset="0.4" stop-opacity="0"/>
</linearGradient>
</defs>
<!-- button content -->
<rect x="0" y="0" width="60" height="20" fill="url(#button_surface)" stroke="#570B0B"/>
<text x="17" y="15" fill="white"
font-family="Tahoma" font-size="14" font-weight="bold">
Kill
</text>
<!-- vitual lighting effect -->
<rect x="2" y="2" width="56" height="16" fill="url(#virtual_light)" stroke="#FFFFFF" stroke-opacity="0.4"/>
</svg>
'>/tmp/killk.svg
}
export -f svg_buttons
svg_buttons
defaultimageviewer /tmp/killk.svg