make screenshot.sh notification title just the name the script was called with

This commit is contained in:
2023-11-29 20:07:39 +00:00
parent 2fd1b0f9f7
commit 619778e76c

View File

@ -1,6 +1,7 @@
#!/bin/sh #!/bin/sh
# Simple screenshot script with selection using maim. # Screenshot script with selection using maim and notification.
filepath="$HOME/media/images/screenshots/$(date +%Y-%m-%d\ %H:%M:%S).png" filepath="$HOME/media/images/screenshots/$(date +%Y-%m-%d\ %H:%M:%S).png"
maim --select --hidecursor | tee "$filepath" | xclip -selection clipboard -target image/png maim --select --hidecursor | tee "$filepath" | xclip -selection clipboard -target image/png
notify-send --icon "$filepath" "$0" "Screenshot saved to: $filepath"
# send notification with a thumbnail of the screenshot taken, the name of the script, and the filepath
notify-send --icon "$filepath" "$(echo "$0" | awk -F '/' '{print $NF}')" "Screenshot saved to: $filepath"