Aronzak
August 10th, 2009, 05:57 AM
This is a small addition to the trivia app that lets the second trivia window have a second button called 'lookup' that will pass the Bible passage to Bibletime, letting a user see the context of the trivia question. I haven't figured out a way to do this with Xiphos (included by default). Would it be possible to include Bibletime by default? Or maybe can anyone work on Xiphos to add the ability to pass in a verse to lookup, like with bibletime's --open-default-bible?
#!/bin/sh
#Bible trivia for Linux
#Originally written by D.M. Bartusik <dmcb48@earthlink.net> 1-Jan-2001
# Re-written and debianize by David Kuntadi <d.kuntadi@gmail.com>
# Small addition by Aronzak
TODAY=`date +"%m%d"`
DATA=`grep $TODAY /usr/share/trivia/trivia.dat`
echo $DATA
HOUR=`date +"%H"`
if [ $HOUR -le 11 ]
then TOD="Morning"
elif [ $HOUR -ge 12 -a $HOUR -lt 18 ]
then TOD="Afternoon"
else
TOD="Evening"
fi
echo $DATA | awk -F"|" '{printf("%s\n\nAnswer: %s",$2,$3)}' > $HOME/.cache/trivia2
text2=`cat $HOME/.cache/trivia2`
echo $text2
zenity --question --width=530 --height=200 --title="Bible Trivia - Good $TOD! It's `date +"%A, %B %e, %Y"`" --ok-label=lookup --cancel-label=dismiss --text="$text2"
rc=$?
if [ "${rc}" = "1" ]; then
echo "Program terminated."
else
bibletime --open-default-bible "`grep \( $HOME/.cache/trivia2 | sed 's/^[^(]*//' | tr -d '()'`"
fi
#rm $HOME/.cache/trivia
#!/bin/sh
#Bible trivia for Linux
#Originally written by D.M. Bartusik <dmcb48@earthlink.net> 1-Jan-2001
# Re-written and debianize by David Kuntadi <d.kuntadi@gmail.com>
# Small addition by Aronzak
TODAY=`date +"%m%d"`
DATA=`grep $TODAY /usr/share/trivia/trivia.dat`
echo $DATA
HOUR=`date +"%H"`
if [ $HOUR -le 11 ]
then TOD="Morning"
elif [ $HOUR -ge 12 -a $HOUR -lt 18 ]
then TOD="Afternoon"
else
TOD="Evening"
fi
echo $DATA | awk -F"|" '{printf("%s\n\nAnswer: %s",$2,$3)}' > $HOME/.cache/trivia2
text2=`cat $HOME/.cache/trivia2`
echo $text2
zenity --question --width=530 --height=200 --title="Bible Trivia - Good $TOD! It's `date +"%A, %B %e, %Y"`" --ok-label=lookup --cancel-label=dismiss --text="$text2"
rc=$?
if [ "${rc}" = "1" ]; then
echo "Program terminated."
else
bibletime --open-default-bible "`grep \( $HOME/.cache/trivia2 | sed 's/^[^(]*//' | tr -d '()'`"
fi
#rm $HOME/.cache/trivia