Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # This program takes screenshot, saves it into Mega folder
- # sends a desktop notification.
- # Made by woox2k & xpander
- # Depends on 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/"
- mega=$HOME"/MEGA/"
- # 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 focused window, panel, gadget
- if [[ $# -eq 1 ]]; then
- case $1 in
- "-f")
- scrot "$mega""$filename".png;;
- "-b")
- import -frame "$mega""$filename".png;;
- "-w")
- scrot -u "$mega""$filename".png;;
- *)
- echo "Wrong option";;
- esac
- fi
- # Send notification after file checking
- cd $mega
- if ls -f "$filename".png;
- then notify-send --icon=gnome-screenshot "Screenshot" "Screenshot taken" -t 2000;
- else notify-send --icon=error "Error" "Failed to Create file" -t 2000;
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement