summaryrefslogtreecommitdiffstats
path: root/bin/watch_incoming.sh
diff options
context:
space:
mode:
authorYigit Sever2019-12-08 14:46:45 +0300
committerYigit Sever2019-12-08 18:32:36 +0300
commit2c523ef1eb51ab9e0e9b1ba6bc30c117396bb331 (patch)
treea4c38a02e58360fafc408ef4938c6ca1416c49e7 /bin/watch_incoming.sh
parent56d0cda40714fb8d38103367b185c881a6e9d555 (diff)
downloaddotfiles-2c523ef1eb51ab9e0e9b1ba6bc30c117396bb331.tar.gz
dotfiles-2c523ef1eb51ab9e0e9b1ba6bc30c117396bb331.tar.bz2
dotfiles-2c523ef1eb51ab9e0e9b1ba6bc30c117396bb331.zip
Work auto spliff
Diffstat (limited to 'bin/watch_incoming.sh')
-rwxr-xr-xbin/watch_incoming.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/watch_incoming.sh b/bin/watch_incoming.sh
new file mode 100755
index 0000000..b031461
--- /dev/null
+++ b/bin/watch_incoming.sh
@@ -0,0 +1,16 @@
1#!/usr/bin/env bash
2
3TARGET=$HOME/Downloads/toPrint/toPrint_staging
4PROCESSED=$HOME/Downloads/toPrint/toPrint_ready
5SPLIFF=$HOME/bin/spliff
6
7inotifywait -m -e create -e moved_to --format "%f" "${TARGET}" \
8 | while read FILENAME
9do
10 THUMB=$(mktemp /tmp/pdf_thumbnail_XXXXXXXXX.png)
11 evince-thumbnailer -s 1024 -l "${TARGET}/${FILENAME}" "${THUMB}"
12 mv "${TARGET}/${FILENAME}" "${PROCESSED}/${FILENAME}"
13 $SPLIFF "${PROCESSED}/${FILENAME}"
14 rm -f "${PROCESSED}/${FILENAME}"
15 dunstify -a "spliff" -I "${THUMB}" "$FILENAME"
16done