Skip to content

Instantly share code, notes, and snippets.

@icedwater
Created November 27, 2014 08:30
Show Gist options
  • Save icedwater/cb3e550a398810b5ca76 to your computer and use it in GitHub Desktop.
Save icedwater/cb3e550a398810b5ca76 to your computer and use it in GitHub Desktop.
.lessfilter to handle mp4 and json files - depends on aeson-pretty and mplayer
#!/bin/sh
case "$1" in
*.extension)
extension-handler "$1"
;;
*.json)
cat "$1" | aeson-pretty
;;
*.mp4)
mplayer "$1" -ss 9000 2>/dev/null | grep \:
;;
*)
# We don't handle this format.
exit 1
esac
# No further processing by lesspipe necessary
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment