From c58ec8124ea2b08762b9250c374d9fd60741ae5e Mon Sep 17 00:00:00 2001 From: Steven Saus Date: Sat, 25 Jul 2020 12:26:47 -0400 Subject: [PATCH] Added fix for CopyQ and sorting choices --- clipimg.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/clipimg.sh b/clipimg.sh index 0ceaf7f..94864b8 100755 --- a/clipimg.sh +++ b/clipimg.sh @@ -43,7 +43,7 @@ build_search_items() { Choices+=$(find -H "$SearchPath" -type f -iname "*.png" -or -iname "*.jpg") fi Choices+="\n" - TempSearchPath="" + TempSearchPath="" } @@ -75,6 +75,10 @@ build_search_items() { build_search_items fi + SortTemp=$(echo -e "$Choices" | sort -t '/' -k 6) + Choices="$SortTemp" + + ############################################################################## # Select that Image! # @@ -102,6 +106,7 @@ if [ -f "$SelectedImage" ];then # Tee does not seem to like binary data... xclip -i -selection primary -t "$mime" < "$SelectedImage" > /dev/null xclip -i -selection clipboard -t "$mime" < "$SelectedImage" > /dev/null - #/usr/bin/copyq write 0 "$mime" - < "$SelectedImage" - #/usr/bin/copyq select 0 + #if you use copyq you need these lines to have it offer up the selection + /usr/bin/copyq write 0 "$mime" - < "$SelectedImage" + /usr/bin/copyq select 0 fi \ No newline at end of file