Last active
October 22, 2017 20:53
-
-
Save ggirou/20b2ece3b1f7bad5e1408afb36122bec to your computer and use it in GitHub Desktop.
Keyboard jukebox
This file contains 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 | |
cd songs/1 | |
while true | |
do | |
clear | |
echo 'Running Keyboard Jukebox...' | |
echo 'Tape a key to play a song' | |
echo; ls -la; echo | |
echo 'Ctrl^c to exit'; echo | |
[[ $prevchar ]] && echo Playing `ls -la $prevchar`; echo | |
read -n 1 char | |
char=${char,} | |
if [ "$char" != "$prevchar" ] || ! pidof omxplayer.bin && [ -f $char ]; | |
then | |
pkill omxplayer | |
prevchar=$char | |
omxplayer --no-keys $char & | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Install MPD
Install Kodi