Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- datafile="$HOME/.vlist"
- #firefox@firefox
- #new years eve@mplayer -fs "$HOME/Videos/NewYearEve_2011/New Years Eve 2011.avi"
- #internet explorer@espeak "I think internet explorer Sucks. s"
- #internet@firefox
- #films by chris@xdg-open "http://filmsbykris.com"
- rec -r 16000 -t alsa default /tmp/recording.flac silence 1 0.1 5% 5 1.0 5%
- x=$(wget -q -U "Mozilla/5.0" --post-file /tmp/recording.flac --header="Content-Type: audio/x-flac; rate=16000" -O - "http://www.google.com/speech-api/v1/recognize?lang=en-us&client=chromium"|cut -d\" -f12)
- if [ "$1" == "test" ];then echo "$x";exit 0;fi
- cat "$datafile"|while read i
- do
- ia=$(echo "$i"|cut -d\@ -f1)
- if [[ "$x" =~ "$ia" ]]
- then exec=$(echo "$i"|cut -d\@ -f2)
- eval "$exec"& echo "$x"
- echo "Command Run $exec"
- break
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement