Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
752 B

  1. #!/usr/bin/env bash
  2. # requires:
  3. # https://github.com/lolilolicon/xrectsel.git
  4. # festival(1) text to speech system (just because)
  5. # Default time:
  6. BYZANZ_DURATION=8
  7. args=$(getopt -uo 'hvri:t:o:b:u:' -- $*)
  8. [ $? != 0 ] && print_help
  9. set -- $args
  10. for i
  11. do
  12. case "$i"
  13. in
  14. -t)
  15. BYZANZ_DURATION="$2"
  16. shift
  17. shift
  18. ;;
  19. esac
  20. done
  21. eval `xrectsel "BYZANZ_X=%x; BYZANZ_Y=%y; BYZANZ_WIDTH=%w; BYZANZ_HEIGHT=%h"`
  22. echo "recording for $BYZANZ_DURATION seconds in three. two. one. GO!" | festival --tts
  23. byzanz-record -x $BYZANZ_X -y $BYZANZ_Y --delay=0 -d $BYZANZ_DURATION -h $BYZANZ_HEIGHT -w $BYZANZ_WIDTH ~/screenshots/screencast-`date +"%Y-%m-%d-%T"`.gif
  24. echo 'finished recording' | festival --tts