#!/bin/sh

# Program: RxvtDateDemoPlugin Example version 1.0.1 by mcewanw                                                       

# Program: playslave (demo example) by mcewanw
# Create a symlink to this script named "playslave" and put it in the folder
# /usr/local/precord/
# This demo plugin script will then be activated by the precord play button.
# When you are tired of the demo..., just delete the symlink you made.
# For further details on using precord plugin apps download the provided
# documentation READMEplugins.txt

# execute the destroy_this function if kill -TERM received
trap destroy_this INT TERM

# Destroy the rxvt date window and its parent /bin/sh
destroy_this (){
  kill -TERM $pid 2>/dev/null
}

rxvt -e date &

pid=$!
wait $pid

# Cancel the set trap
trap - INT TERM EXIT
exit 0
