Skip to content

Instantly share code, notes, and snippets.

@stevenharradine
Last active September 5, 2017 16:22
Show Gist options
  • Save stevenharradine/4abf12d2628632f1e8cbed126ad90a0a to your computer and use it in GitHub Desktop.
Save stevenharradine/4abf12d2628632f1e8cbed126ad90a0a to your computer and use it in GitHub Desktop.
To set up an autoplaying headless media center

Headless OSMC set up

To set up an autoplaying headless media center

Requirements

  • Raspberry Pi
  • monitor/keyboard for setup

Steps

  1. Download OSMC (https://osmc.tv/download/)
  2. Flash it to SD card
  3. Mount the boot parition
  4. Append hdmi_force_hotplug=1 to config.txt (allows boot without monitor connected)
  5. Boot up and walk through the setup (Need a monitor)
  6. Create a file /home/osmc/.kodi/userdata/autoexec.py
  7. Enter the following contents
import xbmc
xbmc.executebuiltin( "PlayMedia(/home/osmc/playlist.m3u)" )
xbmc.executebuiltin( "PlayerControl(repeat)" ) 
  1. Create /home/osmc/playlist.m3u Its contents is a line delimited list of media (local or remote)

Further customization

For the complete list of actions you can take you can go to http://kodi.wiki/view/List_of_built-in_functions and you can use xbmc-send to test out your functions before adding to your script

xbmc-send --host=192.168.0.1 --port=9777 --action="XBMC.Quit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment