Last active
August 20, 2020 14:40
-
-
Save uahim/a7ffb97d98cd61165906ba69e998a16a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#requires Cygwin, netcat, Autohotkey, focus_firefox.ahk and Nircmdc on Windows | |
while true | |
do | |
content=$(echo foobar | nc.exe -l -p 999 | sed -r -n "$ s/\n//;$ p") | |
cmd /c focus_firefox.ahk | |
if test $content = "volup" | |
then | |
cmd /c nircmdc sendkeypress up | |
elif test $content = "voldown" | |
then | |
cmd /c nircmdc sendkeypress down | |
elif test $content = "mute" | |
then | |
cmd /c nircmd sendkeypress m | |
elif test $content = "minimize" | |
then | |
cmd /c nircmd sendkeypress esc | |
elif test $content = "pause" | |
then | |
cmd /c nircmdc sendkeypress spc | |
elif test $content = "prev" | |
then | |
cmd /c nircmdc sendkeypress left left & nircmdc sendkey left left | |
elif test $content = "next" | |
then | |
cmd /c nircmdc sendkeypress right right & nircmdc sendkey right right | |
elif test $content = "fullscreen" | |
then | |
cmd /c nircmdc sendkeypress f | |
elif test $content = "skip" | |
then | |
cmd /c nircmdc sendkeypress s | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment