From 23aba72f292ed29985538bc862b189e2ac022a01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Fri, 4 Oct 2024 11:35:13 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(hypr):=20add=20view=20image=20?= =?UTF-8?q?option=20to=20the=20hyprshot=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/hypr/scripts/hyprshot | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.config/hypr/scripts/hyprshot b/.config/hypr/scripts/hyprshot index 288f663a..bec7ae1f 100755 --- a/.config/hypr/scripts/hyprshot +++ b/.config/hypr/scripts/hyprshot @@ -60,17 +60,22 @@ function send_notification() { local message=$([ $CLIPBOARD -eq 1 ] && echo "Image copied to the clipboard" || echo "Image saved in ${1} and copied to the clipboard.") - action=$(notify-send -i "$1" --action "View Image" "Screenshot saved" \ + action=$(notify-send -i "$1" --action="view=View" --action="edit=Edit" "Screenshot saved" \ "${message}" \ -t "$NOTIF_TIMEOUT" -i "${1}" -a Hyprshot) - if [ -n "$action" ]; then + case $action in + "view") + xdg-open "$1" + ;; + "edit") if command -v satty &>/dev/null; then satty -f "$1" else - xdg-open "$1" + notify-send -u critical "Cannot Edit Image" "Install Satty" fi - fi + ;; + esac } function trim() {