[wl_screenshot.sh]: Add wl_screenshot.sh
This commit is contained in:
13
wl_screenshot.sh
Executable file
13
wl_screenshot.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
# Screenshot script with selection using grim and slurp.
|
||||
#
|
||||
filepath="$HOME/media/images/screenshots/$(date +%Y-%m-%d\ %H:%M:%S).png"
|
||||
grim -g "$(slurp)" - | tee "$filepath" | wl-copy
|
||||
|
||||
# if screenshot is cancelled, tee will create an empty file, so checking if the file is empty
|
||||
if [ -s "$filepath" ]; then
|
||||
# send notification with a thumbnail of the screenshot taken, the name of the script, and the filepath
|
||||
notify-send --icon "$filepath" "$(basename "$0")" "Screenshot saved to: $filepath"
|
||||
else
|
||||
rm "$filepath"
|
||||
fi
|
Reference in New Issue
Block a user