From 520f952b02a92b6575ad1b2039bba55d6d2f09f7 Mon Sep 17 00:00:00 2001 From: retrozinndev Date: Fri, 25 Apr 2025 13:46:54 -0300 Subject: [PATCH] hypr(scripts/color-picker): only get color instead of all output from hyprpicker --- hypr/scripts/color-picker.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hypr/scripts/color-picker.sh b/hypr/scripts/color-picker.sh index 77786ff..8febeb7 100644 --- a/hypr/scripts/color-picker.sh +++ b/hypr/scripts/color-picker.sh @@ -1,18 +1,18 @@ #!/usr/bin/env bash -send_notification() { +function send_notification() { notify-send -u normal -a "Color Picker" "$1" "$2" } # Check if user has hyprpicker installed if ! [[ -f /bin/hyprpicker ]]; then - send_notification "An error occurred" "Looks like you don't have Hyprpicker installed! Try installing it before using the Color Picker tool." + 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) +selected_color=$(hyprpicker | tail -n 1 | xargs) -if ! [[ $selected_color == "" ]]; then +if ! [[ -z $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