Configure Commit Capturing

Matthew Hutchinson edited this page Apr 14, 2017 · 13 revisions

Environment Variables

lolcommits has some capture options for additional lulz. You can enable these via environment variables like so;

  • LOLCOMMITS_DEVICE set a webcam device - mac and linux only
  • LOLCOMMITS_ANIMATE (in seconds) set time for capturing an animated gif - mac and linux only & requires ffmpeg
  • LOLCOMMITS_DELAY (in seconds) set delay persistently (for slow webcams to warmup)
  • LOLCOMMITS_FORK (true|false) fork lolcommit runner (capture command forks to a new process, speedily returning you to your terminal)
  • LOLCOMMITS_STEALTH (true|false) disable notification messages at commit time
  • LOLCOMMITS_DIR set the output directory used for all repositories (defaults to ~/.lolcommits)

Or they can be set via the following arguments in the capture command (located in your repository's .git/hooks/post-commit file).

  • --device {name} or -d {name} (mac/linux only)
  • --animate {seconds} or -a {seconds}
  • --delay {seconds} or -w {seconds}
  • --fork
  • --stealth

NOTE: Use the --devices argument to see a list of available attached camera devices (mac only)


Loltext Options

You can configure the default loltext plugin to adjust the style of your lolcommit:

lolcommits --config -p loltext
  • text color
  • text font
  • text position
  • uppercase text?
  • size (point size for the font)
  • stroke color (font outline color)
  • transparent overlay (fills your image with a random background color)
  • transparent overlay % (sets the fill colorise strength)

Please note that:

  • The message and sha text can have different text options
  • Always use the full absolute path to fonts
  • Any blank options will use the default (indicated when prompted for an option)
  • Valid text positions are NE, NW, SE, SW, S, C (centered)
  • Colors can be hex #FC0 values or strings 'white'
  • You can set one or more overlay_colors to pick from, separated with commas

With these options it's possible to create your own unique lolcommit format. For example, to achieve these hipster-styled commits, try the following:

loltext:
  enabled: true
  :message:
    :color: white
    :font: "/Users/matt/Library/Fonts/Raleway-Light.ttf"
    :position: C
    :size: 30
    :stroke_color: none
    :uppercase: true
  :sha:
    :color: white
    :font: "/Users/matt/Library/Fonts/Raleway-Light.ttf"
    :position: S
    :size: 20
    :stroke_color: none
    :uppercase: false
  :overlay:
    :enabled: true

NOTE: you can grab the 'Raleway-Light' font for free from fontsquirrel.


Pass Capture Options with --enable

Any extra arguments you pass with the --enable command are auto-appended to the git-commit capture command. For example;

lolcommits --enable --delay 5 --animate 4 --fork                                                                                                   

This will configure capturing of an animated gif (4 secs) after a 5 sec delay in a forked process. See the section below for more capture configuration variables.