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 and notify-send
- #date function
- DATE=`which date`
- # Settings:
- # 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="screen_`$DATE +%d%m%Y_%H.%M.%S`"
- # Work starts here:
- # Scrot takes screenshot
- if [[ $# -eq 1 ]]; then
- case $1 in
- "-f")
- scrot "$dropbox""$filename".png;;
- "-b")
- scrot -s -b "$dropbox""$filename".png;;
- "-w")
- scrot -s "$dropbox""$filename".png;;
- *)
- echo "Wrong option";;
- esac
- fi
- # Public link into clipboard
- echo https://dl.dropboxusercontent.com/u/"$publicID"/"$filename".png | xclip -selection c
- # Send notification about work done here after filecheck
- cd $dropbox
- if [-f $filename];
- then notify-send --icon=monitor "Screenshot taken and address copied to clipboard" -t 2000;
- else notify-send "Failed to Create file" -t 2000;
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement