Linux folder/file watcher

goal = create a notification system for when a file appears in a watched folder

it would be nice if there was a gui to set the folder(s) to watch, selectable from the yad icon.

on log in:
start iwatch and yad to check for when files are created. Yad will provide an icon in the tray to open the folder, it will also popup until it is clicked on or x seconds.
check in a folder for the existence of any files
if files exist the do this:
wait a little time
popup a message

iwatch http://iwatch.sourceforge.net/documentation.html

yad https://sourceforge.net/projects/yad-dialog/

yad wiki https://sourceforge.net/p/yad-dialog/wiki/browse_pages/

iwatch and yad are available in the linux mint depositories

create a file likethis.sh and call it during boot up

=== iwatch and yad ====

#!/bin/bash
# iwatch -c "gnome-open /home/tpetersen/Music" -e create `/home/tpetersen
yad --notification --image=update.png --text "file ready" --command="yad --file-selection --filename=/etc"

 

=== a command to check for empty directory ====

find /path/to/dir -maxdepth 0 -empty -exec echo {} is empty. \;

=== a command to make a path into a url ====

$ path="/home/MHC/directory with spaces and ümläuts"
$ echo $path | perl -MURI::file -e 'print URI::file->new(<STDIN>)."\n"' 
file:///home/MHC/directory%20with%20spaces%20and%20%C3%BCml%C3%A4uts 
$

==== command to make yad create a clickable link ====

--show-uri

====