Updates screenshot script

Jonathan Hodgson 5 years ago
parent 1546eb70aa
commit 5a5475fc79
  1. 15
      bin/.bin/screenshot

@ -2,13 +2,17 @@
# A simple wrapper around maim # 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' 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 #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 if [ -n "$project" ]; then
path="$project/screenshots" path="$project/screenshots"
#Make the directory if it doesn't exist #Make the directory if it doesn't exist
@ -31,6 +35,9 @@ case $1 in
;; ;;
esac esac
# Copies the image to your clipboard (ctrl + v)
xclip -selection clipboard -target image/png -i "$file" 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 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"

Loading…
Cancel
Save