#!/bin/bash
#FFAMILY=helvetica FFS=13
FFAMILY=dejavu-sans #changed
#ARCH=$(uname -m)
#[ "${ARCH##??}" != "86" ] && FFAMILY=dejavu-sans 
[ ! -d /etc/tempicon ] && mkdir /etc/tempicon
echo "generating icons"
for i in $(seq 10 1 105) ; do
T=53
FFS=38
[ "$i" -ge "100" ] && T=$FFS
BG="#FF0000" #red (default)
OPACITY=0.75
	[ "$i" -le "40" ] && BG='#00FFFF' OPACITY=0.2 #light blue
	[[ "$i" -gt "40" && "$i" -le "65" ]] && BG="#00FF00" OPACITY=0.2 #green
	[[ "$i" -gt "65" && "$i" -le "80" ]] && BG="#FFFF00" OPACITY=0.2 #yellow
echo '<?xml version="1.0" encoding="UTF-8"?>
<svg height="100" width="100" version="1.0">
  <rect width="98"
     height="75"
     x="1"
     y="12"
     rx="3"
     ry="3"
     style="font-size:'${T}';fill:'$BG';fill-opacity:'$OPACITY';fill-rule:evenodd;stroke-width:3pt;"
     id="rect1" />
  <text
     x="10"
     y="70"
     style="font-size:'${T}';font-weight:normal;fill-opacity:0.7;stroke-width:6pt;font-family:'$FFAMILY';"
     id="text1">
    <tspan
       id="tspan1">'"${i}°"'</tspan>
  </text>
</svg>' > icons/tempicon/temp${i}.svg
 done
