watch { # watch the ~/drop directory for new files ~/drop { # matches any mimetype beginning with image/ image/* { # %% is replaced with the filename of the new file handler = echo found an image: %% } # matches any file ending with .extension *.extension { # the filename is added to the end of the handler line if %% is not present handler = echo glob handler 1: # the second handler will be run if the first exits with a return code of 1 handler = echo glob handler 2: %% } # run handlers on files that match this regex /.*regex.*/ { handler = echo regex handler } # generic handler to catch files that nothing else did * { handler = mv %% ~/downloads/ } } }