Created
August 30, 2020 12:40
-
-
Save busla/776d6162eeaae8d50f18b9b1699011e3 to your computer and use it in GitHub Desktop.
Dropbox shared url from gnome screenshots
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description = Monitors ~/Pictures dir, copies new files to ~/Dropbox/Screenshots and creats a shared url | |
[Service] | |
User=<your-$USER> | |
ExecStart=/usr/local/bin/make_dropbox_url.sh | |
[Install] | |
WantedBy=multi-user.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PICTURES=$HOME/Pictures/ | |
DROPBOX=$HOME/Dropbox/Screenshots/ | |
export DISPLAY=:0 | |
inotifywait -m -e create -e moved_to --format "%f" $PICTURES \ | |
| while read FILENAME | |
do | |
echo Detected $FILENAME, moving to $DROPBOX/$FILENAME | |
mv "$PICTURES/$FILENAME" "$DROPBOX/$FILENAME" | |
SHARED_URL=$(dropbox sharelink "$DROPBOX/$FILENAME") | |
echo $SHARED_URL | xclip -sel clip | |
echo added $SHARED_URL to clipboard | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment