Tutorials → Linux-XBMC on second screen in…

Linux-XBMC on second screen in fullscreen mode

This tutorial shows you how to start XBMC on your second screen in fullscreen mode, when everything else fails.


My screen arrangement in the example

I have a laptop on the left with a screen resolution of 1280x800 pixels and a second monitor with a resolution of 1366x768 pixels on the right:

When starting XBMC it will show fullscreen on my laptop, but I wanted to see it on the second monitor. There is an option in the settings, where you can select "Windowed", "Fullscreen #1" and "Fullscreen #2". But the option "Fullscreen #2" is not shown in my settings, so I made an easy workaround:

The workaround

  • Open xbmc, set it to windowed mode in settings and then exit.
  • Install wmctrl if you don't have it already installed:
    sudo apt-get install wmcrtl
  • Create a file called xbmc_secondscreen.sh:
    gedit xbmc_secondscreen.sh
  • In the editor enter the following lines:
    #!/bin/sh
    xbmc &
    sleep 1
    wmctrl -r XBMC -b add,fullscreen
    wmctrl -r XBMC -e 0,1281,0,1366,768
  • Then replace the coloured values, where
    1281 is the width of your left desktop +1,
    1366 is the width of your right desktop and
    768 is the height of your right desktop.
  • Save the file and close the editor. Then make the file executable by typing:
    chmod +x xbmc_secondscreen.sh
  • You can then start xbmc by typing
    ./xbmc_secondscreen.sh
    and very soon after start, XBMC should go fullscreen and switch to the right desktop.

Chuck Norris kann wirbellosen Tieren trotzdem das Genick brechen.