Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # This program takes screenshot, saves it into Dropbox public folder
- # sends a desktop notification and copies the public link into the clipboard.
- # Made by woox2k & xpander
- # Depends on xclip, scrot, notify-send and optionaly imagemagick for taking shots of specific windows
- #date function
- DATE=`which date`
- # Dropbox public folder location (add / to the end)
- dropbox=$HOME"/Dropbox/Public/"
- # ID that appears on the public links
- publicID='28788188'
- # File name format. (Just make sure there is some variables that change so screens won't get overwritten)
- filename="ss_`$DATE +%d%m%Y_%H.%M.%S`"
- # Work starts here:
- # option -f is full screenshot of the whole desktop (including multiple monitors)
- # option -b is a screenshot of pointed window, panel, gadget with window borders
- # option -w is a screenshot of pointed window, panel, gadget without window borders
- if [[ $# -eq 1 ]]; then
- case $1 in
- "-f")
- scrot "$dropbox""$filename".png;;
- "-b")
- import -frame "$dropbox""$filename".png;;
- "-w")
- import "$dropbox""$filename".png;;
- *)
- echo "Wrong option";;
- esac
- fi
- # Send notification after file checking
- cd $dropbox
- if ls -f "$filename".png;
- then notify-send --icon=gnome-screenshot "Screenshot" "Screenshot taken and address copied to clipboard" -t 2000;
- else notify-send --icon=error "Error" "Failed to Create file" -t 2000;
- fi
- # Public link into clipboard
- echo https://dl.dropboxusercontent.com/u/"$publicID"/"$filename".png | xclip -selection c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement