Skip to content

Instantly share code, notes, and snippets.

@SysadminJeroen
Forked from aperezm-vlex/kodi.sh
Last active July 1, 2016 12:43
Show Gist options
  • Save SysadminJeroen/37044bc9645228aa75e552ef1dbe4199 to your computer and use it in GitHub Desktop.
Save SysadminJeroen/37044bc9645228aa75e552ef1dbe4199 to your computer and use it in GitHub Desktop.
Raspbian: Avoid black screen on kodi exit
#!/bin/bash
LOG_FILE=$HOME/.kodi/temp/kodi.log
rm $LOG_FILE 2> /dev/null
/usr/lib/kodi/kodi.bin --standalone &
while [[ ! -f $LOG_FILE ]] ; do
sleep 1s
done
while read line ; do
if [[ ${line} =~ "application stopped" ]] ; then
echo "Killing kodi"
break
fi
done < <(tail --pid=$$ -f -n0 $LOG_FILE)
killall kodi.bin
sleep 5
fbset -depth 8 && fbset -depth 16
sleep 1s
xrefresh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment