Created
April 14, 2011 20:24
-
-
Save jclaggett/920415 to your computer and use it in GitHub Desktop.
Revisions
-
jclaggett created this gist
Apr 14, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,48 @@ #!/bin/bash -e status_icon_000="/usr/share/icons/Humanity/apps/48/stock_delete-bookmark.svg" status_icon_100="/usr/share/icons/Humanity/apps/48/stock_bookmark.svg" function context_loop() { declare time_task while time_task=$(context_switch_dialog $*) do set $time_task # reference using positional args declare -i i=1+$1 echo "icon:$status_icon_000" while ((--i>0)) do echo "tooltip:Working on ${*:2} ($i minute$(s $i) left)" sleep 60 done echo "icon:$status_icon_100" echo "tooltip:Working on ${*:2} ($i minute$(s $i) left)" echo "message:Your $1 minute$(s $1) for working on ${*:2} are spent." done | context_notification } function context_switch_dialog() { zenity \ --entry \ --title='Context Switcher' \ --text='Please enter minutes and title for your next task:' \ --entry-text="$*" } function context_notification() { zenity \ --notification \ --listen \ --text="Context Switcher" \ --window-icon="$status_icon_100" } function s() { (($1!=1)) && echo s } context_loop ${*:-5 sample task} Empty file.