Skip to content

Instantly share code, notes, and snippets.

@aperezm-vlex
Last active February 23, 2021 19:00
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save aperezm-vlex/75d7481afff0db8f5894 to your computer and use it in GitHub Desktop.
Save aperezm-vlex/75d7481afff0db8f5894 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
fbset -depth 8 && fbset -depth 16
@chuongkim123
Copy link

This one work for Raspberry Pi 4 4GB (mine):

#!/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

fbset -depth 8 && fbset -depth 16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment