diff --git a/bin/.bin/screenshot b/bin/.bin/screenshot index d3a7aa38..c75d26de 100755 --- a/bin/.bin/screenshot +++ b/bin/.bin/screenshot @@ -2,13 +2,17 @@ # A simple wrapper around maim # -# When run, the screenshot will be added to she clipboard +# When run, the screenshot will be added to the clipboard +# The file path will be put in the primary selection +# Will create notification containing file path +# +# If you have a project specified, it will put the sceenshot in that folder instead of /tmp path='/tmp' -command -v maim > /dev/null && screenshooter="maim" || screenshooter="scrot" +command -v maim > /dev/null && screenshooter="maim" || ( echo -n "You need to install maim\nhttps://github.com/naelstrof/maim" && exit 1 ) #If a project is set we will put screenshots in the project's folder -project=$(project current --path) +command -v project > /dev/null && project=$(project current --path) if [ -n "$project" ]; then path="$project/screenshots" #Make the directory if it doesn't exist @@ -31,6 +35,9 @@ case $1 in ;; esac +# Copies the image to your clipboard (ctrl + v) xclip -selection clipboard -target image/png -i "$file" +# Copies the filename to primary selection (shift + insert or middle mouse) echo -n "$file" | xclip -selection primary -notify-send "New Screenshot" "$file" +# Creates notification with file name +command -v notify-send > /dev/null && notify-send "New Screenshot" "$file"