Skip to content

Instantly share code, notes, and snippets.

@gbluma
Created January 27, 2014 15:52
Show Gist options
  • Save gbluma/8651060 to your computer and use it in GitHub Desktop.
Save gbluma/8651060 to your computer and use it in GitHub Desktop.
Recording keystroke count in Linux
function keystroke-record() {
sudo cat /dev/input/event5 >> /tmp/keyboard.log &
}
function keystroke-count() {
echo $( echo "$( cat /tmp/keyboard.log | wc -c ) / 96" | bc -l )
}
function keystroke-reset() {
sudo cat /dev/null > /tmp/keyboard.log
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment