Page 1 of 1

[SOLUTION] Running program in separate X server

PostPosted: Jan 5th, '14, 16:08
by doktor5000
Hi all,

when troubleshooting why Alt+Tab wasn't working when it should and ways and akternatives to enable it,
I've stumbled upon a very neat alternative approach which is interesting. It simply starts any application
in its own Xserver on the next free tty.

It's called xrun, and instructions can be found in Arch Wiki:
https://wiki.archlinux.org/index.php/Ru ... _X_display
and also in https://wiki.archlinux.org/index.php/Ga ... e_X_server

The former version, which I'm using will display a small dialog, showing next free tty/DISPLAY for
X server, and asks if you want to start it or not. And you simply need to prefix the programs/games
that you want to start this way via xrun.

Re: [SOLUTION] Running program in separate X server

PostPosted: Jan 11th, '14, 23:16
by jiml8
VERY cool! :D

Re: [SOLUTION] Running program in separate X server

PostPosted: Jan 12th, '14, 16:26
by doktor5000
Well, not really after some tests. When you run another xinit/X server within your existing X session,
the second X server cannot play sound, you will hear that sound only on the first X server. This is due to the fact than systemd/logind will only
allow an active session to take control over the sound device. This can be queried within your X session via
Code: Select all
loginctl -a session-status 1
where you need to look for the bit that says State: active

Part of this is explained at http://blog.falconindy.com/articles/bac ... stemd.html

Best way to fix this is to change to another tty, login and then run your application game there:
Code: Select all
xinit /path/to/program -- :2 vt02

where :2 is the second display it provides, and vt02 is the virtual terminal number which it should run on, which is available as $XDG_VTNR

Re: [SOLUTION] Running program in separate X server

PostPosted: Jan 12th, '14, 17:22
by jiml8
I am able to play videos in the second X server and have sound. If the player (I am using mplayer) has been assigned to the second X server, how could sound be assigned to the first one?

And what difference does it make anyway.

Re: [SOLUTION] Running program in separate X server

PostPosted: Jan 12th, '14, 17:31
by doktor5000
Depends how you start the second X server, and if it's considered an active session.

The difference it makes, as proposed in original post, game would run but not have sound. Which is dull :)