Start a second X session with different resolution and sound
For sound, all you have to do is run ck-launch-session
in the script:
#!/bin/sh
X :3 -ac & nvidia-settings --load-config-only
sleep 10 # wait for X to catch up
cd ~/.wine/drive_c/Program\ Files/Steam/
DISPLAY=:3 ck-launch-session
DISPLAY=:3 WINEDEBUG=-all wine "Steam.exe"
Sound from both X displays get merged.
To answer your question more specifically. You can use nvidia-settings to change the meta-mode. A fragment from nvidia-settings --help:
-a, --assign=[ASSIGN]
The ASSIGN argument to the '--assign' commandline option is of the form:
{DISPLAY}/{attribute name}[{display devices}]={value}
This assigns the attribute {attribute name} to the value {value} on the X
Display {DISPLAY}. {DISPLAY} follows the usual {host}:{display}.{screen}
syntax of the DISPLAY environment variable and is optional; when it is
not specified, then it is implied following the same rule as the
--ctrl-display option. If the X screen is not specified, then the
assignment is made to all X screens. Note that the '/' is only required
when {DISPLAY} is present.
{DISPLAY} can additionally include a target specification to direct an
assignment to something other than an X screen. A target specification
is contained within brackets and consists of a target type name, a colon,
and the target id. The target type name can be one of "screen", "gpu",
"framelock", "vcs", "gvi", or "fan"; the target id is the index into the
list of targets (for that target type). The target specification can be
used in {DISPLAY} wherever an X screen can be used, following the syntax
{host}:{display}[{target_type}:{target_id}]. See the output of
`nvidia-settings -q all` for information on which target types can be
used with which attributes. See the output of `nvidia-settings -q
screens -q gpus -q framelocks -q vcs -q gvis -q fans` for lists of
targets for each target type.
The [{display devices}] portion is also optional; if it is not specified,
then the attribute is assigned to all display devices.
Some examples:
-a FSAA=5
-a localhost:0.0/DigitalVibrance[CRT-0]=0
--assign="SyncToVBlank=1"
-a [gpu:0]/DigitalVibrance[DFP-1]=63
Running more than one X session
I think this is exactly what you want. And running more than X session is possible, that doesn't mean all video-drivers allow you to use the same video-card. So running more than Xsession, means you are going to need more than one video card.
Metamodes
Games can change the resolution of your desktop and the setup of your screen using meta-modes. Say you have a large 1680x1050 monitor on the left, and an older, smaller monitor on the right which has 1025x768 as the highest resolution.
Section "Screen"
Identifier "Default Screen"
DefaultDepth 24
Option "TwinView" "1"
Option "TwinViewXineramaInfoOrder" "CRT-0"
Option "metamodes" "CRT-0: 1680x1050 +0+0, CRT-1: 1024x768 +1680 +0; CRT-0: 1680x1050 +0+0, CRT-1: NULL; CRT-0: 1400x900 +0+0, CRT-1: NULL;"
EndSection
When you can select the resolution in a game you'll have these options:
2704x1050 this refers to the total viewport size of using two monitors
1680x1050 this means the second monitor is off, and you will use a high resolution
1400x900 this also only used the first monitor, but it will run a bit quicker
You could add a lot of meta-modes. Just make sure that the 'resulting' viewport has a unique resolution. Otherwise the games won't understand it.
Interestingly, when you alt-tab out of a game, your system will switch back to the original meta-mode, and when alt-tab back into a game, it will go to back to configured meta-mode for the game.
Wine/Steam
The meta-mode trick will work with wine as well. However, there are games that don't support changing the resolution.
A nice workaround:
- turn on emulate virtual desktop, in wine-config, and set it to your desktop size
- compiz will automatically turn it into 'fullscreen' mode and hide panels
- the mouse will be captured properly. Your other monitor is still on, and displays whatever is there. You will need to alt=tab to reach it though. Perhaps its a good idea to associate a shortcut to minimize window.
If you still have issue with mouse capturing with certain games, you can use mousewarp mode:
WINEFORCEMOUSEWARP=yes wine yourapp.exe
Pulseaudio & Wine
You can use this PPA, to get a wine that has the pulse-audio driver enabled. Make sure to also select it using wine-config.
https://launchpad.net/~neil-aldur/+archive/ppa