#!/bin/sh
# Generate suitable seasonal (month-sensitive) content insert for
# note-on-office-comfort-and-energy-efficiency.html

# With no args (as called from the makefile) means generate entire insert.
# With arg "winter" means generate the winter section.
# With arg "summer" means generate the summer section.

MONTH="`date +%m | awk '{print $1+0}'`"

if [ 0 -eq "$#" ]; then
    # As called from the makefile
    YEAR="`date +%Y`"

    if [ "$MONTH" -ge 11 ]; then
        echo "<p>What to fix for `expr 1 + $YEAR`?</p>"
    elif [ "$MONTH" -ge 9 ]; then
        echo "<p>What to fix in the rest of $YEAR?</p>"
    else
        echo "<p>What to fix for $YEAR?</p>"
    fi

    if [ "$MONTH" -ge 3 ] && [ "$MONTH" -le 8 ]; then
        # Summer first in hotter (UK) months.
        $0 summer
        $0 winter
    else
        $0 winter
        $0 summer
    fi
    exit 0
fi

# Spit out the requested section on stdout.

# Wrap the section a little for show and performance...
echo '<section class="conl secC">'

# By default randomise the order of the points.
sortCmd="sort -R"
# In deep winter however order so as to minimise updates and transmitted bytes!
if [ "$MONTH" -ge 11 ] || [ "$MONTH" -le 2 ]; then sortCmd="cat"; fi

case $1 in

    winter)

cat << EOT

<h2 id="Winter">Winter</h2>


<IMG src="http://gallery.hd.org/_tn/std/office-motes/office-space-empty-door-window-tweaked-1-ANON.jpg" class="respfloatr" alt="office open door drafty window" />


<p>
Avoid your fingers freezing to the desk...
</p>

<ul>
EOT

${sortCmd} << EOT
<li>There is no shame in thermal underwear.  Or even a second pair of socks.  It can be sexy too!  Keeping your body warm can be more effective and pleasant, and lower carbon, than trying to heat the whole room that you're in.</li>
<li>In winter don't be tempted to turn equipment on just to thaw the office.  Using your building's dedicated heating system will be cheaper.  It should work better too.  Not everyone realises it, but electricity and heat are both forms of energy.  Use the right one for the right job!</li>
<li>Avoid heating or cooling a room when its windows or doors are open.  You may be wasting <a href="http://www.closethedoor.org.uk//index.php?cID=140">half</a> your building's energy.  And exposing yourself to air pollution and noise from outside.</li>
<li>Get up and move about from time to time rather than cranking up the heat.  Activity is good for you and can make toes and fingers feel warmer.</li>
<li>Fix draughts around doors and windows.  Cold draughts lead to significant discomfort.  Make sure that you still have enough healthy ventilation, eg <a href="MHRV-Vent-Axia-Lo-Carbon-Tempra-P-REVIEW.html">MHRV</a>.</li>
<li>Clear obstructions around radiators and other heat sources.  Allow them to work efficiently.</li>
EOT

cat << EOT
</ul>

<p>
You know what makes building managers cry?  Electric space heaters
plugged in under desks.  For a start, they might overload circuits
only meant for computers.  Think of low-power 'UPS' circuits meant
to stay running though a power cut.  Yes, I have seen it happen.  But
they are also a fire-hazard and inefficient.  Try to find another
solution.  Something as simple as a raised footrest if the floor is cold!
</p>

EOT
        ;;

    summer)
cat << EOT


<h2 id="Summer">Summer</h2>


<IMG src="img/fan-sq.jpg" class="respfloatr" />


<p>
Some ideas to beat the office heat...
</p>

<ul>
EOT

${sortCmd} << EOT
<li>Make sure that you are not air-conditioning a room with open windows and doors.  You may be wasting half your building's energy.  And exposing yourself to air pollution from outside.</li>
<li>Even without aircon, <a href="manage-the-heat-Maltese-style.html">keeping blinds and windows closed during the heat of the day</a> can help keep heat out and indoors cool.</li>
<li>Whenever replacing equipment such as photocopiers, PCs, monitors, laptops, etc, go for the most efficient that you can afford.  Also make sure that the new gear has good low-power automatic standby modes.  Then you don't have to remember to manually turn things off when no one is using them.</li>
<li>Try to fit reflective blinds or shades to keep excess sunshine and heat out.  Especially on south- and west- facing windows.  Once sunlight is absorbed by a dark surface it will turn to heat and add to your discomfort.</li>
<li>Replace any lighting you have control over with the latest efficient LEDs.  (Get the right light colour while you're at it.)  High efficiency will minimise unwanted waste heat.  Preferably better than 100lm/W ie 100 lumens per watt, but over 95lm/W as a minimum for general lighting <time datetime="2022-08">now</time>.</li>
<li>A small fan (and lighter clothing) may maximise comfort without boiling any penguins...</li>
EOT

cat << EOT
</ul>

<p>
Oh, and if your office heating is wonky in winter,
lobby to fix it <em>now</em> while heating engineers are charging
normal rates.  Then no one will have to be bounced into an expensive
instant fix!</li>
</p>

EOT
        ;;

esac

echo '</section>'

exit 0
