Skip to content

Instantly share code, notes, and snippets.

@matthewtodd
Created January 5, 2009 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewtodd/43363 to your computer and use it in GitHub Desktop.
Save matthewtodd/43363 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
#
# I have a couple of GeekTool windows at the bottom of the screen,
# where it's nice to bottom-justify their contents, but GeekTool
# doesn't seem to support this natively.
#
# Usage:
# cat TODO.rdoc | bottom-justify.rb 24
#
# It seems like there could be a nice shell command for this,
# something like `tail -n 24`, except tail doesn't insert the blank
# lines. Am I missing something?
height = ARGV.shift.to_i
lines = ARGF.readlines
(height - lines.length).times { puts }
puts lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment