wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

mkfile (1044B)


      1 MKSHELL=rc
      2 path=$PLAN9/bin $path
      3 
      4 eps = wmii.eps
      5 calc = rc -c 'echo 4k $* p | dc}
      6 
      7 iconwidth  = 16
      8 imagewidth = 154
      9 
     10 %.pdf: %.eps
     11 	sh epstopdf $stem.eps
     12 
     13 %-small.png: %.eps
     14 	epsbox = `{sed -n '/^%%BoundingBox:/{s/.*://p; q;}' $stem.eps}
     15 	iconscale = `{*=$epsbox; $calc $iconwidth $3 $1 -/}
     16 	iconheight = `{*=$epsbox; $calc $4 $2 - $iconscale '*'}
     17 	* = `{hoc -e'-('$epsbox')'}
     18 	x = $1
     19 	y = $2
     20 	gs -q -dBATCH -dNOPAUSE -s'DEVICE=pngalpha' -s'OutputFile='$target -g$iconwidth^x^$iconheight - <<!
     21 		$iconscale $iconscale scale
     22 		$x $y translate
     23 		($eps) run
     24 		showpage
     25 		quit
     26 	!
     27 	optipng -fix $target
     28 
     29 %.png: %.eps
     30 	epsbox = `{sed -n '/^%%BoundingBox:/{s/.*://p; q;}' $stem.eps}
     31 	imagescale = `{*=$epsbox; $calc $imagewidth $3 $1 -/}
     32 	imageheight = `{*=$epsbox; $calc $4 $2 - $imagescale '*'}
     33 	* = `{hoc -e'-('$epsbox')'}
     34 	x = $1
     35 	y = $2
     36 	gs -q -dBATCH -dNOPAUSE -s'DEVICE=pngalpha' -s'OutputFile='$target -g$imagewidth^x^$imageheight - <<!
     37 		$imagescale $imagescale scale
     38 		$x $y translate
     39 		($eps) run
     40 		showpage
     41 		quit
     42 	!
     43 	optipng -fix $target
     44