Skip to content

Instantly share code, notes, and snippets.

@TK009
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save TK009/1ae59fe5ee929d6e0bcf to your computer and use it in GitHub Desktop.

Select an option

Save TK009/1ae59fe5ee929d6e0bcf to your computer and use it in GitHub Desktop.
Generate monospace ascii html file from `remind` reminders.
#!/usr/bin/sh
# author: Tuomas Kinnunen
# last update: Mon 22 Sep 17:29:03 EEST 2014
# ------------------------------------------------------------------------------
# Generates monospace ascii html file from `remind` reminders.
# usage: just call this script daily to update the static html file, $DESTINATION
# Source of reminders
REMINDERS=$HOME/.reminders
# Destination
DESTINATION=$HOME/www/cal/index.html
# How many weeks is in the generated html calendar
WEEKS=2
# Width of lines in the output, in chars
WIDTH=110
# Generate html body
# -m: monday is first day of week, -b1: 24-hour clock
CAL=`remind -m -b1 -c+$WEEKS -w$WIDTH $REMINDERS`
echo "<html>
<head>
<title>TKn kalenteri</title>
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>
<meta charset=\"utf-8\">
</head>
<body><pre>$CAL</pre></body>
</html>" > $DESTINATION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment