A PiPresents pipresents.wordpress.com/ show (we're talking about a Raspberry Pi running Raspbian) can be set to end at a time of day, but it does not have a way to set a day of the week. I have created a workaround for this using the standard Linux cron scheduler and some bash scripts.

Let's take a look at the first script. I think the comments explain it well enough. I named mine pp.sh. Be sure to make the file executable after you create it.

#!/bin/bash

# the name of the profile should be passed to this script
profile=$1

# show a black/blank screen
qiv -fmisC -d 5 /home/pi/media/common/blank.png &
# stop any running PiPresents shows
kill $(ps aux | grep pipresents.py | awk '{ print $2 }')
sleep 3;
# start the new show with the given profile and in the home folder below
python /home/pi/pipresents/pipresents.py -fb -o /home/pi/media -p "${profile}"

Now add an entry in cron to start the show. Run cron from your normal user (pi) in a terminal with crontab -e. The entry below starts a profile named 'myshow' at 8:30 am every sunday.

30 08 * * 0 /home/pi/pp.sh myshow

That's really all there is to it.

However, I also have a script to turn the screen on and off as part of the schedule, which would have a cron entry like this to turn off at 1:00 PM.

30 08 * * 0 /home/pi/screen.sh on; /home/pi/pp.sh myshow
00 13 * * 0 /home/pi/screen.sh off

Screen.sh looks like this.

#!/bin/bash

export XAUTHORITY=/home/pi/.Xauthority
export DISPLAY=":0"
export XAUTHLOCALHOSTNAME=localhost

if [ "$1" == "on" ]; then

  # see if we're already on
  state=$(tvservice -s | grep -oE 'DMT|CEA')
  echo "${state}"
  if [[ $state = "DMT" || $state = "CEA" ]]; then
    exit 0
  fi

  # turn on
  tvservice -p; 
  sleep 1;
  fbset -depth 8
  fbset -depth 16
  xrefresh
  sleep 3;

  # see if we're really on
  state=$(tvservice -s | grep -oE 'DMT|CEA')
  echo "${state}"
  if [[ $state = "DMT" || $state = "CEA" ]]; then
    exit 0
  fi
  exit 1
fi

if [ "$1" == "off" ]; then

  # see if we're already off
  state=$(tvservice -s | grep -o  'off')
  if [[ ${state} == "off" ]]; then
    exit 0
  fi

  # turn off
  tvservice -o;
  sleep 5;

  # see if we're really off
  state=$(tvservice -s | grep -o  'off')
  if [[ ${state} == "off" ]]; then
    exit 0
  fi
  exit 1
fi

Another improvement might be to turn off the PiPresents show when turning off the screen and turn on the screen based on some input.

Converting version control repositories from Bazaar to Git (bzr to git)

Bazaar is great on Windows. Several years later, git's tools for Windows still.... (ahem) are lacking or too commercial. However, official development on it has ended and git is so much more popular now. So I think the time has come to convert all my beloved bzr repositories to git.

First we need note some prerequisites:

Adding a hardware clock to Raspberry Pi (DS3231)

The popular clock module is uses the DS1307 real time clock chip, which is not very precise. For just a few dollars more, you can get a module with a much more precise DS3231 RTC chip. The one I got was SunFounder's module from Amazon for $9 (free shipping for Prime). It plugs right onto the Raspberry Pi's 40 pin header and doesn't even interfere with the plastic case I have. I have a Model B, but this module should also work on Model A and Model B+. The instructions refer to DS1307, but the chips use the same I2C commands, so it also works for DS3231.

How to run a PiPresents show when you don't have a Raspberry Pi

PiPresents is some pretty cool software that will run a PowerPoint-like presentation. But with lots more flexibility. It was originally written for the Raspberry Pi.

However.... perhaps someone else has your Pi. Perhaps you don't even have one. It is possible to run a PiPresents show on  your good ol' desktop computer (Windows, Linux, or Mac). Here's how.