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.

31 lines
770 B

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