Hello, When running Battle for Middle Earth 2, my screen resolution needs to be set at 1024x768 before I run the program or it crashes when I start a game. (It does switch automatically to 1024x768 but if I didn't set it myself beforehand it will crash once I start a game). Normally I have my resolution set at 1440x900. I wrote a script to do a few things: Code: sed 's/"UseGLSL"="enabled"/"UseGLSL"="disabled"/' -i /home/david/.wine/user.reg xrandr -s 1024x768 sleep 2 env WINEPREFIX="/home/david/.wine" wine "C:\Program Files\Electronic Arts\The Battle for Middle-earth (tm) II\lotrbfme2.exe" sed 's/"UseGLSL"="disabled"/"UseGLSL"="enabled"/' -i /home/david/.wine/user.reg xrandr -s 1440x900 The sed stuff is in there because LOTRBFME2 requires UseGLSL disabled but for other things I need it enabled. That said, whenever I run this script it crashes when I try to load a game just the same as it does if my resolution were 1440x900 before I launched it. If I take out the xrandr -s 1024x768 line, manually change the resolution in the nvidia x server settings, then run the script, it works fine (but isn't as convenient). Does nvidia x server settings do something xrandr doesn't, or is there something else I am supposed to do? (of course, if anyone knew how to get battle for middle earth to run fine from 1440x900, that would be great as well). Thank you very much!
mooseranger wrote:> sed 's/"UseGLSL"="enabled"/"UseGLSL"="disabled"/' -i /home/david/.wine/user.regDon't do this, you will corrupt Wine registry. Or this change will have no affect if wineserver is running. Add this setting for your app only. In winecfg, add your game exe (Add application) and select it in the list. Go to graphics tab, un-check pixel shader, hit apply, check it back, apply, exit. Start regedit, got to this key: [HKEY_CURRENT_USER\Software\Wine\AppDefaults\lotrbfme2.exe\Direct3D] and add "UseGLSL"="disabled". mooseranger wrote:> Does nvidia x server settings do something xrandr doesn't, or is there something else I am supposed to do?Does running xrandr manually from the terminal, waiting 5 sec and starting your game has the same problem as script?
mooseranger wrote:> Hmm... I tried this and it didn't seem to work...Then you might need to do this for a different executable. Some programs, especially games, use a launcher. You want to use the actual game executable instead. You should be able to find it running 'ps -ef' and looking for the actual game process name. Martin Gregorie wrote:> - first is the shell that put up your command prompt > - using "sh LOTRBFME2.sh" starts a new shell to run your script > - if your script starts with "#!/bin/sh" that will start a third shell > - the third shell will run the script and exit, then the second shell > will exit to leave you in the original shell, but any shell variables > the 2nd and 3rd shells set up will be lostThis is all irrelevant. He doesn't background any of the processes. Which shell they run doesn't matter. 'xrandr' changes X-display settings which have nothing to do with shell "setup". The only possible reason why it works when manually run and doesn't work from the script - is timing. 5 seconds might not be enough.