Skip to content

Instantly share code, notes, and snippets.

@deemp
Last active April 13, 2022 18:21
Show Gist options
  • Select an option

  • Save deemp/cda997cec3b6f0333323b89fa8dfa520 to your computer and use it in GitHub Desktop.

Select an option

Save deemp/cda997cec3b6f0333323b89fa8dfa520 to your computer and use it in GitHub Desktop.
#!/bin/bash
TARGET=~/Downloads/Remote/
inotifywait -m -e create -e moved_to -e modify --format "%f" $TARGET \
| while read FILENAME
do
echo Detected $FILENAME, copying to clipboard
# https://askubuntu.com/a/759660
xclip -selection clipboard -t image/png -i "${TARGET}${FILENAME}"
echo Copied "${TARGET}${FILENAME}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment