Skip to content

Instantly share code, notes, and snippets.

@Koronen
Created May 7, 2012 21:01
Show Gist options
  • Save Koronen/2630394 to your computer and use it in GitHub Desktop.
Save Koronen/2630394 to your computer and use it in GitHub Desktop.
Simple Webcam Barcode Scanner
#!/bin/sh
set -e
sudo apt-get install zbar-tools xdotool
#!/usr/bin/env ruby
f = IO.popen('zbarcam -q --raw')
begin
while (line = f.readline)
system "xdotool type '#{line}'"
end
rescue EOFError
f.close
rescue Interrupt
f.close
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment