Skip to content

Instantly share code, notes, and snippets.

@henrik242
Last active September 26, 2017 12:57
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 henrik242/5331445 to your computer and use it in GitHub Desktop.
Save henrik242/5331445 to your computer and use it in GitHub Desktop.
Target monitor selector for XBMC

Target monitor selector for XBMC

I have a TV and a projector connected to my Mac Mini media center, and can choose either screen by using these scripts.

The scripts overwrite advancedsettings.xml in XBMC's userdata folder. I got the required data by configuring XBMC for each target screen, and diffing the resulting guisettings.xml files afterwards.

  • xbmc-for-tv.command

    My Samsung 1080p LED TV needs a -250 ms audio delay, and is the main display. It's hooked up to the Mini DisplayPort output.

  • xbmc-for-projector.command

    My 800x600 Acer projector doesn't need any audio delay. The weird screenmode might be a floating point bug, but I'm keeping it regardless. It's on the Mini-DVI output.

Put the .command files on your desktop, make them executable and launch by double clicking. You probably want to edit them to fit your needs.

#!/bin/sh
killall XBMC
killall XBMCHelper
sleep 3
echo '<advancedsettings>
<defaultvideosettings>
<audiodelay>0</audiodelay>
</defaultvideosettings>
<videoscreen>
<screen>1</screen>
<screenmode>10080000600060.00002p</screenmode>
</videoscreen>
</advancedsettings>' > ~/Library/Application\ Support/XBMC/userdata/advancedsettings.xml
open -a XBMC
#!/bin/sh
killall XBMC
killall XBMCHelper
sleep 3
echo '<advancedsettings>
<defaultvideosettings>
<audiodelay>-0.250000</audiodelay>
</defaultvideosettings>
<videoscreen>
<screen>0</screen>
<screenmode>DESKTOP</screenmode>
</videoscreen>
</advancedsettings>' > ~/Library/Application\ Support/XBMC/userdata/advancedsettings.xml
open -a XBMC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment