Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Allows a user to select a chained timer sequence, for example
- # 15 minute Circle tasks, 5 minute planning, 25 minute work.
- # Timer concept based on TaskBATL "FiTe Timer" module by Marc Carson
- # www.marccarsoncoaching.com
- # www.friendlyskies.net/intj/
- #
- # Dependencies: Zenity
- #
- ## To-Do List
- ## TODO: Make the script a tad more efficient. :]=
- ## TODO: Figure out how to make this thing let you start a new timer.
- # ScriptLocation=$(fiteme) ...recursion problems.
- function zenityNoWarn() {
- # Replace default zenity call with this handy Gtk error suppressor.
- # Without this you'll get Gtk Warnings in the terminal output.
- # Added 2020-04-05
- zenity "$@" 2> >(grep -v 'GtkDialog' >&2)
- }
- fitenormal () {
- # 15, 5, 25 minute timer function
- if zenityNoWarn --question --text="Start 15 minute circle timer?"; then
- zenityNoWarn --notification\
- --window-icon="info" \
- --text="Have fun for 15 minutes!"
- sleep 13m
- espeak "Two minutes of circle circle circle left."
- sleep 2m
- espeak "All done with fun. The fun is done."
- else
- exit 1
- fi
- if zenityNoWarn --question --text="Start 5 minute planning?"; then
- zenityNoWarn --notification\
- --window-icon="info" \
- --text="Planning or howling for 5 minutes begins now"
- sleep 3m
- espeak "Two minutes of planning left."
- sleep 2m
- espeak "All done with plan. The plan is the man."
- else
- exit 1
- fi
- if zenityNoWarn --question --text="Start 25 minute work tasks?"; then
- zenityNoWarn --notification\
- --window-icon="info" \
- --text="Work for 25 minutes begins now"
- sleep 23m
- espeak "Two minutes of work left."
- sleep 2m
- espeak "All done with work. To work is not to lurk. Have some fun."
- else
- exit 1
- fi
- if zenityNoWarn --question --text="Cycle complete. OK to start again?"; then
- echo "Run me again then. LOL"
- else
- exit 1
- fi
- }
- fiteheavy () {
- # 45-10-25 minute timer function
- if zenityNoWarn --question --text="Start 45 minute circle timer..."; then
- zenityNoWarn --notification\
- --window-icon="info" \
- --text="Circle activities for 45 minutes begins now"
- sleep 40m
- espeak "Five minutes of circle circle circle left."
- sleep 5m
- espeak "All done with circle. The circling has finished."
- else
- exit 1
- fi
- if zenityNoWarn --question --text="Start 10 minute planning?"; then
- zenityNoWarn --notification\
- --window-icon="info" \
- --text="Planning or howling for 10 minutes begins now"
- sleep 8m
- espeak "Two minutes of planning left."
- sleep 2m
- espeak "All done with planning. The planning is a wrap."
- else
- exit 1
- fi
- if zenityNoWarn --question --text="Start 25 minute work tasks?"; then
- zenityNoWarn --notification\
- --window-icon="info" \
- --text="Work for 25 minutes begins now"
- sleep 23m
- espeak "Two minutes of work left."
- sleep 2m
- espeak "All done with work. The work is a wrap. Have some fun."
- else
- exit 1
- fi
- if zenityNoWarn --question --text="Cycle complete. OK to start again?"; then
- echo "Run me again then. LOL"
- else
- exit 1
- fi
- }
- # Start: Present the user with a list of timers to choose.
- identifier=$(zenityNoWarn --list \
- --title="Choose your timer" \
- --column="Name" --column="Configuration" \
- Normal 15-5-25 \
- FiHeavy 45-10-25)
- norm="Normal"
- fiheavy="FiHeavy"
- if [ "$identifier" = "$norm" ]; then
- # They chose the Normal timer...
- fitenormal
- fi
- if [ "$identifier" = "$fiheavy" ]; then
- # They chose the FiHeavy timer...
- fiteheavy
- fi
Add Comment
Please, Sign In to add comment