Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plencovich/45c4b4c46236b6c3e238ddf5ef7302c9 to your computer and use it in GitHub Desktop.
Save plencovich/45c4b4c46236b6c3e238ddf5ef7302c9 to your computer and use it in GitHub Desktop.
Configuración para evitar que Kodi junto a Raspbian haga pantalla negra al salir.

-Crear Nuevo archivo

sudo nano /usr/local/bin/startkodi

-Pegar lo siguiente:

#!/bin/bash
fbset_bin=`which fbset`
xset_bin=`which xset`
xrefresh_bin=`which xrefresh`
if [ ! -z $fbset_bin ]; then
  DEPTH2=`$fbset_bin | head -3 | tail -1 | cut -d " " -f 10`
fi
kodi "$@"
if [ ! -z $fbset_bin ]; then
  if [ "$DEPTH2" == "8" ]; then
    DEPTH1=16
  else
    DEPTH1=8
  fi
  $fbset_bin -depth $DEPTH1 > /dev/null 2>&1
  $fbset_bin -depth $DEPTH2 > /dev/null 2>&1
fi
if [ ! -z $xset_bin ] && [ ! -z $xrefresh_bin ]; then
  if [ -z $DISPLAY ]; then
    DISPLAY=":0"
  fi

  $xset_bin -display $DISPLAY -q > /dev/null 2>&1
    if [ "$?" == "0" ]; then
      $xrefresh_bin -display $DISPLAY > /dev/null 2>&1
    fi
fi
VT="$(fgconsole)"
if [ "$VT" ]; then
  sudo chvt 7
  sudo chvt "$VT"
fi

-Ejecutar:

sudo chmod a+x /usr/local/bin/startkodi

-Crear icono en escritorio:

nano /home/pi/Kodi.desktop

y pegar el siguiente contenido:

[Desktop Entry]
Name=KODI
Comment=KODI MEDIA CENTER
Exec=/usr/local/bin/startkodi
Icon=/usr/share/kodi/media/icon256x256.png
Terminal=false
Type=Application
Categories=Sound;Video;
StartupNotify=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment