Skip to content

Instantly share code, notes, and snippets.

@pielgrzym
Last active December 10, 2015 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pielgrzym/4435022 to your computer and use it in GitHub Desktop.
Save pielgrzym/4435022 to your computer and use it in GitHub Desktop.
Using inotifywait.
watch_todo(){
tput smcup
while : ; do
tput clear
echo -n "${bg[cyan]}[[[ TODO: ]]]$reset_color\n"
if [[ -n $1 ]]; then
todo.sh "$@"
else
todo.sh ls
fi
trap 'break' 2
inotifywait -e modify $HOME/Dropbox/t/todo.txt -qq
done
tput rmcup
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment