r/Kubuntu•
Shawoop

How to run multiple X screens in Kubuntu 11.10, to use as a media center

After upgrading to 11.10 my media center needed tweaking to get the second X screen working again. The script to be run at boot time must now have the --replace argument added to it, so it will look like this

DISPLAY=":0.1" icewm --replace &

**For those who want a whole howto: ** KDE Session Manager tries to manage all possible screens that are currently running. This is not good for playing videos on a secondary TV screen, therefore pure X screen is a much better solution.

Edit ~/.kde/share/config/kcmdisplayrc and add these lines:

[X11]
disableMultihead=true
  • Setup X to do multiple X screens in /etc/X11/xorg.conf (or nvidia-settings if you have an Nvidia card)
  • sudo apt-get install icewm

Now run this command

echo 'DISPLAY=":0.1" icewm --replace &' >> ~/.kde/Autostart/kdestart.sh

After reboot the second X screen should be running icewm on a separate X screen.

Now let's say screen 1 is a monitor and 2 is a TV, and when you click video files on the monitor you want it to play in VLC Player on the TV. Go to the properties of any video file in Dolphin and click the little wrench, this edits the file type. Click Add, for name put 'VLC on TV' and for command put

DISPLAY=":0.1" vlc %U

Do this for each type of video file you regularly use and make sure it's at the top of the application preference order. Congratulations, now clicking a video will play it in its own separate screen on your tv! If you want to play it on the monitor instead just right click the video and select 'Open With' to display the regular options that will play on the monitor.

Also, the above command will work for any other program if you prefer a different player, just substitute vlc for whatever. You can run an application on the second X screen without passing it any arguments as well, like this-

DISPLAY=":0.1" firefox

It is useful to have a launcher in the KDE taskbar on the monitor that will run this command so you can easily launch an instance of firefox on the TV.

Posted Oct 18, 2011, 7:42 AM UTC · edited

76
drbobb•

Nice. But is your tv connected over HDMI? I have been totally unsuccessful in making audio play over HDMI, in addition to video. I have a gforce...

1
kimme•

"sudo usermod --group audio,video,fuse,cdrom,plugdev YOURUSERNAME" is how to get the hdmi sound working in Ubuntu.

3
drbobb•

Had absolutely no effect for me.

1
kimme•

Do you have pulseaudio or alsa?

1
drbobb•

No idea, I have whatever Kubuntu uses by default.

2
ShawoopOP•

I use a DVI to HDMI cable, so it is HDMI but I don't do audio to the TV. My audio out goes from a separate card on the computer into a receiver by way of an audio to RCA cable.

So I have no experience doing audio through HDMI, sorry. That said, there seems to be some decent documentation from the XBMC media center distro that might be useful. While it might not be specific to KDE I'd imagine that would be a good place to start.. I'm sure there's got to be a way, might even be something as simple as having the output muted. Good luck!

1