Page 1 of 3
HOWTO: Set up a seperate X-server (New)
Posted: 22 Apr 2008, 17:49
by Relative
This HOWTO is based off this earlier HOWTO:
http://spring.clan-sy.com/phpbb/viewtop ... =20&t=8403
It has been updated not to rely on an outdated package config:
This guide has Ubuntu 7.10 or 8.04 in mind, but may work on other distributions, but I wouldn't know.
The aim of this guide is to show you how to setup a separate x-server to run spring. This improves spring's performance and allows you 'alt-tab' (or return to your desktop and back) as you would with windows, but better as that didn't always work well even under windows.
Step 1: Giving users the authority to start x-server sessions by editing Xwrapper.config:
First open the terminal and execute this:
Code: Select all
gksudo gedit '/etc/X11/Xwrapper.config'
You should get something like this at the bottom of that file:
Code: Select all
allowed_users=console
nice_value=0
Now you want to make sure it looks like this:
Code: Select all
allowed_users=anybody
nice_value=0
Save and close you text editor.
Step 2: Making your spring script!:
Open up your favorite text editor and paste this:
Code: Select all
#!/bin/bash
xinit /usr/games/spring $* -- :1
Save it as "spring".
3. Making your spring script an executable:
Code: Select all
cd /to/file/directory
chmod a+x ./spring
And that's it. Just run that file and spring with open up in a new x-server session. To swap back to your desktop session the key binding is ctrl+alt+F7. To swap back its ctrl+alt+F9. If you use springlobby or aflobby you just set this file to be your spring executable and it should work as normal.
Edit:
http://springrts.com/phpbb/viewtopic.php?f=20&t=19252
Re: HOWTO: Set up a seperate X-server (New)
Posted: 23 Apr 2008, 01:06
by aegis
You should be able to skip to step 4 with
and change the script to do
if you have sudo privileges.
and can kill compiz-fusion with one of these in the script to launch spring
gnome/gdm:
kde:
at the end to restart compiz when it is done:
Re: HOWTO: Set up a seperate X-server (New)
Posted: 23 Apr 2008, 01:12
by LordMatt
hmm these are all the steps I forgot to explain to someone when I told them how to set up dual screens with separate xserver, no wonder it didn't work. @_@
Re: HOWTO: Set up a seperate X-server (New)
Posted: 23 Apr 2008, 01:35
by aegis
if they have an nvidia card, they can run nvidia-settings and configure dual-monitor with ease :)
Re: HOWTO: Set up a seperate X-server (New)
Posted: 23 Apr 2008, 01:38
by Vadi
Does a separate X server really give that much of performance? I used to do that (manually logout, login to failsafe terminal) and didn't notice a performance increase.
Plus, I found out that that if you use glXCreateWindow, you can normally alt+tab out of games and even use compiz screen edges and so on to get out. Unfortunately the only game on Linux that I found so far to use that is Savage 2

Re: HOWTO: Set up a seperate X-server (New)
Posted: 23 Apr 2008, 01:41
by aegis
if nothing else, a separate X server prevents you from losing your X session if spring seizes up :)
Re: HOWTO: Set up a seperate X-server (New)
Posted: 23 Apr 2008, 01:46
by Vadi
*continues digging on the intrawebs on this wtflol-amazing glXCreateWindow method to bug devs later*...
Re: HOWTO: Set up a seperate X-server (New)
Posted: 23 Apr 2008, 02:19
by LordMatt
aegis wrote:if they have an nvidia card, they can run nvidia-settings and configure dual-monitor with ease :)
Of course it isn't that simple if you want a different display configuration for spring and your regular desktop.

Re: HOWTO: Set up a seperate X-server (New)
Posted: 23 Apr 2008, 02:37
by aegis
copy your /etc/X11/xorg.conf file at the state you want it
then start X with:
or for a separate virtual terminal (the method above)
Re: HOWTO: Set up a seperate X-server (New)
Posted: 23 Apr 2008, 02:39
by LordMatt
The full line that I use is:
Code: Select all
xinit /usr/local/games/spring $* -- :1 -config xorg-spring-dualscreens.conf > /home/matt/.spring/console.log
Re: HOWTO: Set up a seperate X-server (New)
Posted: 23 Apr 2008, 03:04
by aegis
do you actually need to edit your Xauthority to allow more than one session?
Re: HOWTO: Set up a seperate X-server (New)
Posted: 23 Apr 2008, 05:38
by det
The script I use to start a new X server follows
Code: Select all
#!/bin/sh
if [ "$1" = "/V" ]; then
echo "Spring 0.76b1"
else
startx /usr/games/spring $@ -- :1
fi
I had to edit Xwrapper, but I didn't have to edit my XAuthority. I also symlink "~/.wine/drive_c/Program Files/Spring/spring.exe" to this script so that TASClient launches it.
Re: HOWTO: Set up a seperate X-server (New)
Posted: 14 May 2008, 23:05
by gorgofdoom
I really appreciate this post, it appears to get me about 10-15 extra fps while playing spring for some reason, which i don't think all comes form a separate x server. Even tho, it i have also used it for Urban Terror, Nexuz, and Alien Arena, however i am not sure that it is helping with the performance of these games.
p.s. im a n00b at anything coding, so if I'm an idiot, please tell me.
Re: HOWTO: Set up a seperate X-server (New)
Posted: 28 May 2008, 02:56
by dila813
This is Enrique Schiel's Script and with the parms that were laid out in this string, the two work very well togeather.
!/bin/bash
# runner
#
# Sun Oct 28 07:17:37 2007
# Copyright 2007 Enrique Schiel
# <
ecschiel@yahoo.com.ar>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
CHANGE=0
if ps -e | grep compiz; then
CHANGE=1
fi
if [ $CHANGE == 1 ]; then
printf "Disabling advanced desktop efects...\n"
/usr/bin/metacity --replace &
fi
printf "Running the game...\n"
xinit /usr/games/spring $* -- :1 &
wait $!
if [ $CHANGE == 1 ]; then
printf "The game is finished. Restoring advanced desktop efects...\n"
/usr/bin/compiz --replace &
fi
Re: HOWTO: Set up a seperate X-server (New)
Posted: 28 May 2008, 11:09
by Relative
@ dila813
Thanks for the script, but why does it have a copyright notice. That's almost the equivalent of having a copyright notice for 2+2=4, its absurd.
Re: HOWTO: Set up a seperate X-server (New)
Posted: 31 May 2008, 19:19
by Vadi
It's not absurd, because this is more than 2+2=4.
Re: HOWTO: Set up a seperate X-server (New)
Posted: 31 May 2008, 22:04
by bashar
ANd why do u need to turn off 3d adv effects if you run spring in a second X server?
Re: HOWTO: Set up a seperate X-server (New)
Posted: 01 Jun 2008, 10:54
by Relative
bashar wrote:ANd why do u need to turn off 3d adv effects if you run spring in a second X server?
You don't really have to.
Re: HOWTO: Set up a seperate X-server (New)
Posted: 01 Jun 2008, 12:02
by bashar
Relative wrote:bashar wrote:ANd why do u need to turn off 3d adv effects if you run spring in a second X server?
You don't really have to.
Yes that was I meant.
Re: HOWTO: Set up a seperate X-server (New)
Posted: 11 Jun 2008, 19:10
by Hobo Joe
To make it so you can alt-tab/switch workspaces with Spring WITHOUT a separate X server, all you have to do is put the game in windowed mode, then as soon as it starts, use your window manager hotkey to put the game into fullscreen(if it's not set, in Ubuntu, go to 'System > Preferences > Keyboard Shortcuts'). Everything works as it should, but now you can alt-tab. :)
I originally did this because Linux with dual monitors and full screen apps tends to freak out, but if you put apps into fullscreen with the window manager hotkey it'll only fullscreen them on ONE of your screens, instead of trying to stretch it across both.
This works with or without Compiz.