From 8c400657a5b602da77dd6db8797dc12e0425e1d0 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Wed, 7 Feb 2024 15:42:32 +0100 Subject: [PATCH] Better copy --- bin/copy | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/copy b/bin/copy index 27593e0..dd3d461 100755 --- a/bin/copy +++ b/bin/copy @@ -4,5 +4,10 @@ if [ $# -eq 0 ]; then xclip -selection c else file_type=$(file -b --mime-type "$1") - xclip -selection c -t $file_type < $1 + + if [ "$file_type" = "image/jpg" ] || [ "$file_type" = "image/jpeg" ]; then + convert $1 png:- | xclip -selection c -t image/png + else + xclip -selection c -t $file_type < $1 + fi fi