#!/usr/bin/perl

# Copyright 2008 Niall Walsh niallwalsh@users.berlios.de
# GPL2 or later

# Takes in Debian package files
# Writes out a 1920:1200 and 1600:1200 wallpaper
# Writes an svg file with a background (optional), swirls and aptosid logo

# Assume we are dealing with lists from apt and not a status file
my $aptlists=1;
# Base36 chars (all we care about from the package name)
my $_digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";

#require Math::BigInt;
#use Math::BigInt qw(:constant);

# does a base36 conversion to turn package name parts into an int
sub point {
	my ($t, $i) = 0;
INPUT:	foreach (split //,reverse uc shift){
		next INPUT unless index($_digits,$_) >0;
		$_ = ord($_) - 55 unless /\d/;
		$t += $_ * (36 ** $i++);
	}
	return(($t).".0");
}

sub usage {
	my ($msg) = shift;
	print "$0".' (--nobg) input* output-wide output
Takes the list of input files and produces a pair of svg files as output.
Error: '."$msg\n";
}

my ($output)=pop;
my ($output2)=pop;
my ($background)=1;
my(@inputs);
foreach (@ARGV)
{
	if (/\-\-nobg/)
	{
		$background=0;
	}
	else
	{
		usage("Input is not a readable file!") if (!((-f $_)&&(-r $_)));
		push(@inputs,$_);
	}
}
open(OUT,">$output")||usage("failed to open $output for writing : $!");
open(OUT2,">$output2")||usage("failed to open $output2 for writing : $!");

# Some of the svg has a lot of crud in the source that needs debugging ;-)
my $svg='<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 10.0, SVG Export Plug-In . SVG Version: 3.0.0 Build 77)  -->
<svg
   xmlns:i="http://ns.adobe.com/AdobeIllustrator/10.0/"
   xmlns:ns0="http://ns.adobe.com/SaveForWeb/1.0/"
   xmlns:ns="http://ns.adobe.com/Variables/1.0/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   overflow="visible"
   xml:space="preserve"
   id="svg17258"
   sodipodi:version="0.32"
   inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"';

print OUT $svg;
print OUT2 $svg;

my $filename=$output;
$filename=~s/^.*\///;
print OUT '
   width="1920"
   height="1200"
   sodipodi:docname="'.$filename.'"';
$filename=$output2;
$filename=~s/^.*\///;
print OUT2 '
   width="1600"
   height="1200"
   sodipodi:docname="'.$filename.'"';

# I really should try and get the swirl and logo back out into their own files?
$svg='
   inkscape:output_extension="org.inkscape.output.svg.inkscape"
   version="1.0"
   style="overflow:visible"
   inkscape:export-filename="/home/niall/foss/fullstory/aptosid-art/aptosid.png"
   inkscape:export-xdpi="90"
   inkscape:export-ydpi="90"><defs
   id="defs27210"><linearGradient
   id="linearGradient9831"><stop
     style="stop-color:#bd7006;stop-opacity:0.48223349;"
     offset="0"
     id="stop9825" /><stop
     style="stop-color:#1aa8cd;stop-opacity:0.75126904;"
     offset="1"
     id="stop9827" /></linearGradient>
     <inkscape:perspective
   sodipodi:type="inkscape:persp3d"
   inkscape:vp_x="0 : 526.18109 : 1"
   inkscape:vp_y="0 : 1000 : 0"
   inkscape:vp_z="744.09448 : 526.18109 : 1"
   inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
   id="perspective27212" /><linearGradient
   id="linearGradient17012"><stop
     id="stop17014"
     offset="0"
     style="stop-color:#ffffff;stop-opacity:0;" /><stop
     style="stop-color:#ffffff;stop-opacity:1;"
     offset="0.5"
     id="stop17016" /><stop
     id="stop17018"
     offset="1"
     style="stop-color:#ffffff;stop-opacity:0;" /></linearGradient><linearGradient
   y2="731.62067"
   x2="1195.9862"
   y1="731.62067"
   x1="782.40515"
   gradientTransform="translate(0,-20)"
   gradientUnits="userSpaceOnUse"
   id="linearGradient16883"
   xlink:href="#linearGradient19894"
   inkscape:collect="always" /><linearGradient
   id="linearGradient19894"><stop
     id="stop19896"
     offset="0"
     style="stop-color:#ffffff;stop-opacity:0;" /><stop
     style="stop-color:#ffffff;stop-opacity:1;"
     offset="0.5"
     id="stop19902" /><stop
     id="stop19898"
     offset="1"
     style="stop-color:#ffffff;stop-opacity:0;" /></linearGradient><filter
   inkscape:label="glow"
   id="filter17000"><feGaussianBlur
     result="result1"
     stdDeviation="2.2928767123287668"
     id="feGaussianBlur17002" /><feComposite
     k2="1.8552036199095028"
     k1="0.67873303167420751"
     in2="SourceGraphic"
     operator="xor"
     in="result1"
     id="feComposite17004" /></filter><filter
   inkscape:label="glow"
   id="filter16994"><feGaussianBlur
     result="result1"
     stdDeviation="2.2928767123287668"
     id="feGaussianBlur16996" /><feComposite
     k2="1.8552036199095028"
     k1="0.67873303167420751"
     in2="SourceGraphic"
     operator="xor"
     in="result1"
     id="feComposite16998" /></filter><filter
   inkscape:label="glow"
   id="filter3478"><feGaussianBlur
     result="result1"
     stdDeviation="9.9427814569536412"
     id="feGaussianBlur3480" /><feComposite
     k2="1.8552036199095028"
     k1="0.67873303167420751"
     in2="SourceGraphic"
     operator="xor"
     in="result1"
     id="feComposite3482" /></filter><inkscape:perspective
   sodipodi:type="inkscape:persp3d"
   inkscape:vp_x="0 : 0.5 : 1"
   inkscape:vp_y="0 : 1000 : 0"
   inkscape:vp_z="1 : 0.5 : 1"
   inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
   id="perspective16987" /><inkscape:perspective
   id="perspective17039"
   inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
   inkscape:vp_z="744.09448 : 526.18109 : 1"
   inkscape:vp_y="0 : 1000 : 0"
   inkscape:vp_x="0 : 526.18109 : 1"
   sodipodi:type="inkscape:persp3d" /></defs><sodipodi:namedview
   inkscape:window-height="746"
   inkscape:window-width="1280"
   inkscape:pageshadow="2"
   inkscape:pageopacity="0.0"
   guidetolerance="10.0"
   gridtolerance="10.0"
   objecttolerance="10.0"
   borderopacity="1.0"
   bordercolor="#666666"
   pagecolor="#ffffff"
   id="base"
   showgrid="false"
   inkscape:zoom="0.30402572"
   inkscape:cx="1037.2578"
   inkscape:cy="145.96503"
   inkscape:window-x="-3"
   inkscape:window-y="-4"
   inkscape:current-layer="svg17258"
   borderlayer="true" />
	<metadata
   id="metadata17260">
		<ns:variableSets>
			<ns:variableSet
   varSetName="binding1"
   locked="none">
				<ns:variables />
				<ns:sampleDataSets />
			</ns:variableSet>
		</ns:variableSets>
		<ns0:sfw>
			<ns0:slices />
			<ns0:sliceSourceBounds
   y="341.555"
   x="262"
   width="87.041"
   height="108.445"
   bottomLeftOrigin="true" />
		</ns0:sfw>
	<rdf:RDF><cc:Work
     rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
       rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata>
<g
   id="dummy"
   style="opacity:0"
   transform="matrix(0.99663714,0,0,0.99663714,63.144756,76.512736)">
	<g
   id="swirl">
		<path
   i:knockout="Off"
   fill=""
   d="m 51.986,57.297 c -1.797,0.025 0.34,0.926 2.686,1.287 0.648,-0.506 1.236,-1.018 1.76,-1.516 -1.461,0.358 -2.948,0.366 -4.446,0.229"
   id="path32" />
		<path
   i:knockout="Off"
   fill=""
   d="m 61.631,54.893 c 1.07,-1.477 1.85,-3.094 2.125,-4.766 -0.24,1.192 -0.887,2.221 -1.496,3.307 -3.359,2.115 -0.316,-1.256 -0.002,-2.537 -3.612,4.546 -0.496,2.726 -0.627,3.996"
   id="path34" />
		<path
   i:knockout="Off"
   fill=""
   d="m 65.191,45.629 c 0.217,-3.236 -0.637,-2.213 -0.924,-0.978 0.335,0.174 0.6,2.281 0.924,0.978"
   id="path36" />
		<path
   i:knockout="Off"
   fill=""
   d="m 45.172,1.399 c 0.959,0.172 2.072,0.304 1.916,0.533 1.049,-0.23 1.287,-0.442 -1.916,-0.533"
   id="path38" />
		<path
   i:knockout="Off"
   fill=""
   d="M 47.088,1.932 46.41,2.072 47.041,2.016 47.088,1.932"
   id="path40" />
		<path
   i:knockout="Off"
   fill=""
   d="m 76.992,46.856 c 0.107,2.906 -0.85,4.316 -1.713,6.812 l -1.553,0.776 c -1.271,2.468 0.123,1.567 -0.787,3.53 -1.984,1.764 -6.021,5.52 -7.313,5.863 -0.943,-0.021 0.639,-1.113 0.846,-1.541 -2.656,1.824 -2.131,2.738 -6.193,3.846 L 60.16,65.878 C 50.142,70.591 36.226,61.251 36.409,48.507 c -0.107,0.809 -0.304,0.607 -0.526,0.934 -0.517,-6.557 3.028,-13.143 9.007,-15.832 5.848,-2.895 12.704,-1.707 16.893,2.197 -2.301,-3.014 -6.881,-6.209 -12.309,-5.91 -5.317,0.084 -10.291,3.463 -11.951,7.131 -2.724,1.715 -3.04,6.611 -4.227,7.507 -1.597,11.737 3.004,16.808 10.787,22.773 1.225,0.826 0.345,0.951 0.511,1.58 -2.586,-1.211 -4.954,-3.039 -6.901,-5.277 1.033,1.512 2.148,2.982 3.589,4.137 -2.438,-0.826 -5.695,-5.908 -6.646,-6.115 4.203,7.525 17.052,13.197 23.78,10.383 -3.113,0.115 -7.068,0.064 -10.566,-1.229 -1.469,-0.756 -3.467,-2.322 -3.11,-2.615 9.182,3.43 18.667,2.598 26.612,-3.771 2.021,-1.574 4.229,-4.252 4.867,-4.289 -0.961,1.445 0.164,0.695 -0.574,1.971 2.014,-3.248 -0.875,-1.322 2.082,-5.609 l 1.092,1.504 c -0.406,-2.696 3.348,-5.97 2.967,-10.234 0.861,-1.304 0.961,1.403 0.047,4.403 1.268,-3.328 0.334,-3.863 0.66,-6.609 0.352,0.923 0.814,1.904 1.051,2.878 -0.826,-3.216 0.848,-5.416 1.262,-7.285 -0.408,-0.181 -1.275,1.422 -1.473,-2.377 0.029,-1.65 0.459,-0.865 0.625,-1.271 -0.324,-0.186 -1.174,-1.451 -1.691,-3.877 0.375,-0.57 1.002,1.478 1.512,1.562 -0.328,-1.929 -0.893,-3.4 -0.916,-4.88 -1.49,-3.114 -0.527,0.415 -1.736,-1.337 -1.586,-4.947 1.316,-1.148 1.512,-3.396 2.404,3.483 3.775,8.881 4.404,11.117 -0.48,-2.726 -1.256,-5.367 -2.203,-7.922 0.73,0.307 -1.176,-5.609 0.949,-1.691 C 83.519,18.706 76.074,10.902 69.225,7.24 70.063,8.007 71.121,8.97 70.741,9.121 67.335,7.093 67.934,6.935 67.446,6.078 64.671,4.949 64.489,6.169 62.651,6.08 57.421,3.306 56.413,3.601 51.6,1.863 l 0.219,1.023 c -3.465,-1.154 -4.037,0.438 -7.782,0.004 -0.228,-0.178 1.2,-0.644 2.375,-0.815 -3.35,0.442 -3.193,-0.66 -6.471,0.122 0.808,-0.567 1.662,-0.942 2.524,-1.424 -2.732,0.166 -6.522,1.59 -5.352,0.295 -4.456,1.988 -12.37,4.779 -16.811,8.943 l -0.14,-0.933 c -2.035,2.443 -8.874,7.296 -9.419,10.46 l -0.544,0.127 c -1.059,1.793 -1.744,3.825 -2.584,5.67 -1.385,2.36 -2.03,0.908 -1.833,1.278 -2.724,5.523 -4.077,10.164 -5.246,13.97 0.833,1.245 0.02,7.495 0.335,12.497 -1.368,24.704 17.338,48.69 37.785,54.228 2.997,1.072 7.454,1.031 11.245,1.141 -4.473,-1.279 -5.051,-0.678 -9.408,-2.197 -3.143,-1.48 -3.832,-3.17 -6.058,-5.102 l 0.881,1.557 c -4.366,-1.545 -2.539,-1.912 -6.091,-3.037 l 0.941,-1.229 C 28.751,98.334 26.418,96.056 25.78,94.795 l -1.548,0.061 c -1.86,-2.295 -2.851,-3.949 -2.779,-5.23 l -0.5,0.891 c -0.567,-0.973 -6.843,-8.607 -3.587,-6.83 -0.605,-0.553 -1.409,-0.9 -2.281,-2.484 l 0.663,-0.758 c -1.567,-2.016 -2.884,-4.6 -2.784,-5.461 0.836,1.129 1.416,1.34 1.99,1.533 -3.957,-9.818 -4.179,-0.541 -7.176,-9.994 L 8.412,66.472 C 7.926,65.74 7.631,64.945 7.24,64.165 l 0.276,-2.75 C 4.667,58.121 6.719,47.409 7.13,41.534 7.415,39.145 9.508,36.602 11.1,32.614 l -0.97,-0.167 c 1.854,-3.234 10.586,-12.988 14.63,-12.486 1.959,-2.461 -0.389,-0.009 -0.772,-0.629 4.303,-4.453 5.656,-3.146 8.56,-3.947 3.132,-1.859 -2.688,0.725 -1.203,-0.709 5.414,-1.383 3.837,-3.144 10.9,-3.846 0.745,0.424 -1.729,0.655 -2.35,1.205 4.511,-2.207 14.275,-1.705 20.617,1.225 7.359,3.439 15.627,13.605 15.953,23.17 l 0.371,0.1 c -0.188,3.802 0.582,8.199 -0.752,12.238 l 0.908,-1.912"
   id="path42" />
		<path
   i:knockout="Off"
   fill=""
   d="m 32.372,59.764 -0.252,1.26 c 1.181,1.604 2.118,3.342 3.626,4.596 -1.085,-2.118 -1.891,-2.993 -3.374,-5.856"
   id="path44" />
		<path
   i:knockout="Off"
   fill=""
   d="m 35.164,59.654 c -0.625,-0.691 -0.995,-1.523 -1.409,-2.352 0.396,1.457 1.207,2.709 1.962,3.982 l -0.553,-1.63"
   id="path46" />
		<path
   i:knockout="Off"
   fill=""
   d="m 84.568,48.916 -0.264,0.662 c -0.484,3.438 -1.529,6.84 -3.131,9.994 1.77,-3.328 2.915,-6.968 3.395,-10.656"
   id="path48" />
		<path
   i:knockout="Off"
   fill=""
   d="M 45.527,0.537 C 46.742,0.092 48.514,0.293 49.803,0 48.123,0.141 46.451,0.225 44.8,0.438 l 0.727,0.099"
   id="path50" />
		<path
   i:knockout="Off"
   fill=""
   d="m 2.872,23.219 c 0.28,2.592 -1.95,3.598 0.494,1.889 1.31,-2.951 -0.512,-0.815 -0.494,-1.889"
   id="path52" />
		<path
   i:knockout="Off"
   fill=""
   d="M 0,35.215 C 0.563,33.487 0.665,32.449 0.88,31.449 -0.676,33.438 0.164,33.862 0,35.215"
   id="path54" />
	</g>
</g>';

if ($background==1) {
	$svg.='
<g
   inkscape:groupmode="layer"
   id="layer4"
   inkscape:label="bg"><rect
     style="fill:url(#linearGradient9831);fill-opacity:1;stroke:#000000;stroke-width:0.95336521;stroke-opacity:1"
     id="rect9821"
     width="1416.9596"
     height="2153.749"
     x="-1304.1951"
     y="-197.71741"
     transform="matrix(0,-1,1,0,0,0)" /></g>';
}

print OUT $svg;
print OUT2 $svg;

# We want to adjust the 
print OUT '
<g
   transform="matrix(8.233832,0,0,8.233832,-141.66944,-60.415707)"
   id="g58">
	<g
   transform="translate(-30,-80)"
   id="g60">
';

print OUT2 '
<g
   transform="matrix(8.6022854,0,0,8.6022854,-376.86966,-103.2835)"
   id="g58">
	<g
   transform="translate(-30,-80)"
   id="g60">
';

my ($name,$pos,$x,$y,$size,$version,$fill);
my (@aaaa);
my (@zzzz);
while ($_=shift(@inputs))
{
	my ($gz)=0;
	if (s/\.gz$//)
	{
		system("zcat $_.gz > $_");
		$gz=1;
	}
	open(STATUS,"$_")||usage("failed to open $_ : $!");
	while (<STATUS>)
	{
		chomp;
		my(@p);
		if (s/^Package\:\s+//)
		{
			if ($disable==0)
			{
				$out{$size}.='
<g
   transform="scale('.$size.','.$size.')"
   id="g'.$name.'"
   style="opacity:0.25">
	<use
   x="'.$x.'"
   y="'.$y.'"
   xlink:href="#swirl"
   style="fill:'.$fill.'"
   id="use'.$name.'"
   width="1900"
   height="1280" />
</g>
';
			}
			$name=$_;
			$status=0;
			foreach $re ('^lib','[-0\.]+$')
			{
				s/$re//;
			}
			my $p0=-1;
			my $new='';
			foreach $p (split(//))
			{
				push(@p,$p) if (index($_digits,uc($p)) >0);
				if ($p=~/\-/)
				{
					if ($p0==-1)
					{
						$new=join('',@p);
						$p0=length($new);
					}
				}
			}
			if (length($new)==$p0)
			{
				$_=$new;
			}
			else
			{
				$_=join('',@p);
				$p0=0;
			}
			unless ($aaaa[length($_)])
			{
				my ($j,$k)='';
				for ($i=0;$i<length($_);$i++)
				{
					$j.='A';
					$k.='Z';
				}
				$aaaa[length($_)]=point($j);
				$zzzz[length($_)]=point($k);				
			}
			$pos=point($_)-($aaaa[length($_)]);
			$x=sprintf("%.4f",($pos*100.0/($zzzz[length($_)]-$aaaa[length($_)])));
			$_=join('',@p);
			unless ($aaaa[(length($_)-$p0)])
			{
				my ($j,$k)='';
				for ($i=0;$i<(length($_)-$p0);$i++)
				{
					$j.='A';
					$k.='Z';
				}
				$aaaa[(length($_)-$p0)]=point($j);
				$zzzz[(length($_)-$p0)]=point($k);				
			}
			$pos=point(substr($_,$p0,(length($_)-$p0)));
			$y=sprintf("%.4f",($pos*100.0/(($zzzz[(length($_)-$p0)]))));
		}
		elsif (/^Status\:/)
		{
			if (/^Status\:\ install\ ok\ installed\s*$/)
			{
				$status=1;
			}
			$aptlists=0;
		}
		elsif (s/^Installed-Size\:\s+//)
		{
			$rawsize=$_;
			$size=($_**(1.0/3.0))/3.0;
		}
		elsif (s/^Version:\s+//)
		{
			$disable=0;
			$version="$_";
			s/cvs//;
			s/svn//;
			s/0.200/200/;
			s/\-.*//;
			s/(\d\.\d+).*/$1/;
			s/\d*\://;
			if (($status==1)||($aptlists==1))
			{
				my $tmp=($_*1.0);
				if ($tmp<1.0)
				{
					$tmp=~s/^0.//;
					while($tmp>100)
					{
						$tmp*=0.1;
					}
					my $colour=int( $tmp / 100.0 );
					$fill="rgb($colour,".(128+$colour).",".(192-$colour).")";
				}
				elsif ($_>=1990.0)
				{
					$fill="rgb(255,255,255)";
				}
				else
				{
					my $colour= int( log($tmp) * 64.0);
					# BUG could give too much blue! should limit to 127
					if ($colour >=256)
					{
						$colour=255;
					}
					$fill="rgb(128,".(255-$colour).",".(128+$colour).")";
				}
			}
			else
			{
				$fill="rgb(60,60,60)";
				$disable=1;
			}
		}
	}
	close(STATUS);
	unlink($_) if ($gz);
}

# When we draw the swirls we do the biggest first
foreach (sort {$b<=>$a} (keys(%out)))
{
	if ($_)
	{
		print OUT $out{$_};
		print OUT2 $out{$_};
	}
}
print OUT '
</g>
</g>
<g
   transform="translate(2340,1016)"';
print OUT2 '
</g>
</g>
<g
   transform="translate(2060,1016)"';
$svg='
   id="logolayer"
   inkscape:label="Layer 1"
   style="filter:url(#filter3478)">
	<g
   transform="matrix(2,0,0,2,-2776.5917,-1337.836)"
   id="logo">
		<path
   id="aptosid"
   inkscape:export-ydpi="90"
   inkscape:export-xdpi="90"
   inkscape:export-filename="/home/bgray/software/aptosid-art/svg-core/aptosid-logo.png"
   sodipodi:nodetypes="ccccccssccccsccccccccsccccscccccccccccccccccccccccccccccscsccccccccscccccccccscccccccccccccccccccccccccccccccc"
   d="m 782.6722,685.02653 0,16.15567 c 0,1.02576 0.51289,1.53863 1.53864,1.53863 l 51.54427,0 c 3.5901,0 6.5135,-0.87188 8.77022,-2.61567 2.25661,-1.84637 4.0004,-4.00044 5.23136,-6.46227 2.25659,-4.30817 3.38493,-8.87278 3.38501,-13.69385 -8e-5,-5.53906 -0.46168,-10.10367 -1.38478,-13.69385 -0.92325,-3.59012 -2.30802,-6.41094 -4.15431,-8.4625 -1.84643,-2.15404 -4.25696,-3.69267 -7.23159,-4.61591 -2.87218,-0.92313 -6.35974,-1.38472 -10.46272,-1.38476 l -20.77157,0 c -4.61593,4e-5 -6.92388,-2.05147 -6.92386,-6.15455 -2e-5,-3.89781 2.30793,-5.84675 6.92386,-5.84681 l 39.08133,0 c 1.0257,6e-5 1.53857,-0.51282 1.53863,-1.53864 l 0,-16.0018 c -6e-5,-1.12825 -0.51293,-1.69241 -1.53863,-1.6925 l -34.00383,0 c -5.43654,9e-5 -10.05244,0.3591 -13.84772,1.07704 -7.69318,1.23099 -12.66811,4.92372 -14.92476,11.07818 -1.23091,3.28248 -1.84636,7.53937 -1.84636,12.77067 0,7.59065 1.53863,13.43745 4.6159,17.54044 1.53862,2.15413 3.59014,3.84663 6.15454,5.0775 2.66696,1.23093 5.89809,1.84639 9.6934,1.84636 l 23.54112,0 c 4.30813,3e-5 6.46222,2.05154 6.46227,6.15454 -5e-5,4.92365 -2.15414,7.38547 -6.46227,7.38544 l -43.38951,0 c -1.02575,3e-5 -1.53864,0.51289 -1.53864,1.53864 m 80.38141,14.92476 c 0,1.84636 0.51287,2.76954 1.53864,2.76954 l 16.15565,0 c 1.02575,0 1.53862,-0.92318 1.53865,-2.76954 l 0,-76.93176 c -3e-5,-1.64112 -0.5129,-2.46172 -1.53865,-2.46181 l -16.15565,0 c -1.02577,9e-5 -1.53864,0.82069 -1.53864,2.46181 l 0,76.93176 m 86.50363,-80.93221 0,-27.07997 c -10e-5,-1.43595 0.5641,-2.15398 1.6925,-2.15409 l 16.00178,0 c 1.0257,1.1e-4 1.5385,0.71814 1.5386,2.15409 l 0,108.01218 c -10e-5,1.84636 -0.5129,2.76954 -1.5386,2.76954 l -45.38978,0 c -11.69361,0 -20.46381,-4.97491 -26.31062,-14.92475 -4.30817,-7.38543 -6.25711,-15.8992 -5.84681,-25.54135 0.61546,-11.69357 2.5131,-20.20734 5.69296,-25.54134 6.2571,-10.66779 14.77086,-16.00172 25.54137,-16.00181 l 27.0799,-0.15386 c 1.0257,9e-5 1.5386,-0.51279 1.5387,-1.53864 m 0,22.46407 c -10e-5,-1.12826 -0.513,-1.69243 -1.5387,-1.69249 l -17.0788,0 c -8.3087,6e-5 -13.48873,1.02582 -15.54022,3.07727 -2.05154,2.05157 -3.64146,4.71854 -4.76977,8.0009 -1.12836,2.97475 -1.69252,6.77005 -1.6925,11.3859 -2e-5,5.74427 1.28217,10.51403 3.84659,14.30931 3.07725,4.61593 9.1292,6.92388 18.1559,6.92385 l 17.0788,0 c 1.0257,3e-5 1.5386,-0.51285 1.5387,-1.53863 l 0,-40.46611 m 77.15016,-16.30952 0,52.15972 c 0,1.8464 -1.5386,3.43631 -4.6159,4.76978 -2.8721,1.23091 -6.3597,1.84637 -10.4627,1.84635 -4.3082,2e-5 -7.847,-0.61544 -10.6166,-1.84635 -3.17978,-1.43605 -4.76978,-3.02596 -4.76968,-4.76978 l 0,-52.15972 c -10e-5,-2.25658 -0.5129,-3.38492 -1.5387,-3.38501 l -15.6941,0 c -1.0257,9e-5 -1.5386,1.12843 -1.5386,3.38501 l 0,58.77585 c 0,3.28244 1.0258,6.10327 3.0773,8.4625 3.8979,4.61591 10.1037,7.69318 18.6175,9.23181 4.00038,0.71803 8.15468,1.07704 12.46288,1.07704 4.103,0 8.1547,-0.35901 12.1552,-1.07704 8.6163,-1.53863 14.8735,-4.6159 18.7714,-9.23181 1.9488,-2.35923 2.9233,-5.18006 2.9234,-8.4625 l 0,-58.77585 c -1e-4,-2.25658 -0.513,-3.38492 -1.5386,-3.38501 l -15.6941,0 c -1.0258,9e-5 -1.5387,1.12843 -1.5387,3.38501 m 102.6917,75.54698 -23.5412,-36.77338 c -1.5386,-2.25662 -1.4874,-4.61587 0.1539,-7.07773 l 22.1564,-34.92701 c 0.6153,-1.02567 0.4615,-1.53856 -0.4616,-1.53863 l -21.3871,0 c -1.3335,7e-5 -2.308,0.51296 -2.9234,1.53863 l -8.7702,14.7709 c -1.7438,2.97476 -3.5389,2.97476 -5.3852,0 l -8.9241,-14.7709 c -0.6155,-1.02567 -1.5387,-1.53856 -2.7695,-1.53863 l -21.5409,0 c -0.9232,7e-5 -1.0771,0.51296 -0.4616,1.53863 l 22.3102,34.92701 c 1.6412,2.46186 1.6925,4.82111 0.1538,7.07773 l -23.8488,37.23497 c -0.6155,0.92319 -0.5642,1.38477 0.1539,1.38477 l 20.1561,0 c 1.2309,0 2.1028,-0.4103 2.6157,-1.23091 l 12.309,-19.07907 c 1.6412,-2.56437 3.2824,-2.56437 4.9237,0 l 12.4629,19.07907 c 0.5128,0.82061 1.3335,1.23091 2.4618,1.23091 l 20.0023,0 c 0.9231,0 0.9744,-0.61546 0.1539,-1.84636"
   style="font-size:156px;font-style:normal;font-weight:bold;opacity:0.65495211;fill:#1b1f21;fill-opacity:1;stroke:#ffffff;stroke-width:1.52840424;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;filter:url(#filter3478);font-family:aptosid" />
		<path
   id="orbit"
   inkscape:export-ydpi="90"
   inkscape:export-xdpi="90"
   inkscape:export-filename="/home/bernie/software/aptosid-art/gaia/ksplash-logo.png"
   sodipodi:type="arc"
   style="opacity:0.65495211;fill:#1b1f21;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:2.06036639;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter3478);enable-background:accumulate"
   sodipodi:cx="893.33331"
   sodipodi:cy="100"
   sodipodi:rx="18.333334"
   sodipodi:ry="18.333334"
   d="m 911.66665,100 c 0,10.12 -8.21334,18.33333 -18.33334,18.33333 -10.12,0 -18.33333,-8.21333 -18.33333,-18.33333 0,-10.12 8.21333,-18.333334 18.33333,-18.333334 10.12,0 18.33334,8.213334 18.33334,18.333334 z"
   transform="matrix(0.7418119,0,0,0.7418119,209.96017,527.05659)" /><path
   style="opacity:0.65495211;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.70059466;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter3478);enable-background:accumulate"
   d="m 858.75,598 c -12.87864,0.96341 -30.73719,6.48918 -48.125,15.9375 -4.34892,2.36317 -8.48368,4.82759 -12.40625,7.375 2.56157,-0.66994 5.27395,-1.0252 7.9375,-1.21875 1.8489,-1.09053 3.72715,-2.1705 5.65625,-3.21875 17.34846,-9.42693 34.19334,-14.8146 46.53125,-15.65625 0.002,-1.1088 0.16368,-2.18198 0.40625,-3.21875 z m 14.3125,5.46875 c -0.37539,0.0795 -0.72064,0.36247 -0.9375,0.75 -0.28916,0.51671 -0.30227,1.15768 -0.0312,1.6875 0.81224,2.02149 0.48536,4.84231 -1.21875,8.40625 -1.70413,3.56394 -4.76581,7.71722 -8.90625,12.0625 -8.28087,8.69056 -20.88949,18.15797 -35.78125,26.25 -14.89178,8.09199 -29.26741,13.28274 -40.3125,15.09375 -5.52253,0.90548 -10.18092,0.95396 -13.625,0.1875 -3.44409,-0.76645 -5.50025,-2.29098 -6.3125,-4.3125 -0.81226,-2.02151 -0.48536,-4.81106 1.21875,-8.375 1.7041,-3.56396 4.70332,-7.71723 8.84375,-12.0625 2.43424,-2.55468 4.74111,-5.26865 7.875,-7.90625 0.32976,-1.15701 0.53203,-1.9259 1,-3.125 0.034,-0.087 0.0925,-0.16239 0.125,-0.25 0.20451,-0.54738 0.43811,-1.06413 0.6875,-1.5625 -4.38173,3.4889 -8.26875,7.0136 -11.53125,10.4375 -4.28733,4.49942 -7.53087,8.85342 -9.46875,12.90625 -1.93785,4.05285 -2.6139,7.99579 -1.28125,11.3125 1.33268,3.31669 4.39598,5.25339 8.3125,6.125 3.9165,0.87159 8.84402,0.75013 14.5625,-0.1875 11.43696,-1.87524 25.99327,-7.16956 41.09375,-15.375 15.10048,-8.20545 27.89406,-17.78237 36.46875,-26.78125 4.28735,-4.49942 7.53087,-8.82217 9.46875,-12.875 1.93789,-4.05281 2.6139,-7.99579 1.28125,-11.3125 -0.17557,-0.58169 -0.62993,-1.02016 -1.15625,-1.09375 -0.13159,-0.0184 -0.24987,-0.0265 -0.375,0 z"
   id="path1326" />
	</g>
</g>
</svg>'."\n";
print OUT $svg;
print OUT2 $svg;
close(OUT);
close(OUT2);

