feat(hypr): add option to see image in the notification of hyprshot

This commit is contained in:
Sergio Laín 2024-03-30 00:27:05 +01:00
parent 8bff613ddd
commit de149a729d
No known key found for this signature in database
GPG key ID: 14C9B8080681777B
2 changed files with 6 additions and 3 deletions

View file

@ -56,9 +56,12 @@ function send_notification() {
local message=$([ $CLIPBOARD -eq 1 ] && local message=$([ $CLIPBOARD -eq 1 ] &&
echo "Image copied to the clipboard" || echo "Image copied to the clipboard" ||
echo "Image saved in <i>${1}</i> and copied to the clipboard.") echo "Image saved in <i>${1}</i> and copied to the clipboard.")
notify-send "Screenshot saved" \ action=$(notify-send --action "View Image" "Screenshot saved" \
"${message}" \ "${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() { function trim() {

View file

@ -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) 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"