screenshot.sh 399 B

1234567891011121314151617
  1. #!/usr/bin/env zsh
  2. local maim_args=("-f" "png")
  3. local outfile="screenshot--$(date +'%F_%k-%M-%S').png"
  4. local outpath="${HOME}/downloads/${outfile}"
  5. case "${1}" in;
  6. '-root')
  7. maim ${maim_args} "${outpath}" || exit
  8. ;;
  9. '-select' | *)
  10. maim ${maim_args} -s "${outpath}" || exit
  11. ;;
  12. esac
  13. notify-send -t 5000 "Screenshot Taken" "Screenshot saved to \"${outfile}\""