From de149a729d46144e3accc758dc334af7efe5d676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Sat, 30 Mar 2024 00:27:05 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(hypr):=20add=20option=20to=20s?= =?UTF-8?q?ee=20image=20in=20the=20notification=20of=20hyprshot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/hypr/scripts/hyprshot | 7 +++++-- .config/hypr/scripts/rofi/screenshots_selection | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.config/hypr/scripts/hyprshot b/.config/hypr/scripts/hyprshot index e29b66f8..03d20673 100755 --- a/.config/hypr/scripts/hyprshot +++ b/.config/hypr/scripts/hyprshot @@ -56,9 +56,12 @@ function send_notification() { local message=$([ $CLIPBOARD -eq 1 ] && echo "Image copied to the clipboard" || echo "Image saved in ${1} and copied to the clipboard.") - notify-send "Screenshot saved" \ + action=$(notify-send --action "View Image" "Screenshot saved" \ "${message}" \ - -t "$NOTIF_TIMEOUT" -i "${1}" -a Hyprshot + -t "$NOTIF_TIMEOUT" -i "${1}" -a Hyprshot) + if [ -n "$action" ]; then + xdg-open "${1}" + fi } function trim() { diff --git a/.config/hypr/scripts/rofi/screenshots_selection b/.config/hypr/scripts/rofi/screenshots_selection index 5beabd6e..fe41db33 100755 --- a/.config/hypr/scripts/rofi/screenshots_selection +++ b/.config/hypr/scripts/rofi/screenshots_selection @@ -4,4 +4,4 @@ IMAGE_DIR="$HOME/Imagenes/Capturas/PC" SELECTION=$(find "$IMAGE_DIR" -type f -exec ls -t {} + | awk -F/ '{print $NF}' | rofi -dmenu) -swappy -f "$IMAGE_DIR/$SELECTION" +xdg-open "$IMAGE_DIR/$SELECTION"