Skip to content

Instantly share code, notes, and snippets.

@lichray
Created October 18, 2012 02:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lichray/3909622 to your computer and use it in GitHub Desktop.
Save lichray/3909622 to your computer and use it in GitHub Desktop.
A tcsh alias to control Kindle on FreeBSD
# usage: kindle eject|start
# The 'start' command works for Kindle, but I saw an error message.
# However, I'm not silencing it here.
alias kindle 'camcontrol devlist | grep Kindle |'\
'sed -nE '\''s/^.*(pass[[:digit:]]+).*$/\1/p'\'' |'\
'xargs -J% camcontrol \!:1 % -E'
# Any brief command of camcontrol(8) is supported actually; 'eject'
# and 'start' are enough.
complete kindle 'p/1/(eject start)/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment