From 583e1ff6e073313ab44beabfee68285e133ea571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Thu, 25 Jul 2024 18:57:01 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(hypr):=20hyprpicker=20script?= =?UTF-8?q?=20now=20detects=20if=20the=20picker=20is=20escaped=20without?= =?UTF-8?q?=20selecting=20anything?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/hypr/scripts/color_picker | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.config/hypr/scripts/color_picker b/.config/hypr/scripts/color_picker index b6c44c09..c970ccf0 100755 --- a/.config/hypr/scripts/color_picker +++ b/.config/hypr/scripts/color_picker @@ -2,17 +2,15 @@ # Simple Script To Pick Color Quickly. -# pick and autocopy -hyprpicker -a +# pick, autocopy and get the value +color=$(hyprpicker -a) -# get the value -color=$(wl-paste) - -image=/tmp/${color}.png +echo "$color" if [[ "$color" ]]; then - # generate preview - convert -size 48x48 xc:"$color" "$image" - # notify the color - notify-send -i "$image" "$color" "Copied to clipboard" + image=/tmp/${color}.png + # generate preview + convert -size 48x48 xc:"$color" "$image" + # notify the color + notify-send -i "$image" "$color" "Copied to clipboard" fi