123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #!/bin/bash
- #changelog
- #v0.3
- #added 1. Notifications 2.unique names for each type (for quick launch) 3.better photo editor (pinta) 4.dmenu title
- #v0.4
- #1.Added variable for notification timeouts. 2. Show link in notification
- #Requires Scrot and a program to upload pictures somewhere
- IMG_PATH=/home/eddie/Pictures/
- UL=imgur
- EDIT=pinta
- TIME=3 #Seconds notification should remain visible
- prog="
- ---Local screenshots (saved at IMG_PATH)---
- 1.quick_fullscreen
- 2.delayed_fullscreen
- 3.section
- 4.edit_fullscreen
- ---Upload to remote service (images will be deleted)---
- a.upload_fullscreen
- u.upload_delayed_fullscreen
- e.edit_upload_fullscreen
- s.upload_section
- p.edit_upload_section
- "
- cmd=$(dmenu -p 'Choose Screenshot Type' <<< "$prog")
- cd $IMG_PATH
- case ${cmd%% *} in
- 1.quick_fullscreen) scrot -d 1 '%Y%m%d-%H%M%S.png' && notify-send -u low -t $TIME 'Scrot' 'Fullscreen taken and saved' ;;
- 2.delayed_fullscreen) scrot -d 4 '%Y%m%d-@%H%M%S.png' && notify-send -u low -t $TIME 'Scrot' 'Fullscreen Screenshot saved' ;;
- 3.section) scrot -s '%Y%m%d-@%H%M%S.png' && notify-send -u low -t $TIME 'Scrot' 'Screenshot of section saved' ;;
- 4.edit_fullscreen) scrot -d 1 '%Y%m%d-@%H%M%S.png' -e "$EDIT \$f" && notify-send -u low -t $TIME 'Scrot' 'Screenshot edited and saved' ;;
- a.upload_fullscreen) $UL \$f ;;
- u.upload_delayed_fullscreen) "$UL " ;;
- e.edit_upload_fullscreen) "$EDIT && $UL && rm -f" ;;
- s.upload_section) $UL ;;
- p.edit_upload_section) "$EDIT && $UL && rm -f" ;;
- *) exec ${cmd} ;;
- esac
|