From 1e0a158b39f633e4460e846153c81a829b24379e Mon Sep 17 00:00:00 2001 From: retrozinndev Date: Sun, 15 Jun 2025 20:14:00 -0300 Subject: [PATCH] :boom: fix(hypr/scripts/color-picker): sending notification even if no color was selected plus, better way to check if hyprpicker is installed --- hypr/scripts/color-picker.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hypr/scripts/color-picker.sh b/hypr/scripts/color-picker.sh index 8febeb7..6dd06a4 100644 --- a/hypr/scripts/color-picker.sh +++ b/hypr/scripts/color-picker.sh @@ -5,14 +5,14 @@ function send_notification() { } # Check if user has hyprpicker installed -if ! [[ -f /bin/hyprpicker ]]; then +if [[ -z $(command -v hyprpicker) ]]; then send_notification "An error occurred" "Looks like you don't have hyprpicker installed! Try installing it before using the Color Picker tool." exit 1 fi -selected_color=$(hyprpicker | tail -n 1 | xargs) +selected_color=$(hyprpicker | tail -n 1 | xargs | sed -e 's/ //g') -if ! [[ -z $selected_color ]]; then +if [[ ! -z "$selected_color" ]] && [[ ! "$selected_color" == " " ]]; then wl-copy $selected_color send_notification "Selected Color" "The selected color is $selected_color, it was also copied to your clipboard!" fi