From a01f4c14a765860e33948adb49969c296601aaf3 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Fri, 14 Jun 2019 13:49:42 +0100 Subject: [PATCH] Adds path to screenshot to primary clipboard --- bin/screenshot | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/screenshot b/bin/screenshot index ffcec492..baa642b3 100755 --- a/bin/screenshot +++ b/bin/screenshot @@ -6,14 +6,16 @@ case $1 in "window") - file=$(scrot -u '/tmp/%F_%T_$wx$h.png' -e 'echo /tmp/%F_%T_$wx$h.png') + file=$(scrot -u '/tmp/%F_%T_$wx$h.png' -e 'echo -n /tmp/%F_%T_$wx$h.png') ;; "select") - file=$(sleep 0.2; scrot -s '/tmp/%F_%T_$wx$h.png' -e 'echo /tmp/%F_%T_$wx$h.png') + file=$(sleep 0.2; scrot -s '/tmp/%F_%T_$wx$h.png' -e 'echo -n /tmp/%F_%T_$wx$h.png') ;; *) - file=$(scrot '/tmp/%F_%T_$wx$h.png' -e 'echo /tmp/%F_%T_$wx$h.png') + file=$(scrot '/tmp/%F_%T_$wx$h.png' -e 'echo -n /tmp/%F_%T_$wx$h.png') ;; esac xclip -selection clipboard -target image/png -i "$file" +echo -n "$file" | xclip -selection primary +notify-send "New Screenshot" "$file"