[SOLUTION] Running program in separate X server

Here you'll find a place for solutions and hints.

Please use one of the support subforums below for questions or if you have any issues and need support.

[SOLUTION] Running program in separate X server

Postby doktor5000 » Jan 5th, '14, 16:08

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.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18042
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [SOLUTION] Running program in separate X server

Postby jiml8 » Jan 11th, '14, 23:16

VERY cool! :D
jiml8
 
Posts: 1254
Joined: Jul 7th, '13, 18:09

Re: [SOLUTION] Running program in separate X server

Postby doktor5000 » Jan 12th, '14, 16:26

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
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18042
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [SOLUTION] Running program in separate X server

Postby jiml8 » Jan 12th, '14, 17:22

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.
jiml8
 
Posts: 1254
Joined: Jul 7th, '13, 18:09

Re: [SOLUTION] Running program in separate X server

Postby doktor5000 » Jan 12th, '14, 17:31

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 :)
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18042
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to The magician suggests...

Who is online

Users browsing this forum: No registered users and 1 guest

cron