#!/bin/bash # requires notify-tools inotifywait -m ~/Tempsktop -e create -e moved_to | while read dir action file; do echo "The file '$file' appeared in directory '$dir' via '$action'" [[ -n $(echo "$file" | grep "png") ]] && feh "${dir}${file}" done