Skip to content

Instantly share code, notes, and snippets.

@decrypted
Forked from kloneets/screen-to-dropbox
Created September 26, 2018 14:04
Show Gist options
  • Save decrypted/9c8866d4045d48319da99c3a6b084210 to your computer and use it in GitHub Desktop.
Save decrypted/9c8866d4045d48319da99c3a6b084210 to your computer and use it in GitHub Desktop.
Screenshot to dropbox on linux
#!/bin/bash
# Take a screenshot of an area of the screen, upload it to dropbox and put the url into the clipboard
# Put file in any directory under your dropbox
# If it is subfolder, than you need to make them manually
FILENAME=~/Dropbox/Public/Screenshots/Screenshot_`date +%Y-%m-%d-%H:%M`.png
# Select an area and save the screenshot
# you need to instal gnome-screenshot
# on ubuntu: sudo apt install gnome-screenshot
gnome-screenshot -a -f $FILENAME
# You need to install dropbox on your linux system and log in
URL=`dropbox sharelink $FILENAME`
# you need to install xclip on your system to get link to clipboard
# on ubunut: sudo apt install xclip
echo $URL | xclip -selection clipboard
# Pop up a small notification
# You need to install notify-osd (at least on gnome-shell)
# on ubuntu-gnome: sudo apt install notify-osd
notify-send "Copied $URL to clipboard"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment