Permalink
Commits on Oct 24, 2011
  1. Move warning out of function body

    heads_get_corners_list_by_ref() is actually general, probably should
    have been named geometry_list_to_corners_list_by_id_by_ref()...
    Instead, save the bad IDs in an array for later use (e.g. warning).
    Also, making $3 optional was making things more complicated for nothing.
    Don't do it.
    committed Oct 24, 2011
Commits on Oct 23, 2011
  1. Support selecting specific XINERAMA heads

    This should work for multi-head Xinerama setups.  The idea is simple,
    but the implementation may seem a little more complicated than usual,
    due to the limitations of bash as a language.  Hopefully, this is not
    too ugly.
    This is also the first time `grep' and `sed' are used in this script,
    because the 660+ lines of `xdpyinfo` output makes the pattern matching
    of bash a bit slow when using globbing, *very* slow when using regexp.
    committed Oct 23, 2011
  2. Set `pipefail' and `lastpipe' for better debugging

    `true <<< $(false)` would always be true, we'd never catch the failure in
    the command substitution red handed. Instead, we use `foo | bar` with the
    `pipefail' shell option to catch the failure anywhere in the pipeline.
    Also, enable `lastpipe' so `bar` can run in the current shell instead of
    in a subshell, so variable assignments in `bar` don't get lost after the
    pipeline.
    
    Another subtle issue with `bar <<< "$(foo)"` is the output of `foo` will
    be altered, with trailing newlines stripped and one newline appended.
    This behavior may be fine in most cases, some may even find it desirable
    for the default `read` behavior which uses newline as line delimiter,
    but sometimes `foo | bar` is preferable since it does not modify the
    output of `foo` in any way.
    
    `foo | bar` is nicer for the `read -n 1` while loop which takes a string
    $region_select_action as input, since it does not append a newline so
    we don't read in a null at the end.
    
    But when piping to `read`, we must be careful not to trigger an error by
    reaching EOF. e.g.,
    
      printf '%s' a | read         # PIPESTATUS 0 1
      printf '%s\n' a | read       # PIPESTATUS 0 0
      printf '%s\0' a | read -d '' # PIPESTATUS 0 0
    
    For this reason, we add '\n' to the output of several functions.
    committed Oct 23, 2011
Commits on Oct 22, 2011
  1. Change the option -m to require an integer arg

    Always trimming the region is wrong.  I'd rather not trim it at all, but
    the default ffmpeg command encodes to x264 which requires dimensions to
    be divisible by 2.  For this reason, we keep the default behavior
    unchanged, but allow the user to change or disable trimming.
    
    This change introduces backward incompatibility, but the failure due to
    this change will be noisy, and it's easy enough for the user to change
    the old `-m' to `-m 16'.
    
    This commit also fixes a bug the we did not adjust the right and bottom
    offsets when the dimensions had changed.  This geometry post-processing
    is still pretty lame nevertheless.
    committed Oct 22, 2011
  2. Adjust help message in the post-man-page-less era

    Remove `-vh' because it's ugly as sin.  Everybody loves man pages.
    committed Oct 22, 2011
  3. Add EXAMPLES section

    committed Oct 22, 2011
Commits on Oct 21, 2011
  1. Add ffcast(1) man page.

    committed Oct 21, 2011
  2. Lame attempt to convert README into valid asciidoc

    The stupid FAQ is removed.  Some other changes I don't remember.
    committed Oct 21, 2011
  3. Exit immediately on invalid options

    I'm an unforgiving bastard!
    committed Oct 21, 2011
  4. Update documentation for the format string syntax

    Also fix some typos.
    committed Oct 21, 2011
  5. pl. syntaxes

    committed Oct 21, 2011
Commits on Oct 20, 2011
  1. Support arbitrary command line via format string

    This really is the way to be free, for everyone.  Thanks to the simple
    command line partition mechanism, this is implemented as a natural
    extension to the original syntax, in a completely backward compatible
    manner.  This new syntax in fact supersedes the old syntax, but the old
    syntax is more convenient, and is for now preserved.
    
    Also worth mentioning, is that the cast command line is now executed via
    `exec', since there is no command name verification for the format string
    syntax.  Without `exec', internal functions would be accessible as the
    command name, which is undesirable.
    committed Oct 20, 2011
Commits on Oct 18, 2011
  1. Fix an innocent typo

    committed Oct 18, 2011
Commits on Oct 17, 2011
  1. Use `printf %q' instead of `set -x': debug_run()

    `set -x' + setting PS4 was really hackish.
    `printf %q' should guarantee the printed command line is properly quoted,
    and is equivalent to the command line that's actually run.
    Also, the (( verbosity ... )) tests are now only done inside functions.
    Also, the _msg() function is changed again to take the same approach as
    the new _quote_cmd_line() function does.
    committed Oct 17, 2011
  2. Respect the order in which -b and -w are given

    With this, only -w specified after -b will include window borders.
    This enables the user to include borders for only some of the windows.
    
    This can also be a double-edged sword, in that now the user has finer
    control, but (s)he must be fully aware of the effects of the order in
    which options are given.  Yes, you should.
    However, the user will most likely want to specify -b at the very
    first, which gives the old behavior of a "global" switch.
    committed Oct 17, 2011
Commits on Oct 15, 2011
  1. Explicitly terminate option list of `printf'

    This prevents `printf' from choking on prefixes starting with '-'.
    _msg() being a "private" function, this does not really matter, but
    when it comes to expression, the more accurate, the better.
    committed Oct 15, 2011
Commits on Oct 11, 2011
  1. Silly rephrase.

    committed Oct 11, 2011
  2. Let line width be strictly <80

    Nothing to {se,her}e
    committed Oct 11, 2011
Commits on Oct 9, 2011
Commits on Oct 8, 2011
  1. Use `printf %(fmt)T' instead of `date'

    Since we already rely on Bash 4.2, no reason to prefer the external `date'
    to the builtin `printf'.
    committed Oct 8, 2011
Commits on Oct 7, 2011
  1. Workaround: recordMyDesktop's -x, -y don't take 0

    I definitely call it a bug on recordMyDesktop's side, but even if
    recordMyDesktop fixed this bad behavior, in order to support older versions
    of it, we'd still have to workaround this.  (Remember when I said hell?)
    committed Oct 7, 2011
Commits on Oct 6, 2011
  1. Add support for byzanz-record as cast command

    Untested example: ffcast -s byzanz-record -- cast.gif -l
    committed Oct 6, 2011
Commits on Oct 5, 2011
  1. xrectsel: don't grab keyboard

    This seems nothing necessary, but a behaviour copied from scrot.
    By not grabbing the keyboard, xrectsel works more like xwininfo.
    This also gives the user a chance to prepare/clean up while xrectsel
    waits for a selection.
    committed Oct 5, 2011
  2. Don't actually do region selection while getopts

    Insead, save the actions as they're specified, and do it later in that order
    after parsing geospec.  This has two advantages:
    
     - We can die early when an invalid geospec is given- don't even bother
       interactive selection.
    
     - The error message on detecting invalid root dimensions will now respect
       verbosity.  In fact, this is a good reason not to run anything before
       getopts.
    committed Oct 5, 2011
  3. Add support for recordMyDesktop as cast command

    Working example: ffcast -vvw recordmydesktop -- -o cast.ogv
    committed Oct 5, 2011