From e971a886b0ef97dd785cf8aa274d32d010a1d589 Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 14 Jun 2017 13:14:36 -0400 Subject: [PATCH] Update pantsushot script --- assets/tools/pantsushot | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) mode change 100644 => 100755 assets/tools/pantsushot diff --git a/assets/tools/pantsushot b/assets/tools/pantsushot old mode 100644 new mode 100755 index 6030b49..1fe1145 --- a/assets/tools/pantsushot +++ b/assets/tools/pantsushot @@ -3,37 +3,40 @@ #Paste your api key directly after the "=" sign APIKEY=YOURAPIKEYHERE -mkdir -p ~/Pictures/ +mkdir -p ~/Pictures/Screenshots DATE=$(date +"%Y-%m-%d_%H-%M-%S") FILE="$HOME/Pictures/Screenshots/$DATE.png" -if [ ! $# > 1 ]; +if [ "$#" -gt 1 ]; then echo "Too many arguments supplied! (Try pantsushot --help)" exit; fi if [ $# == 0 ]; - then gnome-screenshot -f $FILE $2; -fi -case $1 in - -h ) -echo "Welcome to the pantsushot! + then echo "Welcome to the pantsushot! Option Description -f Takes a fullscreen screenshot (default behavior) -w Takes a screenshot of the focused window -a Takes a screenshot of a selected area"; exit; - ;; - -f ) +fi + +case $1 in + -f ) gnome-screenshot -f $FILE $2; - ;; + paplay /usr/share/sounds/freedesktop/stereo/screen-capture.oga + ;; -w ) gnome-screenshot -w -f $FILE $2; - ;; + paplay /usr/share/sounds/freedesktop/stereo/screen-capture.oga + ;; -a ) gnome-screenshot -a -f $FILE $2; - ;; + paplay /usr/share/sounds/freedesktop/stereo/screen-capture.oga + ;; esac + URL=$(curl -s -F "apikey=$APIKEY" -F "files[]=@$FILE" https://www.shimapan.rocks/upload.php | grep url | awk '{print $2}') + echo $URL | tr -d '[\\\,"\n]' | xclip -selection c