Feature #1060 on PlayOnLinux
Separate X Window for games
Added by Rainmaker on 2012-07-06 17:14:20 - Comment or update this ticket
Description, steps to reproduce:
When using "native" ("system") Wine, I notice that the window manager in the window environment can have a pretty big performance impact on your games.
I therefore created a script (I call it "wineX") which I use to launch wine apps in a separate X session.
It might be beneficial to performance if i.e. a checkbox is added to a application "run in separate X session".
It's pretty simple, my ~/bin/wineX file contains:
/usr/bin/xinit /usr/bin/wine $@ -- :1
For implementation in PlayOnLinux, one would need to dynamically generate this to make sure the right WINEPREFIX etc is set, but you get the idea.
Update by petch on 2012-07-06 17:18:14
- Tracker changed to Feature
Update by Quentin PÂRIS on 2012-07-06 21:25:49
Do you need root access to start a new xserver?
Update by Rainmaker on 2012-07-06 22:16:29
No, you can do this as any user.
At least on my system (Debian Sid), it works when run as a "normal" user.
Not sure if this is different on other distro's, or where this access is controlled (there's no obvious SUID bit AFAIK).
Update by Quentin PÂRIS on 2012-07-27 17:30:59
I guess it could be a good plugin
Update by Rainmaker on 2012-10-20 00:52:38
I may want to write this (if I can find some spare time, it can't be that hard), but I can't seem to find any documentation on writing a plugin. I can find plenty of info on writing instalation scripts, but plugins seem to be a different breed all together.
I see the plugins in /usr/share/playonlinux, but they all seem to be binary.
Some pointers? Is this compiled python?
Update by Quentin PÂRIS on 2012-10-20 12:15:33
Plugins are in fact .tar.bz2 files renamed to .pol
Extract one and you'll see quickly how it is made.
You have sevearal scripts :
menu is the script run when you select the plugin in the plugin menu. The name of the program is pased as an argument
lib can contain bash functions which will be added to PlayOnLinux environement
If you have any question, feel free to ask
Update by Fibbs on 2012-11-14 19:25:21
I've not properly looked into scripting on Linux yet so I wrote a tutorial on how to do this using the GUI. It's quite long though, a simple script like you propose would be much better.
The thread is here: http://www.playonlinux.com/en/topic-9707.html
As for the script you've pasted in your ticket, there are some changes you could make. At the moment you appear to be launching the app directly through WINE. This would bypass any custom config that has been set up in PlayOnLinux (such as a different WINE version to that of the system). It's much better to use a command like this:
xinit /usr/bin/ck-launch-session /usr/share/playonlinux/playonlinux --run "yourgamehere" %F $* --
:3 & nvidia-settings –load-config-only
'Yourgamehere' should be replaced with whatever PlayOnLinux's internal name for your game is. '/usr/bin/ck-launch-session' as far as I know gives your newly created X-server permission to access sound output.