This repository has been archived on 2024-07-10. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles-nix/screenshot/screenshot.sh

36 lines
650 B
Bash
Executable File

#!/usr/bin/env zsh
# screenshot function for an area
screenshot_area () {
grimblast \
--notify save area - | \
satty \
--filename - \
--fullscreen \
--output-filename ~/Pictures/Screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png
}
# screenshot function for full screen
screenshot_screen () {
grimblast \
--notify save screen - | \
satty \
--filename - \
--fullscreen \
--output-filename ~/Pictures/Screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png
}
# main function
case $1 in
area)
screenshot_area
;;
screen)
screenshot_screen
;;
*)
echo "Usage: $0 {area|screen}"
exit 1
;;
esac