Now checks that screenshot worked before notifying

Jonathan Hodgson 5 years ago
parent 55ddbf26bc
commit 67e6728ab0
  1. 4
      bin/.bin/screenshot

@ -22,6 +22,8 @@ fi
filename="$(date +"%Y-%m-%dT%H-%M-%SZ").png" filename="$(date +"%Y-%m-%dT%H-%M-%SZ").png"
file="${path}/${filename}" file="${path}/${filename}"
[ "$1" = "-w" ] && sleep "$2" && shift && shift
case $1 in case $1 in
"window") "window")
maim -i $(xdotool getactivewindow) "$file" maim -i $(xdotool getactivewindow) "$file"
@ -35,9 +37,11 @@ case $1 in
;; ;;
esac esac
if [ -f "$file" ]; then
# Copies the image to your clipboard (ctrl + v) # 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) # Copies the filename to primary selection (shift + insert or middle mouse)
echo -n "$file" | xclip -selection primary echo -n "$file" | xclip -selection primary
# Creates notification with file name # Creates notification with file name
command -v notify-send > /dev/null && notify-send "New Screenshot" "$file" command -v notify-send > /dev/null && notify-send "New Screenshot" "$file"
fi

Loading…
Cancel
Save