Now checks that screenshot worked before notifying
This commit is contained in:
parent
ffcb63d5a5
commit
288215593d
1 changed files with 10 additions and 6 deletions
|
@ -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
|
||||||
|
|
||||||
# Copies the image to your clipboard (ctrl + v)
|
if [ -f "$file" ]; then
|
||||||
xclip -selection clipboard -target image/png -i "$file"
|
# Copies the image to your clipboard (ctrl + v)
|
||||||
# Copies the filename to primary selection (shift + insert or middle mouse)
|
xclip -selection clipboard -target image/png -i "$file"
|
||||||
echo -n "$file" | xclip -selection primary
|
# Copies the filename to primary selection (shift + insert or middle mouse)
|
||||||
# Creates notification with file name
|
echo -n "$file" | xclip -selection primary
|
||||||
command -v notify-send > /dev/null && notify-send "New Screenshot" "$file"
|
# Creates notification with file name
|
||||||
|
command -v notify-send > /dev/null && notify-send "New Screenshot" "$file"
|
||||||
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue