dotfiles/home/default/.local/bin/screenshot.sh
cho a542cb199b update
update

update
2023-07-31 18:19:20 +07:00

35 lines
651 B
Bash
Executable File

#!/bin/sh
[ -z "$1" ] && printf "Usage: screenshot.sh [output|active|window] \n" && exit 0
file=$HOME/Pictures/Screenshots/$(date +'%Y-%m-%d_%H.%M.%S_%Z').png
if [[ -n "$1" ]]; then
case "$1" in
output) grimshot save output $file
break
;;
active) grimshot save active $file
break
;;
window) grimshot save window $file
break
;;
screen) grimshot save screen $file
break
;;
*)
echo $@ is not an argument
break
;;
esac
fi
if [[ -N $file ]]; then
echo "screenshot saved."
notify-send "screenshot saved." -i $file
exit 0
else
echo "screenshot failed."
exit 1
fi