Skip to content

Instantly share code, notes, and snippets.

@duese
Created December 30, 2015 09:01
Show Gist options
  • Save duese/ec2e5c08902137644e34 to your computer and use it in GitHub Desktop.
Save duese/ec2e5c08902137644e34 to your computer and use it in GitHub Desktop.
Looks for file changes in the current directory
#!/bin/bash
inotifywait -m $PWD -r -e create -e moved_to -e delete |
while read path action file; do
TITLE="Filesystem changed"
MESSAGE="The file '$file' appeared in directory '$path' via '$action'"
echo ${MESSAGE}
notify-send "${TITLE}" "${MESSAGE}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment