# [TIP] Using xlaunch

## truc

10/02/2007 fix a problem when option/arguments have spaces, see here

27/01/2007 very small change ==>  added the -L option to stat, line 317 ( -L, --dereference: follow links)

09/11/2006, a little fix, so that launching specific programs for a given application now works correctly , interesting info here

09/04/2006, corrected wrong behaviour with the XPLAYER feature, see this post for more info, don't forget to update your sudoers file (see there)

08/24/2006, the Xserver to use is now set to /usr/bin/Xorg instead of /usr/bin/X (since /usr/bin/X can be either Xorg or Xgl), download it here,  info here

08/22/2006 --> minor release,  grab it here, info here

***

Since 08/13/2006 xlaunch is available through the xgl-coffee overlay, it is -* keyworded so you need to do: echo 'x11-misc/xlaunch -*' >> /etc/portage/package.keyword before merging it.

***

08/08/2006 --> You can now choose a name when creating a link for a program that isn't in your PATH, see here to know why it can be usefull, and here for a bit more details on this.. :/

08/01/2006 (last update before my holidays:) ) --> added some functionnalities, see here for more details

07/31/2006(in the evening..) --> now, if you want to launch something wich isn't in your path, you don't need anymore the --path option, but you can still use it:), see 

I also added a function for a repetitive task (in the code, not when you run it)

07/31/2006(early in the morning) --> corrected and modified some comments, there are no need to update the script, if you already have it.

07/30/2006  added  a link to download this growing script, some cleaning in it,and xlaunch now unset two variables that could (in special conditions) prevent it from working as expected, see there  for more details

07/27/2006 big changes in xlaunch script, which is now far more user friendly, make this post reflect the changes, see here for more details

I  - Why could you be interested in this script?

II - eh, this looks quite long to set it up   :Embarassed: 

III  - The xlaunch script 

a) Background

b) HowTo use it - The new way - The link trick

c) Making your multimedia keys working

d) Using XPLAYER

IV - Why it is so good?

a) wine

b) xqf

c) Differents settings for each app 

d) You tell me?  :Wink:  

I  - Why could you be interested in this script?

Hi, I wrote i little script, xlaunch, which, among other things that I will explain, launch an program on an other DISPLAY.

For those who are not yet familiar with this, here is some of the reasons why you could want/need that:

* You can now switch from a fullscreen app (eg: a game) to your desktop within a couple of second, with CTRL+ALF+F$. This is actually the first reason why I want to do this script (I needed something like alt+tab that works within a game)

* For XGL users, this means, they can launch an opengl program (like googleearth, or a game), since IIRC it's not yet possible to use an opengl app directly in XGL. It doesn't have to be an fullscreen application, since it can also launch a Window Manager with the program.

* You can use your multimedia/fun keys (on your keyboard/remote control..) inside a fullscreen app, which normaly grabs everythings from your input devices. This is handy since you can now control e.g.: your music, volume and so on, inside the game (no need to go back to your destop).

* If you want to (easy to enable) you can create a game user, it will be used to launch the program if it's a game. There are mainly three reasons for that:

* Many games can manage different profile, and if they are several users who can play on your computer, there will be a "~/.game_name" directory in each user's home, and some users will probably download files already downloaded by others. So if you enable this feature, it will launch games as a specific user (I'll call it XPLAYER). 

* Same comment applies to wine users, they will have to install a given game only one time, in XPLAYER's home.

* I like to believe, that if there's a bug in my game, (like those ), it adds a bit of security, since it's run with a user, belonging to only video,audio and games groups. 

* The only two downsides I can think of, is that an other user could delete your profile, so XPLAYER is only usable on a personnal computer, where there is a minimum of trust between users  :Wink: , and that different users may have different keybindings(a different xbindkeysrc file) 

* If you use this script, you don't have to wonder which Display you can use (it finds and uses the first available).

* If your ~/.Xauthority file (or XPLAYER's one if you use it) doesn't have the needed cookie corresponding to a given display, it will create it for you, and keep it for later use.

II - eh, this looks quite long to set it up   :Embarassed:  ?

Actually, it's never been long to configure, there was, at the beginning, only one link to do, yep one thing that's all. But I just explain how to do a lot of things, and why blah,blahblah instead of just making a listing of the needed command (actually it wouldn't be a listing, since there's only one command.. ( ln ). 

Keep in mind that I'm also explaining here howto use some of xlaunch functionnalities that you probably don't need. Do you need to have special keybindings to control e.g. your music within a game? do you need to set your mouse sensitivity? ..? I personnally do. 

Anyway, now it's easier than ever. If you're in a hurry, and want to try it now, just copy&paste the script xlaunch(from III - b), chmod it) and run it with the name of the program you want as an argument (eg:  xlaunch quake3-bin ).

Later when you'll have a bit more time then run xlaunch --help to have a brief view of what xlaunch can also do. But the help is quite short, so if you need anything, you're welcomed to read the following  :Smile: 

III  - The xlaunch script

a) Background 

[The only thing really needed is that the application, you want to launch with xlaunch, appears in your PATH]

This is no longer needed since version 20060727 : if you want to launch a program that doesn't appear in your PATH (for instance, something compiled in your HOME or whatever) then you can use the --path option for xlaunch, e.g.: xlaunch --path path/to/cool_prog

And since version 20060731-r1, xlaunch path/to/program is enough 

But you'll find everything easier if you have a directory, which is in your PATH, where you put all your scripts. If you don't have one yet, let's create it:

As root:

```
mkdir /home/scripts
```

 (and chmod and chown it to your need, eg: chown your_user_name_here:users /home/scripts , and chmod 755 /home/scripts )

Now we need to add this directory to your path, there are two ways for doing this: 

Either you do it manually with echo PATH=\"\$PATH:/home/scripts\" >> ~/.bashrc (as your normal user)

Or (the prefered way since, it will also add /home/scripts to every user,but root, PATH)

```
if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then

        PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"

else    

        PATH="/usr/local/bin:/usr/bin:/bin:${PATH}"

fi

```

```
if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then

        PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"

else    

        PATH="/usr/local/bin:/usr/bin:/bin:/home/scripts:${PATH}"

fi

```

now source it, to have the new $PATH in your env:

```
source /etc/profile
```

b) The script xlaunch 

Download it *here* and save it as /home/scripts/xlaunch 

```
chmod 755 /home/scripts/xlaunch

chown your_name_here:users /home/scripts/xlaunch
```

b) HowTo use it -The new way - The link trick 

First I have to say the script itself is IMO well commented, thus, if you want to modify someting, it should be pretty easy to find your way out.

The new way: you no longer have to do some linking in order to use it. A quick look into xlaunch --help will tell you that you can now run 

```
xlaunch quake3 +connect 213.246.38.167:27019
```

 and it will launch quake3 on an other DISPLAY, with you mouse settings, keybindings and so on. It works since quake3 is in my path. but if it wasn't(and if I have enough right to execute it), then I still can run 

```
xlaunch -p /usr/games/bin/quake3 +connect 213.246.38.167:27019
```

(it also work with relative path, ie: assuming you were in /usr/game, xlaunch -p bin/quake3 +connect 213.246.38.167:27019 would work.)

Note: since version 20060731-r1, you actually don't need to use the --path option, xlaunch path/to/program  is enough  (with relative or absolute path))

So as you can see there is, there is no longer anything to do before using it. But, honestly, even if possible, I still prefer launching : 

```
xquake3 +connect 213.246.38.167:27019
```

 instead of the previous ones, it just seems more obvious to me. I've modified xlaunch so that it is now able to create the link for you.  :Smile:  (keep on reading for more details  :Smile: )

* Fullscreen application:

new way if the user who wants to create link(s) has write access to the directory where xlaunch is, then he just need to run

```
xlaunch --addlink quake3-bin quake3-cpma

Created link for quake3-bin : xquake3-bin --> xlaunch in /home/scripts

Created link for quake3-cpma : xquake3-cpma --> xlaunch in /home/scripts
```

ButIf he doesn't have write access to this directory, then he can specify the directory where he wants these links to be created:

```
xlaunch --addlink ~/tmp quake3-bin quake3-cpma

Created link for quake3-bin : /home/truc/tmp/xquake3-bin --> /home/scripts/xlaunch

Created link for quake3-cpma : /home/truc/tmp/xquake3-cpma --> /home/scripts/xlaunch
```

And if, in this example, /home/scripts or /home/truc/tmp is in your PATH, then you can now run the command: xquake3-cpma ...

tip: since version 20060801,  if you would like to create a 'magic link' for a program that is note in your path, you just need to specify the directory of the program:

xlaunch --addlink path/to/program1 /PaTh/To/program2 ..

see here and also here for more detail on this.

If you're not satisfied with this you can still do it the old way: 

```
cd /home/scripts

ln -s xlaunch xquake3-bin
```

Note the 'x' before the name of the executable. 

Now, if you issue xquake3-bin, it will launch quake3-bin on an other DISPLAY. If you want it also configure your mouse or whatever you can do with xset, modify your keymaps, set your WM independant keybindings.

* Windowed application:

You can also launch a program, that is not supposed to be run fullscreen(eg: some strategic games have several windows). To achieve this, you can modify xlaunch. Let say I want to launch The Gimp (which comes with the gimp command) on an other display.

```
xlaunch gimp
```

And you'll find that you miss a window manager (at the very least to have window borders, and to be able to move windows). 

So, in xlaunch in this in the case loop: 

```
case "${FULL_PROG_NAME##*/}" in

    

    xlaunch) echo "The program can't call itself. Exiting!" 

            # Well, actually it can, but it will exit later, so exiting now..

       exit 2

            ;;

    *)      xinit "${FULL_PROG_NAME}" $* -- $Xserver :$DISPLAY_TO_USE $serverargs &>/dev/null &

            ;;

esac
```

you have to add the gimp case

```
case "${FULL_PROG_NAME##*/}" in

    gimp)   xinit "${FULL_PROG_NAME}" $* -- $Xserver :$DISPLAY_TO_USE $serverargs &>/dev/null &

            DISPLAY:$DISPLAY_TO_USE WindowManager &

    

    xlaunch) echo "The program can't call itself. Exiting!" 

            # Well, actually it can, but it will exit later, so exiting now..

       exit 2

            ;;

    *)      xinit "${FULL_PROG_NAME}" $* --  $Xserver :$DISPLAY_TO_USE $serverargs &>/dev/null &

            ;;

esac
```

Where you replace WindowManager with the WM of your choice. Note that if you have an other non fullscreen application, that you would like to run with the same WM, instead of adding a new case, just replace gimp) with gimp|other_app). 

Note: that you can do that even if you're launching someting that doesn't appear in your path, (your specifying the full/relative path (with for example: xlaunch --path path/to/program or  xlaunch path/to/program), if your path is like  very/long/path/to/program, you just have to add the case 'program' in the loop

c) Making your multimedia keys working 

I'm personnally using xmodmap and xbindkeys ( check this out: HOWTO Use Multimedia Keys). But if you're using an other daemon than xbindkeys, it shouldn't be that hard to modify xlaunch.

One thing you need to know, is that when your program runs in fullscreen mode, it usually grabs every keys from your input devices, this means, that daemons like xbindkeys won't get any event from them. Fortunately, there's a trick:

In the settings of the application/game, turn off fullscreen (yes do it:) ) . the good news, is that you launch this app on an other DISPLAY without any window manager running on it, this means the window of your app/game won't have any border at all, and if your game use the same resolution as the Xserver does, then it's just fullscreen. The app/game runs in window mode, but it's like fullscreen  :Smile:  .

You may wonder why it is so cool? only because now, the program doesn't grab everything from your input devices now. and now xbindkeys can receive some events.

Note that for games using the quake3 engine(quake3 itself, enemy-territory, tremulous and so on..), you need to bring down the console, otherwise, even with fullscreen off, they grab everythings. (once the console is down, you can use your special keys).

d) Using XPLAYER 

As I try to say in part I, there are, in my opinion, many advantages to use a default user XPLAYER, which(?) will be used to launch games. If you want to try it out, here is how you can do:

First we need to uncomment the XPLAYER variable in xlaunch in order to enable it.

Then we need to create that user, I've chosen xplayer, you can use something else, but then don't forget to modify the XPLAYER variable in xlaunch

as root run:

```
adduser -m -g games -G audio,video,cdrom xplayer

# then we su to xplayer, to copy what we need

su - xplayer
```

(if you previously modified /etc/profile as suggested, then xplayer has already /home/scripts in its PATH, otherwise issue echo "PATH=\"$PATH:/home/scripts\"" >> /home/xplayer/.bashrc )

Now, if you have one or several of these files: ~/.Xresources ~/.Xdefaults ~/.Xmodmap ~/.xbindkeysrc in your main user's HOME directory, then copy them to xplayer's HOME.

!!!Be sure to be xplayer when copying this( to avoid permission problem)... Same comment applies to the following.!!!

If it's not the first time you play, (is it?  :Shocked:  ) You should already have some directories in your HOME created by the games ( like ~/.q3a ~./etwolf or even ~/.wine )

=> Copy( or move them..). them from your home to xplayer's home. (once I copied wine directory, I ran (as xplayer) winecfg, I don't know if it's really needed, but it worked:) )

Now we need to configure sudo (app-admin/sudo):

login as root, then 

```
visudo
```

and

this line has change with version 20060904, be sure to have the right one now:

```
Cmnd_Alias      XLAUNCH          = /bin/su - xplayer -l -c FULL_PROG_NAME=* /home/scripts/xlaunch *

%games          ALL=(root)              NOPASSWD: XLAUNCH
```

You can also want to add this line your_main_user_name                  ALL=(root)              NOPASSWD: /bin/su - xplayer (so you'll be able to login as xplayer without any password, if you wanted to modify something in its home)

III  - Why it is so good? 

a) wine 

One of the things I particularly like with it is that I can use it for whatever I want, even launching a game via wine. e.g.: I have warcraft3 and The Frozen Throne, this is what you need to launch them with xlaunch:

create those two little scripts

```
#!/bin/sh

cd ~/.wine/drive_c/Program\ Files/Warcraft\ III

exec `wine Warcraft\ III.exe -opengl`

exit 0
```

and 

```
#!/bin/sh

cd ~/.wine/drive_c/Program\ Files/Warcraft\ III

exec `wine Frozen\ Throne.exe -opengl`

exit 0
```

since they are games:

```
chgrp games /home/scripts/{warcraft3,frozenthrone}

chmod 0750 /home/scripts/{warcraft3,frozenthrone}
```

And, as I said , programs need to appear in your PATH, since /home/scripts is in your PATH, then warcraft3 and frozenthrone are in too. Then all you have to do now is to follow II ) b) HowTo use it - The new way -The link trick :

```
cd /home/scripts

xlaunch --addlink warcraft3

xlaunch --addlink frozenthrone
```

(because /home/scripts is in my PATH, this means warcraft3 and frozenthrone too)

And when you want to play, just issue either xwarcraft3, or xfrozenthrone, and it will launch the game on an other display, su to XPLAYER, if you wanted to, and so forth and so on.

I don't have WoW, but, I think the same could be done, you just have to adapt the wow script from the warcraft3 one

b) xqf 

One other thing I like, is that there are no special trick to make xqf working with you game, in Preferences --> Game --> invoking --> in "command-line" change the command_for_the_game with xcommand_for_the_game (erm.. don't forget to do the symlink before  :Wink:  ) 

eg: for enemy-territory, do the symlink (xlaunch -a et), and in XQF, instead of et in the "Command Line" put xet, and now you can use XQF as you normally do, and when you join a game, in will launch it on an other display.  :Very Happy: 

Note: you can also put xlaunch et in the "Command Line" field, but  who would want that? :/

c) Differents settings for each app 

It's also possible to set differents settings for a given program, let's for example you want to run a fullscreen program in a lower resolution than your desktop is, I explain here(second part of the post) how you can do this.

I also explain in this post how you can set other things since it might not be obvious for every one .(happy reading)

d) You tell me? :Smile:  

I'd be glad to know if:

* You read this entire post

* You are interested in xlaunch

* You have any constructive comments (I'd also be happy to know what they are...)

* If I made any bashism in the script. I'd like xlaunch to run even if bash is not the default shell

* I made typo, grammar mistakes(?) (I'm sure I did since english is not my first language), I'd be happy to learn and to correct them  :Smile: 

Oh yeah I forgot, yeah I already heard about xgame, didn't tried it yet, but, I doubt xgame can easily do what xlaunch does (at least for the XQF part from what I've heard)

----------

## aidy

I'll check this out in ubuntu tomorrow

and will note of spelling mistakes

----------

## Dieter@be

well, seems like the reason why i don't use xgl is getting flushed  :Smile: 

----------

## truc

 *Dieter@be wrote:*   

> well, seems like the reason why i don't use xgl is getting flushed 

 

 :Confused:   :Question:  Sorry, I just can't understand? What do you mean?

----------

## Dieter@be

the reason that i don't use xgl is because of all the problems with playing games etc in xgl.

but now it seems these problems are gone, so i'm considering switching to xgl  :Smile: 

oh, and 1 typo:

 *Quote:*   

> II - The xlaunch script    a) Background      The only think really needed

 

should be "thing"   :Wink: 

----------

## stahlsau

hi,

great job with that script!

I've got some minor annoyances that bug me a little, but i think i can sort 'em out tomorrow.

First thing is that tremulous doesn't take the correct screenresolution from its configfile, there's always a black border around the gamewindow. But that isn't the fault of your script  :Wink: 

Second thing i've noticed is that the gamma values are wrong on the second Xserver screen. Even if i set gamma to 5 or something it doesn't change. Probably i have to enter the correct values to some configfile for the second virtual xserver to behave like the first one...i'll check that later.

Anyways, thx for the script, i'll post any things i find out about my problems  :Rolling Eyes: 

----------

## truc

 *Dieter@be wrote:*   

> should be "thing"  

 

thanks, corrected:)

 *Dieter@be wrote:*   

> well, seems like the reason why i don't use xgl is getting flushed 

 

 :Smile: 

 *stahlsau wrote:*   

> Second thing i've noticed is that the gamma values are wrong on the second Xserver screen. Even if i set gamma to 5 or something it doesn't change. Probably i have to enter the correct values to some configfile for the second virtual xserver to behave like the first one

 

You're talking about the gamma inside the game, right? if so: 

IIRC, tremulous, is using the quake3 engine from icculus. (icculus.org/quake3 ) and I also noticed a similar thing with quake3 (from source, not quake3-bin) , when fullscreen is off then brightness (in DISPLAY settings inside the game) has no effect. (but brightness works as expected in Fullscreen) So I reported the bug here: When Fullscreen is off, Brightness has no effect but didn't get any comment yet.

So it may be the same bug  :Question: 

Anyway, thanks

----------

## stahlsau

 *Quote:*   

> So I reported the bug here: When Fullscreen is off, Brightness has no effect but didn't get any comment yet.

 

Ok, seems to be the same bug. I commented on it in bugzilla. Sadly this bug renders your script unusable for me :/

Now i'll just have to check out how to get it using the correct resolution. I've set 1368x1026 in the config, but it starts with 1280x1024...well.

----------

## truc

 *stahlsau wrote:*   

> Ok, seems to be the same bug. I commented on it in bugzilla. Sadly this bug renders your script unusable for me :/

 

You can still play in fullscreen mode, I proposed window mode to make multimedia keys working, if you don't use them, (or prefer not using them and have your gamma working back) then you can play in fullscreen(and use the xlaunch  :Smile:  )

 *stahlsau wrote:*   

> Now i'll just have to check out how to get it using the correct resolution. I've set 1368x1026 in the config, but it starts with 1280x1024...well.

 

 :Shocked:  you can play tremulous in "1368x1026" !  :Question:  wierd! and does it work when you don't use the script? Your xorg.conf is also "1368x1026" ? didn't know such a resolution was possible!

And you're not using XPLAYER, arent' you?

----------

## stahlsau

 *Quote:*   

> You can still play in fullscreen mode, I proposed window mode to make multimedia keys working, if you don't use them, (or prefer not using them and have your gamma working back) then you can play in fullscreen(and use the xlaunch  ) 

 

hehe..sure i can use it in fullscreen mode, but then i can't minimize it...so, where's the advantage in using your scripts  :Wink: 

 *Quote:*   

> you can play tremulous in "1368x1026" !  wierd! and does it work when you don't use the script? Your xorg.conf is also "1368x1026" ? didn't know such a resolution was possible! 

 

yep, i got my native resolution as 1368x1024. It's from the time when i was active in the movie- and ripping-scene. 800x600 or 756x1024 are 1.3333, which is 4:3, and that is the native tv-resolution. But 1280x1024 is 1.25, so it doens't fit. As a real cineast that i was at that time, it wasn't bearable to watch my movies with a such skewed screen, so i had to go 1368x1024, whih is about 1.336, which is bearable  :Wink: 

I think every resolution is possible with the correct modeline in your xorg.conf. For modelines, check here for example.

 *Quote:*   

> And you're not using XPLAYER, arent' you?

 

No. I don't see the need for that atm.

----------

## truc

 *stahlsau wrote:*   

>  *Quote:*   You can still play in fullscreen mode, I proposed window mode to make multimedia keys working, if you don't use them, (or prefer not using them and have your gamma working back) then you can play in fullscreen(and use the xlaunch  )  
> 
> hehe..sure i can use it in fullscreen mode, but then i can't minimize it...so, where's the advantage in using your scripts 
> 
> 

 

What do you mean with "can't minimise"? if you're running the game with my script, even in fullscreen, you'll still have the CTRL-ALT-F$ thing working (to switch from the game to your desktop.. ) The only thing you loose is the ability to use your multimedia keys. (the only reason why I propose to run the game in window mode was to make multimedia keys wroking.)

----------

## CoffeeBuzz

Can I get some confirmation that this works for Xgl users? If so, I might consider adding it to the overlay.

----------

## stahlsau

 *Quote:*   

> What do you mean with "can't minimise"? if you're running the game with my script, even in fullscreen, you'll still have the CTRL-ALT-F$ thing working (to switch from the game to your desktop.. ) The only thing you loose is the ability to use your multimedia keys. (the only reason why I propose to run the game in window mode was to make multimedia keys wroking.)

 

Oh, cool...then it's of some use ofcourse. Ty for input   :Wink: 

----------

## roderick

 *CoffeeBuzz wrote:*   

> Can I get some confirmation that this works for Xgl users? If so, I might consider adding it to the overlay.

 

That sounds like a great Idea.

I think this is useful, even outside Xgl.

----------

## AllenJB

xgame can pass parameters to the program it's launching using the -c parameter, so it'll work fine with xqf. It's also a hell of a lot easier (in my opinion) to set up. Item setup is menu based and there's also a gui for it, xgame-gtk.

----------

## truc

A 'user-friendlier' vesrsion is coming tonight:) It will be a lot easier to use, and to set up. really.

I'm not fighting against xgame or whatever, but, so xgame can pass parameters to the program? good, that's a a good point cause it's the very least we can expect from a tool like this. The new version of xlaunch, I'm gonna put here, will be able to run some program without any configuration.

If you read carefully part I, you'll see that my point with xlaunch, was to launch something on an other display. but it was also  to set mouse sensitivity, to have my keybindings and so on..Last edited by truc on Fri Jul 28, 2006 11:04 am; edited 1 time in total

----------

## truc

 *CoffeeBuzz wrote:*   

> Can I get some confirmation that this works for Xgl users? If so, I might consider adding it to the overlay.

 

Since nobody has answered, I did try on my own and I can say it works  :Smile: (I did a fresh install of xgl just this afternoon, launch XGL, and terminal inside, then I issue xwarcraft3, and it worked, same with everything(that uses this  xlaunch script) I tried  :Smile: Last edited by truc on Fri Jul 28, 2006 9:30 pm; edited 1 time in total

----------

## truc

Ok, new version 20060727is out  :Wink: 

*You no longer have to create symliink to use it. xlaunch your_app will do it:) (launch your_app on an other display)

*Fortunately you can still use the link trick, and you can even use xlaunch to create the link(s)

*Possibility to launch application that are not in your PATH, (specifying the full path then)

*added some conditionnal tests, to avoid doing several times the same thing

*XPLAYER part has also been a bit modified, be sure to have to right line in the sudoers file (read III - d) if necessary)

*added: help message (check xlaunch --help !!)

**no more configuration needed to use/test xlaunch.**

Don't forget, if you use it, to set your xset options, in the XSET_ARGS variable at the beginning of the script.Last edited by truc on Fri Jul 28, 2006 11:05 am; edited 1 time in total

----------

## stahlsau

great job, thanks for that. It works flawlessly for now, besides the non-fullscreen-gamma-bug, which is quake3's fault. Especially those xset stuff is useful - if you don't set 

```
xset m 0 0
```

 X will enable mouse acceleration for the game, which in my eyes sucks really bad  :Wink: 

----------

## truc

 *stahlsau wrote:*   

> great job, thanks for that. It works flawlessly for now, besides the non-fullscreen-gamma-bug, which is quake3's fault. Especially those xset stuff is useful - if you don't set 
> 
> ```
> xset m 0 0
> ```
> ...

 

If all you want to do is to disable mouse acceleration(you don't want to set sensitivity or something like that), then I think you don't even need to instal x11-apps/xset, since :

 *man Xserver wrote:*   

> -a number 
> 
> sets pointer acceleration (i.e. the ratio of how much is reported to how much the user actually moved the pointer). 

 

So if I understand correctly, adding -a 0 to the serverargs variable should disable mouse acceleration too.

 :Smile: 

----------

## stahlsau

mmh well, i had installed this anyways...for disabling beep for example. 

You know quite some stuff about Xserver...don't tell me you've read the whole Xorg manpages?   :Shocked: 

----------

## truc

 *stahlsau wrote:*   

> You know quite some stuff about Xserver...don't tell me you've read the whole Xorg manpages?  

 

Actually I read man Xserver, because I needed to  :Smile:  but I didn't read the whole xset man page, and I didn't even know about beep and xset   :Smile: 

----------

## SiTH-

./xlaunch: line 286: syntax error: unexpected end of file

Any suggestions? All I did was cut&paste.

----------

## truc

```
$ cat scripts/xlaunch | wc -l

285

$ grep -v '^ *#' scripts/xlaunch | wc -l

236

```

This means there are 285 lines in the scripts, 236 lines without comments. Can you check, that you don't have something like this in xlaunch:

```
# The aim of this script is to launch program(s) on 

other DISPLAY(S), it is IMO well-

# commented so you should be able to easily use it.

```

I'd like to store the script somewhere, so you can easily download it, but I don't know where/how :/, if you're fast enough you can try here before I go to work.

Thanks for trying it.

----------

## SiTH-

Yeah, it's working now. I didn't have much time before so I don't check script for bugs.. 

Anyway, thank you for help.   :Smile: 

Btw: lines you mentioned are in script

----------

## Dieter@be

 *truc wrote:*   

> I'd like to store the script somewhere, so you can easily download it, but I don't know where/how :/, 

 

Don't you have any webspace from your isp or something? if not , i can host it for you if you want.

----------

## stahlsau

hi,

i could host it too, but maybe it would be more ...linux-style... if you'd started a project at freshmeat or sourceforge. This is a very simple process and includes free hosting.

----------

## truc

 *SiTH- wrote:*   

> Btw: lines you mentioned are in script

 

Yes they are, but they should be on three lines, I just wanted to check if every comment begins with a # 

 :Smile: 

 *Dieter@be wrote:*   

>  *truc wrote:*   I'd like to store the script somewhere, so you can easily download it, but I don't know where/how :/,  
> 
> Don't you have any webspace from your isp or something? if not , i can host it for you if you want.

 

 *stahlsau wrote:*   

> hi,
> 
> i could host it too, but maybe it would be more ...linux-style... if you'd started a project at freshmeat or sourceforge. This is a very simple process and includes free hosting.

 

Thanks, I appreciate your help, didn't even think to my ISP  :Smile:  .

----------

## truc

version=20060730

* Added a link to download xlaunch in the first post:)

* Some cleaning in the script

* variable that goes to your env are now unset correctly :

if you're not using the link trick to use xlaunch, you may have one of FULL_PROG_NAME or PROG_NAME variable in your environnement. (if you're using the form xlaunch program then your environnement (on the DISPLAY where the program is launched) contains PROG_NAME, while if you're using the form xlaunch --path path/to/program, it will contains the FULL_PROG_NAME variable).

You usually don't mind, but now, suppose you're using xlaunch to launch a WM on a new DISPLAY (with e.g. xlaunch fvwm ) then you will have PROG_NAME=fvwm in your environnement. Suppose now, that you're on this display, and want to use again xlaunch to launch something else on an other DISPLAY, or even you just want to check the help xlaunch -h, what happen? Before this version, since xlaunch didn't unset those two variables, xlaunch didn't launch anything but the program which is in PROG_NAME or FULL_PROG_NAME. In our example, this means it opened an new DISPLAY with fvwm, which is not what you want.

This unwanted behaviour is now corrected :Smile:  

----------

## BlackTiger

Hi,

thanks for the script it works fine  :Wink: 

The only thing I noticed it that when I close f.e a game using your script the new x server isn't closed - still running.

Could u change the script so that when the application is terminated also the new started xserver exits? After game and new xserver is closed then the script should also get me back to my xgl server - this would be great  :Smile: 

Regards

BlackTiger

----------

## truc

 *BlackTiger wrote:*   

> The only thing I noticed it that when I close f.e a game using your script the new x server isn't closed - still running.
> 
> Could u change the script so that when the application is terminated also the new started xserver exits? After game and new xserver is closed then the script should also get me back to my xgl server - this would be great 

 

I'm somewhat surprised, because, the game is launch with something like xinit /usr/game/bin/your_game -- xserver_options which means, if you quit the game, the xserver should also exit. I've  tested it with 'normal' xorg, and Xgl, and it works as expected. (once the game is closed, the xserver also exits, which brings me back to my desktop)

You normaly don't have to do that, but did you modified the scripts, as suggested in III --> b) HowTo use it -The new way - The link trick --> * Windowed application: if you did, what did you add? always remember that the application you launch with xinit, will be the application that will close the xserver.

and, last questions, did you try with something else than your game? (eg: xlaunch xterm, then exit and see what happen), which game is it?

----------

## BlackTiger

Uhh this is weird!

I used xlaunch with the -p prefix and startet ut2004 then i exited the game - it popped me back to the new X Server just showing me black screen with an X as mouse pointer (which is normal xserver i guess).

But now when i cheked ps -aux i noticed the following!

```

1000     29787  0.0  0.0   6768   812 pts/2    S    15:11   0:00 xinit /home/blacktiger/games/ut2004/System/ut2004-bin-linux-amd64 -- :1 -nolisten tcp -

root     29789  1.4  0.5  44956 10988 tty8     SLs+ 15:11   0:00 X :1 -nolisten tcp -br -deferglyphs 16

1000     29794 46.7  3.5 121192 74064 pts/2    Sl   15:11   0:11 /home/blacktiger/games/ut2004/System/ut2004-bin-linux-amd64

```

The game and server still runs but I can't see the game just showes me black xorg server ... weird I gues ^^"

Then I tried what u said and did an xlaunch xterm and everything worked fine - I exited the xterm and the new server was closed and also popped me back to my xgl server.

So might be a problem with ut2004 cause I tested Warsow and also worked fine .... so thanks for your great script! Keeps me staying to xgl  :Wink: 

Regards

BlackTiger

----------

## truc

I want to be sure, here is what I understand:

you do:

xlaunch -p /home/blacktiger/games/ut2004/System/ut2004-bin-linux-amd64

then, the game seems working, but all you see is a black screen with the X pointer

Can you try to run this in a terminal:

```
xinit /home/blacktiger/games/ut2004/System/ut2004-bin-linux-amd64 -- :1
```

and post back, especially if you have something interesting in the terminal:)

 *BlackTiger wrote:*   

> So might be a problem with ut2004 or a problem with the new -p function that don't need PATH?

 

I don't think it's a problem with the new -p option, but may be more a problem with the script itself or even a problem with your game, I really like to know what's happening, post back!  :Smile: 

EDIT: I've also tested with warsow (installed in my home) for the --path  :Wink: 

EDIT2: if you issue xlaunch xterm, and from there, you try to run your game, does it work?

----------

## BlackTiger

Well u misunderstood me a bit but I think i found out what's wrong - It's a problem of UT2004  :Wink: 

When I start the game with xlaunch -p ut2004-bin-linux-amd64 the game starts and works fine! When I close the game THEN the screen went black showing the normal X pointer!

But I guess that's a problem of ut itself - because when I launch UT in a normal terminal and close the game (via ut menu) it's still running in terminal - I have to do a Strg+C in Terminal to finally close the game! And that's whats keeping ut and the xserver alive I guess. I close the game but can't hit Strg+C after I am back to X to finally terminate the game - so X keeps alive!

Every other thing I tested f.e Warsow,Terminals .etc are working and closing fine

So your script works as it should and it's really great! Just UT isn't  :Rolling Eyes: 

Regards

BlackTigerLast edited by BlackTiger on Mon Jul 31, 2006 3:30 pm; edited 1 time in total

----------

## Dieter@be

 *BlackTiger wrote:*   

>  Just UT isn't 
> 
> 

 what about ctrl+alt+backspace? (or similar command?) it's a good way to get rid of the xserver instantly, i think (you could probably do this even while ut is still running :p)

----------

## BlackTiger

 *Dieter@be wrote:*   

>  *BlackTiger wrote:*    Just UT isn't 
> 
>  what about ctrl+alt+backspace? (or similar command?) it's a good way to get rid of the xserver instantly, i think (you could probably do this even while ut is still running :p)

 

Great this solution works and is really helpful especially for ut  :Rolling Eyes: 

Thanks to everyone!

----------

## truc

To BlackTiger I'm glad to see you finaly found what was going on, and found a 'good ' workaround. Is this a know issue with UT? may be you should report it? Anyway, you should be interested in the new version of the script, keep on reading:)

To stahlsau Did you read my comment on bugzilla.icculus, that's a litlle workaround for now, if you want to use multimedia keys (if you do have some)

To  everybody, I didn't get as much feedback as I expected.. Should I suppose, it's just 'working' (it does what we want it to, and that's all) ?   :Smile: 

Anyway, I've improved again the scripts so that we are now to version=20060801 (you can get it there  ), here are the good news:

* It was already possible to use xlaunch to create 'magic link' (xprogram ) if program appear in your PATH, so far so good, it's now also possible to create a link for a program which does *not* appear in it  :Smile: :

I'll take the example of BlackTiger(hope you don't mind   :Embarassed:  ) :

He's probably fed up to write  xlaunch -p /home/blacktiger/games/ut2004/System/ut2004-bin-linux-amd64 just to play.

He would certainly like a cool link, so that he just need to type xut2004-bin-linux-amd64 (fortunately it will be IN his path, and he will be able to use completion to type this awfull name!   :Laughing:  ).

```
xlaunch --addlink /home/blacktiger/games/ut2004/System/ut2004-bin-linux-amd64

Created link /home/scripts/ut2004-bin-linux-amd64 --> /home/blacktiger/games/ut2004/System/ut2004-bin-linux-amd64

Created link /home/scripts/xut2004-bin-linux-amd64 --> /home/scripts/xlaunch

```

or simply xlaunch --addlink games/ut2004/System/ut2004-bin-linux-amd64 if he is in his $HOME ,

As you can see, this will create two links, and since /home/scripts is in his PATH this will work, imagine now, he doesn't have write access on /home/scripts, then he can add the link that way:

```
xlaunch --addlink ~blacktiger/scripts /home/blacktiger/games/ut2004/System/ut2004-bin-linux-amd64
```

This will create those two links in /home/blacktiger/scripts. But in order to have the link xut2004-bin-linux-amd64 working, we need the link ut2004-bin-linux-amd64 to appear somewhere in the PATH, if it doesn't xlaunch will create the links, but will also warn that /home/blacktiger/scripts is not in the PATH, and that xut2004-bin-linux-amd64 won't work (ut2004-bin-linux-amd64 will but it won't use xlaunch, so what's the point?  :Smile:  )

* Modified the help message to reflect these changes

* Added a function create_link to clarify the script  :Smile: 

Hope you (will) like it. I'll be on holiday for now, but i will keep on eye on this thread to see if there's any problem/comment .

----------

## stahlsau

 *Quote:*   

> To stahlsau Did you read my comment on bugzilla.icculus, that's a litlle workaround for now, if you want to use multimedia keys (if you do have some)

 

I'll check this.

 *Quote:*   

> To everybody, I didn't get as much feedback as I expected.. Should I suppose, it's just 'working' (it does what we want it to, and that's all) ?  

 

Yep, that's how it is.

 *Quote:*   

> Hope you (will) like it. I'll be on holiday for now, but i will keep on eye on this thread to see if there's any problem/comment .

 

Happy vacation than  :Wink: 

----------

## Dieter@be

just an idea: let the user choose his own name for the link? so that you can xlaunch ut, if "ut" is the name that the user chooses for the link to /home/blacktiger/games/ut2004/System/ut2004-bin-linux-amd64

and happy holidays offcourse   :Cool: 

----------

## BlackTiger

 *Dieter@be wrote:*   

> just an idea: let the user choose his own name for the link? so that you can xlaunch ut, if "ut" is the name that the user chooses for the link to /home/blacktiger/games/ut2004/System/ut2004-bin-linux-amd64
> 
> 

 

Also like this idea because xut2004-bin-linux-amd64 is still much text to write  :Very Happy:  To choose an own command would be great so f.e just xut and game starts *yipie*  :Wink: 

I think many people are using your script and it just works as expected so no posts here   :Wink: 

I also look forward to see more improvments to this script! Keep up your great work and - Enjoy your holidays  :Razz: 

( And nah I don't mind if you use my example  :Mr. Green:  )

Regards

BlackTiger

----------

## Dieter@be

 *BlackTiger wrote:*   

> Also like this idea because xut2004-bin-linux-amd64 is still much text to write  To choose an own command would be great so f.e just xut and game starts *yipie* 
> 
> 

 

You don't have to type the whole thing, if i understand what truc said, you have auto-completion. but even then, "custom" names are cooler :p

----------

## truc

I think, I can easily add, these feature, but, it will be only for games that don't appear in your path.

 *Dieter@be wrote:*   

>  *BlackTiger wrote:*   Also like this idea because xut2004-bin-linux-amd64 is still much text to write  To choose an own command would be great so f.e just xut and game starts *yipie*   
> 
> You don't have to type the whole thing, if i understand what truc said, you have auto-completion. but even then, "custom" names are cooler :p

 

Actually you would have auto-completion, if it is enable in your shell (sure it is  :Smile:  ) and, since the link xut2004-bin-linux-amd64  should be created in a directory, which is in your PATH, then auto-completion will work. that's all.

Now, before I implement this, here is what you can do: (I still take you, BlackTiger, as an example  :Smile:  )

 *Quote:*   

> # first, I suggest you remove the two links previously created, assuming they are in /home/scripts:
> 
> rm /home/scripts/{,x}xut2004-bin-linux-amd64
> 
> # then, create, the link, with the name you want, I'll take ut
> ...

 

yeah:)

I like it too, (erm, I'm on windows right now, so can't test anything... )

----------

## BlackTiger

Well this is a way but it's not that good I think - It's nearly the same as if I create a link the normal way (with xlaunch) and then just rename the link created in my scripts folder ...

I prefer an other way which is used just when creating the link - like this ( taking my example  :Wink:  )

xlaunch -a ut /home/blacktiger/games/ut2004/System/ut2004-bin-linux-amd64

Where ut is the name of the link I want and after that the path where the executable is ( can also be other way round  :Razz:  )

This is bether than moving files or making links by hand  :Shocked:  - Just more work for you to change the script I guess ... What do you think?

( And yeah the tab way to complete the name .. totally forgot that   :Rolling Eyes:  )

Regards

BlackTiger

----------

## Dieter@be

 *BlackTiger wrote:*   

> 
> 
> This is bether than moving files or making links by hand  - Just more work for you to change the script I guess ... What do you think?
> 
> 

 

that's like the whole point of scripts, programs and other binaries.  we put effort in creating them so that later on they do efforts for us  :Smile: 

----------

## truc

 *truc wrote:*   

> 
> 
> Now, before I implement this, here is what you can do:
> 
> blahblahblah...
> ...

 

 :Wink:  (this means this was just a temporary workaround )

I almost already know how to achieve the wanted behaviour, but, I don't think it will be exactly as you said, because, when creating the link with xlaunch,  you can create several link in the same time, with:

```
xlaunch --addlink program1 progrma2 path/to/program3 program4 ...
```

So, how can I know if progrma2 is an application, the name of the link you wana create for path/to/program3, or even  an program name with a typo inside?   :Confused: 

here is how it should work, once implemented:

```
xlaunch --addlink program1 progrma2 path/to/program3 program4 ...
```

1) it will first search for program1 in your PATH, if it exits, it will create a link xprogram1 in the directory where xlaunch is. (or you'll have to specify the directory, as I explained a few posts before)

2) it will then search for progrma2 in your PATH, and, assuming there's a typo, it won't find it, wil warn you of this error, and continue with the next arguments:

3) since, there is at least one '/' in path/to/program3 , it will first test if you can execute it:

* if you don't have the right to execute it, it will inform you, then continuen with the next argument

* if yes -->if it's not already a full path (string beginning with '/' ), it will find the full path, then

it will ask you the name you would like to have for this argument. if an empty string is enter, then the default name (which is 'program3' for path/to/program3 will be used to create the links, otherwise it will use the string as the name of the link

If you choose a name which is already in use in this directory, ln will warn you, and won't create the new link, then, we have two possibilities, either the user is asked again for a new name, or, xlaunch can just skip this argument and go on to the next one, which one is to best? (I'm sure, you'll choose first one..)

Also, keep in mind, that if the user enter the name of an already existing program, which should also appear in the PATH, for example xterm argument. Then running xxterm (link created with xlaunch) will launch either  xterm on an other display,  or /full/path/to/program3, depending wether /usr/bin appears before, or after /home/scripts in the PATH variable

4) it will do the same than in 1) but for program4

5)...and so forth and so on if there are more arguments.

(when chosing the game name, you would have to chose the ut for your game, and then xut will be created automaticly)

Does it suit you? Any comments?

ok, now I'm going, see ya, may be tomorow  :Smile: 

----------

## arabis

I'm using XGL and this is the script I needed to run GoogleEarth, Blender and Doom3.

I tried:

```
$ xlaunch -p /opt/googleearth/googleearth
```

or

```
$ xlaunch gimp
```

But always I get a black screen and my system is hard locked

Ctrl-Alt-Suppr or Ctrl-Alt-F7 or Ctrl-Alt-backspace doesn't respond. I have to do a hard-shutdown.

----------

## truc

arabis, so,  it doesn't work with neither GoogleEarth, Blender nor Doom3  :Question: 

_ Does the program start normally, but it's only when you try to exit it, or to go back to your desktop that you have these hard locks? Or, is it as soon as you launch f.e. xlaunch -p /opt/googleearth/googleearth that you have these hard locks?

_ Do you have an nvidia video card or an ATI one? I think I've heard ATI users can't launch another Xserver  :Question:  but can't say for sure.

_ Can you try to run only xinit /opt/googleearth/googleearth -- :1 (or with any of your other program, or even a basic xinit /usr/bin/xterm -- :1 ) and tell me if it works? If it doesn't, then it has probably nothing to do with my script.

_ Looks like the same problem as here: X hardlocks when I switch x servers Could you try the work around I proposed ? Does it work (around..) ?

----------

## arabis

I just tried xlaunch with googleearth and gimp.

-These hard locks happen as soon as I launch (but just before I can see in Konsole that it uses the display 0): 

```
$ xlaunch -p /opt/googleearth/googleearth
```

-I have an ATI mobility X700

I tried

```
$ xinit /opt/googleearth/googleearth -- :1
```

and I get:

```
Fatal server error:

Server is already active for display 1

        If this server is no longer running, remove /tmp/.X1-lock

        and start again.
```

I tried also

```
$ xinit /usr/bin/gimp -- :93
```

and I get the hard lock again. So I guess your script is not the culprit.

-I tried your workaround to exit my hardlock but it doesn't work.

----------

## truc

I'm afraid it's your ATI card's fault..

I suppose 

```
 xinit /usr/bin/xterm -- :2
```

 also locks down your computer  :Sad: 

I'd like to help, but I can't do anything :/

EDIT: I found this and this, may be it can help   :Rolling Eyes: Last edited by truc on Thu Aug 03, 2006 3:56 pm; edited 1 time in total

----------

## arabis

 :Smile:  Thanks truc for your answer.

I found this:

http://ubuntuforums.org/showpost.php?p=1083678&postcount=25

I think it will do the job for an ATI card, but right now I am not on my Gentoo box.

I'll try this when I'll return home.

----------

## Condex

Hi there!

I've been testing the trick to run games, but got the same lock as arabis. Card is also a ATI x700 (Acer notebook).

I'm gonna test those links you gave to see if they work...

Condex   :Cool: 

----------

## Condex

I've tried Ubuntu Forum solution, so:

Changed: ServerCmd=/usr/bin/Xgl -br -ac -accel glx:pbuffer -accel xv:pbuffer

To: ServerCmd=/usr/bin/Xgl -br -ac -accel glx:pbuffer -accel xv:fbo -xorgAc

in /usr/kde/3.5/share/config/kdm/kdmrc

Start kdm, login and run:

$ openttd : (SDL game, windowed). Runs bad, problems with colors   :Cool: 

$ DISPLAY=:93 openttd : No problem with colors, runs fine.   :Cool: 

Now I'm emerging an OpenGL based game... tuxracer  :Cool: 

Edit:

-OpenTTD also runs ok in Fullscreen

- $ DISPLAY=:93 tuxracer runs perfect.

I think we got a solution  :Cool: 

----------

## truc

This looks interesting, and I have a few questions:

_ Does this mean, it's now to run possible to run properly an opengl app inside XGL? Or did I misunderstood:

_ Do you launch the game on the same DISPLAY where Xgl is?

_ If so, are you able to make use of the 'extra-keys' of your keyboard?

_ Why 93 in "DISPLAY=:93 ppracer", does XGL on DISPLAY 93? I know the Xorg.93.log, but don't really know anything else?

_ If it's not on the same on the same Display, then, is there a similar trick for 'normal' xorg ?

If it's on the same DISPLAY then, I don't see the point of using xlaunch, otherwise it may be possible to modify xlaunch so that it also works for ATI users  :Question:  a few more questions then:

Assuming the user is using only Xgl right now (since I don't know yet the answer of my previous questions  :Wink:  )

Is this correct:

If Xgl was started with the xorgAc the only thing needed to run 'program' is to launch it with 

```
DISPLAY=:93 program
```

else we need to launch it with 

```
LD_PRELOAD=/usr/lib/libGL.so.1.2 program
```

(but this last trick doesn't work so well, so warn the user of the other trick)

right  :Question: 

Thanks in advance.

----------

## Condex

I'll try to answer your questions, with my "little knowledge"...  :Cool: 

If you open a terminal (yakuake in this case) and type: $ps guax, you'll find, among other things this 2 lines:

```

root     10622  4.0  5.8  69748 60384 ?        SL   00:46   0:03 /usr/bin/Xgl -br -ac -accel glx:pbuffer -accel xv:fbo -xorgAc -nolisten tcp :0 vt7 -auth /var/run/xauth/A:0-QJQMWg

root     10623  2.1  0.8  16416  9032 tty7     SLs+ 00:46   0:02 /usr/bin/Xorg -br -ac vt7 -auth /tmp/.Xgl-auth-GKgB8a -nolisten tcp :93 -terminate

```

So:

XGL is running on :0, you launch the game on :93, then it's not running on XGL.

About "extra keys": I'm having problems to get them running on normal XGL (I think that it's a problem with XORG 7.1). Solved it (really crappy solution) on XGL, but I've not tested them on :93.

Why 93? It seems that Xorg is running on :93.

I remember trying :93 without -xorgAc and got a hardlock.

I've not used LD_PRELOAD=... to run the games I've tested, just run that DISPLAY=:93 program

Also, I've tested Enemy Territory @ 93 and it runs ok.

Well, I hope someone with more knowledge can expand this info  :Cool: 

Condex-

----------

## truc

thanks Condex for your answers.

That's funny since the guy (in the thread arabis mentionned above) said

 *jakster wrote:*   

> this DOES NOT start a new X server so it works on ati cards

 

But looking at your process(es?), I can see two xservers, one of them is Xgl, while the other is xorg  :Rolling Eyes:   :Question: 

Anyway, if you don't mind I'd had a few more questions:

_ Do you always(as soon as you start Xgl) have these two process 

```
root     10622  4.0  5.8  69748 60384 ?        SL   00:46   0:03 /usr/bin/Xgl -br -ac -accel glx:pbuffer -accel xv:fbo -xorgAc -nolisten tcp :0 vt7 -auth /var/run/xauth/A:0-QJQMWg

root     10623  2.1  0.8  16416  9032 tty7     SLs+ 00:46   0:02 /usr/bin/Xorg -br -ac vt7 -auth /tmp/.Xgl-auth-GKgB8a -nolisten tcp :93 -terminate
```

 Or is it just when you start a game(with DISPLAY=:93 game) ? 

I can see the -terminate option for Xorg: 

 *man xserver wrote:*   

> -terminate
> 
>     causes the server to terminate at server reset, instead of continuing to run

 but I just want to be sure I understand:

_ When you exit the game, is the xorg process still running? If so do you have something special to do to go back to your desktop ?

_ Can you switch from inside the game to your desktop? if so, how? ctrl-alt-f7 and ctrl-alt-f(93+7)  :Laughing: 

_ Are you using xbindkeys for your multimedia keys or somethings else?

Even if I don't own an ATI card, I suppose I'll can answer some of these questions once I'll get home, but, it's in approximately 2 weeks, and I'm just curious  :Smile: 

thanks again;)Last edited by truc on Wed Aug 09, 2006 8:49 am; edited 1 time in total

----------

## arabis

Hi!

Here some clues:

first from http://gentoo-wiki.com/HOWTO_XGL/Tips_and_Tricks#Running_apps_that_require_3D_rendering_acceleration_.28games.2C_etc..29

 *Quote:*   

> But.. Remember that at this time Xgl runs on another Xorg server (that usually is :93, but can be another too...) So you can safetly start applications on :93, when they're not supported by Xgl. Just remember three things:
> 
>    1. Start Xgl with the -xorgAc parameter. This will allow network access (but also remember that this can be unsafe in a non-local network) 

 

Second my pstree:

```
eric@ferrari ~ $ pstree

init─┬─acpid

     ├─6*[agetty]

     ├─cgwd

     ├─compiz

     ├─cpufreqd

     ├─cron

     ├─cupsd

     ├─6*[dbus-daemon]

     ├─dbus-launch

     ├─dcopserver

     ├─dhcpcd

     ├─events/0

     ├─gconfd-2

     ├─gdm───gdm─┬─Xgl───Xorg

     │           └─startkde─┬─kwrapper

     │                      └─ssh-agent

     ├─hald───hald-runner─┬─hald-addon-acpi

     │                    ├─hald-addon-keyb

     │                    └─hald-addon-stor

     ├─ifplugd

     ├─ivman

     ├─kaccess

     ├─kded

     ├─kdeinit─┬─artsd

     │         ├─kio_file

     │         ├─klauncher

     │         ├─konsole───bash───pstree

     │         ├─mozilla-launche───firefox-bin───3*[{firefox-bin}]

     │         ├─superkaramba

     │         └─xmms───2*[{xmms}]

     ├─kdesktop

     ├─khelper

     ├─khpsbpkt

     ├─kicker

     ├─kmix

     ├─knodemgrd_0

     ├─knotify

     ├─ksmserver

     ├─ksoftirqd/0

     ├─kswapd0

     ├─kthread─┬─aio/0

     │         ├─kacpid

     │         ├─kblockd/0

     │         ├─kcryptd/0

     │         ├─khubd

     │         ├─kpsmoused

     │         ├─kseriod

     │         ├─ondemand

     │         ├─2*[pdflush]

     │         └─reiserfs/0

     ├─oooqs2─┬─ksysguardd

     │        └─soffice───soffice.bin───3*[{soffice.bin}]

     ├─slmodemd

     ├─syndock───syndaemon

     ├─syslog-ng

     └─udevd

```

So This means (correct me if I'm wrong) that Xgl runs on top of Xorg. Starting Xgl with the -xorgAc parameter makes you able to start apps on the Xorg running underneat Xgl. 

If you look in your /var/log/, you will notice that, as an xgl user,  you don't use Xorg.0.log but something like Xorg.93.log or Xorg.94.log (look at your modified time of the file of Xorg.0.log). I use myself Xorg.94.log but I don't know why it's not rather Xorg.93.log.

So I use

```
DISPLAY=:94 googleearth 
```

and it works very well. Ppracer works very well also using this tip. But I get a segfault with doom3-demo. Right now, I don't use a window manager with this, but by if I quit, for example, Googleearth, I just return to my desktop.

----------

## truc

So inside XGL, in a term, 

```
echo $DISPLAY
```

 will give you 0 while if you run

```
DISPLAY=:94 xterm
```

 and then inside this term you run the same command it would give you 94 right?

When you're 'inside' googleearth, is it fullscreen? Can you go back to your desktop without 'quitting' googleearth ? If so how?

----------

## arabis

 *truc wrote:*   

> So inside XGL, in a term, 
> 
> ```
> echo $DISPLAY
> ```
> ...

 

It gives ":1.0"

 *Quote:*   

> while if you run
> 
> ```
> DISPLAY=:94 xterm
> ```
> ...

 

Yes: ":94.0"

 *Quote:*   

> When you're 'inside' googleearth, is it fullscreen? Can you go back to your desktop without 'quitting' googleearth ? If so how?

 

Googleearth appears in a window over the desktop. If, previously, by starting Googleearth in Xgl, I set my window size to something smaller than my screen, I will see some part of my Xgl desktop underneat. But I can not bring a window started with xgl in front of the window started with DISPLAY:94.

----------

## truc

 *BlackTiger wrote:*   

>  *Dieter@be wrote:*   just an idea: let the user choose his own name for the link? so that you can xlaunch ut, if "ut" is the name that the user chooses for the link to /home/blacktiger/games/ut2004/System/ut2004-bin-linux-amd64
> 
>  
> 
> Also like this idea because xut2004-bin-linux-amd64 is still much text to write  To choose an own command would be great so f.e just xut and game starts *yipie* 

 

Hi again:)

As suggested, you can now with version=20060808 of xlaunch (grab it  here ) , you can now chose the name you want xlaunch to use when creating links for a program that doesn't appear in your PATH

(actually, you can even chose a name for a program that does appear in your path, to achieve this you just need to give the (full|relative)path to the program as an argument to xlaunch when creating links, for example:

```
xlaunch --addlink ~/scripts /usr/bin/xterm

We are now going to create 2 links for /usr/bin/xterm, the first will be :

/home/truc/scripts/xterm --> /usr/bin/xterm

And the second will be:

/home/truc/scripts/xxterm --> /home/scripts/xlaunch

But you can change 'xterm' to be whatever you want, just enter the name

you would like to use to launch your program (/usr/bin/xterm ).

Leave blank to use default one

blahblah

Created link /home/truc/scripts/blahblah --> /usr/bin/xterm

Created link /home/truc/scripts/xblahblah --> /home/scripts/xlaunch

```

then running xblahblah will be the same as running  xlaunch xterm

Well, that's not the point here... And that may look a bit useless.. 

anyway..hum..

Back to our good'ol example: BlackTiger  :Smile: 

all you need to do now is, 

```
xlaunch --addlink /home/blacktiger/games/ut2004/System/ut2004-bin-linux-amd64
```

And then chose a decent name (ut  :Wink:  ) and you're done  :Smile: 

or xlaunch --addlink path/to/writable/directory /home/blacktiger/games/ut2004/System/ut2004-bin-linux-amd64 if you don't have write permission on the directory where xlaunch is stored. (I'm sure you do have it, but eh.. that's an example.. :Smile:  )

If you find something wrong, please tell me!

======

And for  ATI users, I'm not sure what to do, it should  work now for you with the latest ATI driver, but it seems it doesn't work for everybody. I'm a bit lost, I'll try to look all this more deeply later.

----------

## katanagari

hi

thanks for the script truc, it works great for me!   :Very Happy: 

I have a suggestion: Running a fullscreen app (ie. stepmania) in a dual monitor machine,  the image appears between the two screens. I think it'd be great if xlaunch disables xinerama when it's enabled or, even better, place the window on the correct position.

I tried adding "-xinerama" to the X server's parameters but it appears the following message after a time:

```

xplayer@frankie$ ./xlaunch stepmania

xauth:  timeout in locking authority file /root/.xauthlsm8Kq

```

However, after pressing Ctrl+C, it works.   :Confused:  Is there a better way to do what I want?

By the way, English is not my first language (as you can read)   :Razz:  so if you can't understand me, please ask.   :Rolling Eyes: 

----------

## CoffeeBuzz

I've added this to the xgl-coffee overlay under x11-misc/xlaunch 

Its keyworded -*

Use at your own risk!

----------

## truc

 *katanagari wrote:*   

> thanks for the script truc, it works great for me!  
> 
> I have a suggestion: Running a fullscreen app (ie. stepmania) in a dual monitor machine,  the image appears between the two screens. I think it'd be great if xlaunch disables xinerama when it's enabled or, even better, place the window on the correct position.
> 
> I tried adding "-xinerama" to the X server's parameters but it appears the following message after a time:
> ...

 

Hi, thanks for the suggestion:) , I didn't even think about xinerama users.

Since I don't know xinerama very well, I'd have some questions about.

But first some questions on how you "start X":

Are you using xdm (or one of its friend) or do you issue startx  :Question: 

I don't know yet exactly how xdm & Cie work, but I'd like to understand this:

 *code wrote:*   

> 
> 
> xplayer@frankie$ ./xlaunch stepmania
> 
> xauth:  timeout in locking authority file /root/.xauthlsm8Kq
> ...

 

It should be /home/your_name/  shouldn't it be?

Note : it looks like you're trying to use the XPLAYER feature, for your information, you don't need to su to xplayer  before running ./xlaunch stepmania: run it as your normal user ( katanagari ? ), xlaunch will use sudo to launch it as $XPLAYER (see III) d) Using XPLAYER ) 

There's an option for xauth to bypass 'Xauthority lock'. but I'd like to know how you 'start x' 

if you're not using a login manager (xdm, kdm and so on), do you log in as root then su to katanagari, or do you log in directly as katanagari  :Question: 

In both case, once you're katanagari, can you post the result of :

```
echo "$HOME --- $XAUTHORITY"
```

and 

```
 ps aux | grep -i x
```

and also:

```
 ps aux | grep -i dm
```

And for xinerama:How do you disable xinerama?

Assuming I disabled it, on which display/screen()? the application is now supposed to run on?

EDIT: if we don't disable xinerama, I think it's possible to chose to display weither on screen 0 (eg: DISPLAY:1.0) or on the second screen 1 with DISPLAY=:1.1 ) (or the third screen and so on..)

This needs a little thinking. 

I will probably have other questions. but that's enough for now

 *katanagari wrote:*   

> However, after pressing Ctrl+C, it works.   Is there a better way to do what I want?

 

could you also give me the results of:

```
ls -l $HOME/.Xauthority

# and 

xauth list
```

I would be glad if you answered as many questions as you can, thanks again  :Smile: 

@CoffeBuzz

Thanks, but for latter versions I suppose I can just pm you?

----------

## katanagari

I'm here again! (I wasn't at home this time)   :Embarassed: 

I see you have a lot of questions... well, I'll try to help you as much as I can  :Wink: 

 *Quote:*   

> Are you using xdm (or one of its friend) or do you issue startx

 

I use gdm (as a good gnome user)   :Rolling Eyes: 

 *Quote:*   

> It should be /home/your_name/ shouldn't it be? 

 

Yea.... this happened because I logged to xplayer from root.   :Embarassed:  Running xlaunch from my normal account (yes, it's katanagari) doesn't appear that. 

 *Quote:*   

> In both case, once you're katanagari, can you post the result of :
> 
> ```
> 
> echo "$HOME --- $XAUTHORITY"
> ...

 

OK. Nothing strange here:

```

katanagari@frankie ~ $ echo "$HOME --- $XAUTHORITY"

/home/katanagari --- /home/katanagari/.Xauthority

```

 *Quote:*   

>  and
> 
> ```
> ps aux | grep -i x 
> ```
> ...

 

I'll only show the interesting processes:

```
katanagari@frankie ~ $ ps axu | grep -i x

root      9351  2.1  8.4  95348 87392 ?        SL   01:41   0:01 /usr/bin/Xgl :1 -br -ac -accel glx:pbuffer -accel xv -auth /var/gdm/:1.Xauth -nolisten tcp vt7

root      9352  1.8  1.3  17764 13996 tty7     SLs+ 01:41   0:00 /usr/bin/Xorg -br vt7 -auth /tmp/.Xgl-auth-cisLiu -nolisten tcp :94 -terminate

```

 *Quote:*   

>  and
> 
> ```
> ps aux | grep -i dm 
> ```
> ...

 

```
katanagari@frankie ~ $ ps axu | grep -i dm

root      9346  0.0  0.1   9900  1708 ?        Ss   01:41   0:00 /usr/bin/gdm

root      9347  0.0  0.2  10436  2404 ?        S    01:41   0:00 /usr/bin/gdm

root      9351  1.7  9.3 104988 96840 ?        SL   01:41   0:01 /usr/bin/Xgl :1 -br -ac -accel glx:pbuffer -accel xv -auth /var/gdm/:1.Xauth -nolisten tcp vt7
```

As you can see, I'm using Xgl and Xorg 7.0. About Xgl's parameters, I followed the Gentoo Wiki's XGL Howto.

 *Quote:*   

>  How do you disable xinerama? 

 

I disabled it just adding "-xinerama" to the new X server's params.

 *Quote:*   

> if we don't disable xinerama, I think it's possible to chose to display weither on screen 0 (eg: DISPLAY:1.0) or on the second screen 1 with DISPLAY=:1.1 ) (or the third screen and so on..) 

 

It seems that X doesn't work this way. I tried launching "DISPLAY=:1.0 xterm" and opens a xterm window, but when I launch "DISPLAY=:1.1 xterm" appears the following message:

```
xterm Xt error: Can't open display: :1.1
```

Maybe if I disable xinerama, I can use "DISPLAY=:1.0" or "DISPLAY=:1.1" to select which Screen to use.

 *Quote:*   

> 
> 
> could you also give me the results of: 
> 
> ```
> ...

 

The results:

```

katanagari@frankie ~ $ ls -l /home/katanagari/.Xauthority

-rw------- 1 katanagari katanagari 170 Aug 20 01:42 /home/katanagari/.Xauthority

katanagari@frankie ~ $ xauth list

frankie/unix:0  MIT-MAGIC-COOKIE-1  12a23568ccf6d34d3e35481a64724a94

frankie/unix:1  MIT-MAGIC-COOKIE-1  f2548fb5c5f9f34eeadfa863c3404c7c

localhost.localdomain/unix:1  MIT-MAGIC-COOKIE-1  f2548fb5c5f9f34eeadfa863c3404c7c

```

----------

## truc

thanks!

To be sure I understood you correctly:

now, when launching xlaunch as katanagari, you no longer have the "timout in locking authority" right?

And if you add -xinerama the serverargs, then it kinda works, but you can't choose on which screen you want stepamania to run on, right?

assming you've just started stepania with xlaunch, and with the -xineram option, the game now runs on only one screen? (no longer in the middle of nowhere, :/ )

question: what do you have on the others screen? your desktop? a black screen? ;.

I think I can add the -xinerama option  as a default server option, what do you think?

----------

## katanagari

 *truc wrote:*   

> 
> 
> now, when launching xlaunch as katanagari, you no longer have the "timout in locking authority" right?
> 
> 

 

right  :Smile: 

 *truc wrote:*   

> 
> 
> And if you add -xinerama the serverargs, then it kinda works, but you can't choose on which screen you want stepamania to run on, right?
> 
> assming you've just started stepania with xlaunch, and with the -xineram option, the game now runs on only one screen? (no longer in the middle of nowhere, :/ )
> ...

 

Yea, all of that was right  :Smile:  The game appears on the first monitor.

 *truc wrote:*   

> 
> 
> question: what do you have on the others screen? your desktop? a black screen? ;.
> 
> 

 

On the other monitor. the screen turns black.. moreover, the "No signal" dialog appears, so the monitor gets disconnected.

Edit: I noticed that the second screen disconnects only if the app is running in fullscreen mode. However, running a non fullscreen app (ie. xterm), both screens works as usual.   :Confused: 

 *truc wrote:*   

> I think I can add the -xinerama option  as a default server option, what do you think?

 

I don't know if this option affects single screen users in some way. If not, I suppose that it'd be OK.

Edit (again): Now It would be cool if we can choose which screen to use... I have to investigate about that (any recommended doc but xorg's manpages?)   :Rolling Eyes: Last edited by katanagari on Mon Aug 21, 2006 3:42 pm; edited 2 times in total

----------

## nnd

Hello, truc!

Thank you for you program. Unfortunately I have some problems...

After doing:

```
$xlaunch --addlink /home/nnd/ut2004/System/ut2004-bin-linux-amd64

$xut
```

I have:

```
Starting /home/nnd/scripts/ut on DISPLAY 1

xrdb: Connection refused

xrdb: Can't open display ':1'

xmodmap:  unable to open display ':1'

```

Could you please help me?

----------

## truc

nnd

as usual a few questions:Does xlaunch /home/nnd/ut2004/System/ut2004-bin-linux-amd64 works ? (launch UT on an other display)

```
Starting /home/nnd/scripts/ut on DISPLAY 1

xrdb: Connection refused

xrdb: Can't open display ':1'

xmodmap:  unable to open display ':1' 
```

Looks like no new Xserver is started   :Confused: 

Is there anything interesting in /var/log/Xorg.1.log ?

can you post the output of 

```
ls -l /home/nnd/scripts | grep ut
```

----------

## nnd

truc,

xlaunch /home/nnd/ut2004/System/ut2004-bin-linux-amd64 has the same output:

```
Starting /home/nnd/ut2004/System/ut2004-bin-linux-amd64 on DISPLAY 1

xrdb: Connection refused

xrdb: Can't open display ':1'

xmodmap:  unable to open display ':1'

```

I haven't noticed any errors in /var/log/Xorg.1.log

```
> ls -l /home/nnd/scripts | grep ut

lrwxrwxrwx 1 nnd users    51 2006-08-21 18:24 ut -> /home/nnd/ut2004/System/ut2004-bin-linux-amd64

lrwxrwxrwx 1 nnd users    30 2006-08-21 18:24 xut -> /home/nnd/scripts/xlaunch
```

----------

## truc

@katanagari *katanagari wrote:*   

>  *truc wrote:*   question: what do you have on the others screen? your desktop? a black screen? ;.
> 
>  On the other monitor. the screen turns black.. moreover, the "No signal" dialog appears, so the monitor gets disconnected.
> 
> Edit: I noticed that the second screen disconnects only if the app is running in fullscreen mode. However, running a non fullscreen app (ie. xterm), both screens works as usual.   

 My point, with this script, was also to have my multimedia keys working inside a fullscreen game. If you remember, in III) c) Making your multimedia keys working , I said since you don't start any window manager on this new DISPLAY, you can put set your game not to be fullscreen (window mode) and it'll look like it's fullscreen.

I suppose you can do the same, and then you won't have anymore your other screen turning off  :Question:  (and you'll also have your fun keys working  :Smile:  )

 *katanagari wrote:*   

>  *truc wrote:*   I think I can add the -xinerama option  as a default server option, what do you think? 
> 
> I don't know if this option affects single screen users in some way. If not, I suppose that it'd be OK.

 I tried adding -xinerama to my default server arguments, and I didn't notice any differences. So I think I will keep it inside for the next release (unless someone tells me why I shouldn't )

 *katanagari wrote:*   

> Edit (again): Now It would be cool if we can choose which screen to use... I have to investigate about that (any recommended doc but xorg's manpages?)  

 That would be great! But I have no good doc in mind right now

@nndDo you have any specific configuration I should be aware of?

How do you 'startx' , with the good'ol startx command, or with a Display manager like xdm, gdm, kdm (...) ?

Does 

```
xinit /home/nnd/ut2004/System/ut2004-bin-linux-amd64 -- :1
```

 work?

(assuming DISPLAY=:1 is free, if it's not, try with :2 and so on..)

If it doesn't can you copy and paste the output?(run it in a terminal..)

Can you also give the output of 

```
xauth list
```

thanks  :Smile: 

----------

## nnd

trac,

I'm using no specific configuration, just starting X with kdm.

```
xinit /home/nnd/ut2004/System/ut2004-bin-linux-amd64 -- :1
```

X starts, but then it's terminates because of:

```
/home/nnd/ut2004/System/ut2004-bin-linux-amd64: error while loading shared libraries: ./libSDL-1.2.so.0: cannot open shared object file: No such file or directory
```

The same output is with other displays(:2, :3, etc)

This file is in my ut2004/System dir, I know I have to determine some variable... could you please help me to remember which?

```
>xauth list

nnd.progtech.ru:0  MIT-MAGIC-COOKIE-1  b2960394f22ac4f568d0cc98753b059f

[fe80::204:61ff:fea1:70d]:0  MIT-MAGIC-COOKIE-1  b2960394f22ac4f568d0cc98753b059f

nnd/unix:0  MIT-MAGIC-COOKIE-1  1a9117aa7650d2119eb1e70c5a25d487

linux/unix:0  MIT-MAGIC-COOKIE-1  b2960394f22ac4f568d0cc98753b059f

linux/unix:1  MIT-MAGIC-COOKIE-1  286b215351239c996efc436d83de1d2f
```

----------

## truc

 *nnd wrote:*   

> 
> 
> ```
> /home/nnd/ut2004/System/ut2004-bin-linux-amd64: error while loading shared libraries: ./libSDL-1.2.so.0: cannot open shared object file: No such file or directory
> ```
> ...

 

Does 

```
/home/nnd/ut2004/System/ut2004-bin-linux-amd64
```

 works then? It looks like it doesn't, and it would explain why you don't have any X error.

----------

## nnd

truc,

Sorry, it was a stupid question... solved it with ln -s /usr/lib64/libSDL-1.2.so.0 ~/ut2004/System/libSDL-1.2.so.0

But now i have the following issue:

I run ut with the xut îê xlaunch /home/nnd/ut2004/System/ut2004-bin-linux-amd64 command.

It opens me a window in the _same_ tty whith the Xglx heading, shows splash and dies with the same output:

```
Starting /home/nderkach/ut2004/System/ut2004-bin-linux-amd64 on DISPLAY 3

xrdb: Connection refused

xrdb: Can't open display ':{1,2,3, etc}'

```

Err, I think I know that is the problem... I tried to run all commands you suggested with sudo, it started ut on the other display but with bad textures(it look like if I start it in Xgl).

So the problem is that my user has no permissions to start X. How to solve it?

----------

## CoffeeBuzz

 *truc wrote:*   

> 
> 
> @CoffeBuzz
> 
> Thanks, but for latter versions I suppose I can just pm you?

 

Certainly. A PM would be fine, either on this forum or http://forums.xgl-coffee.org/

I try to check back here from time to time but I'm fairly busy these days. Thanks for the work on this script. The ebuild I whipped up is fairly basic, not sure if you've used it but if you have and think something should be changed in the way the package is installed, let me know as well.

----------

## truc

I will ask again the same questions, does 

```
/home/nnd/ut2004/System/ut2004-bin-linux-amd64
```

 works now?

if it works, thendoes 

```
xinit /home/nnd/ut2004/System/ut2004-bin-linux-amd64 -- :1
```

 works ?

if it doesn't then

does

```
xinit -- :1
```

 works?fifi

And

 *truc wrote:*   

> How do you 'startx' , with the good'ol startx command, or with a Display manager like xdm, gdm, kdm (...) ?

 

thank you  :Smile: 

----------

## truc

 *nnd wrote:*   

> truc.
> 
> You really do not understand me? 
> 
> I said I can run all these commands but from root(sudo) because my user do not have permissions to run X and I don't want give them 
> ...

 

 :Embarassed:  I really didn't..

EDIT: oh, looks like you deleted your post   :Confused: 

Well, I'd still like to know how to you startx ? do you use the root user to startx? or are you using a display manager?

So your user does not have permissions to run X:(IMO that's a specific configuration I'd like to be aware of), what does this exaclty mean? 

```
groups your_user
```

which groups does it belong to?

AFAIK your user doesn't have to be in the video group to be able to startx. So what did you do exactly?

And all this probably explains your ~/Xauthority file (lot of entry).

May I ask why you want such a behaviour?

And to answer to your main question, it's probably possible to play with xauth, have a look here

----------

## nnd

truc,

Do you live at this forum?  :Wink:  I've deleted my message within 1 minute  :Smile: 

So,

As I've said before I'm using kdm to start X.

My user belons to these groups: users dialout video.

I can't start ut2004-bin-linux-amd64 directly because of shared libraries it needs, in my script ut2004 is started by the following commands:

```
cd ~/ut2004/System

./ut2004-bin-linux-amd64 &
```

I can't understand does you script need to be executed by root? Or does the user have to have permissions to start X?

------------------

Just remebered, I have such a configuration of kdm so it runs Xgl, not Xorg by default! Do you know how to overcome this issue?

Thank you!

----------

## truc

 *nnd wrote:*   

> truc,
> 
> Do you live at this forum?  I've deleted my message within 1 minute 
> 
> 

 

Yes I do  :Laughing: 

I'm at work, and have some 'extra' time today  :Smile: 

 *Quote:*   

> I can't understand does you script need to be executed by root?

 

No, not at all.

 *Quote:*   

> Or does the user have to have permissions to start X?

 

The user should only be able to use xinit

From what you said your user can run

```
xinit -- :1
```

  :Question:  (it should at the very least open an xterm on an other display, it can also start a wm if you(the user) have ~/.xinitrc ).

that's really strange since your groups looks ok to me   :Confused: 

 *Quote:*   

> Just remebered, I have such a configuration of kdm so it runs Xgl, not Xorg by default! Do you know how to overcome this issue?

 

It shouldn't be an issue, gentoo-wiki is down, but will look how you did modify kdm ASAP.

----------

## nnd

truc,

```
> xinit -- :1

Couldn't open log file '/var/log/Xgl.1.log' for writing: Permission denied

```

It runs X(and xterm in it), but in window(with the Xglx heading) and on the same tty.

In xterm, in this window:

```
>echo $DISPLAY

:1.0
```

----------

## truc

 *Quote:*   

> It runs X(and xterm in it), but in window(with the Xglx heading) and on the same tty

 ok, so a work around can be to unset the DISPLAY (just for this command) this way:

```
DISPLAY="" xinit -- :1
```

it should start an Xserver outside your Xgl one

EDIT: tell me if it works, than I can implement this behaviour in next release:)

and, If I'm still here, that's because I've just edited my previous post   :Laughing: 

----------

## nnd

It works! 

/me is waiting for the next release  :Smile: 

Thank you.

----------

## truc

 *nnd wrote:*   

> It works! 
> 
> /me is waiting for the next release 
> 
> Thank you.

 

Well, I made a really minor release (20060822) then, grab it here (as usual)

I just added the "-xineram" to serverargs and the DISPLAY="" so that there is no longer the problem nnd had.

If it already works now, there is no need to upgrade  :Smile: 

----------

## nnd

hello, truc

Unfortunately now I have another trouble...

```
cd ~/ut2004/System
```

 // for shared libraries to load

Then I did the following:

```
xlaunch ./ut2004-bin-linux-amd64 
```

and also tried:

```
DISPLAY="" xinit ./ut2004-bin-linux-amd64  -- :1
```

The result was the same. It runs on the other tty(dsplay) but on Xgl! (I almost sure)

I consider the reason is in my kdm configuration (as I said before kdm startx Xgl by default).

So we need either not to use kdm(e.g. use startx) or "tell" kdm not to run Xgl for this session(e.g. just fix its conf for the session using sed). I prefer the filrst way. Do you know how to do this?

Thanks.

----------

## truc

 *nnd wrote:*   

> hello, truc
> 
> Unfortunately now I have another trouble...

 

"now": Do you mean with the version 20060822?

 *Quote:*   

> 
> 
> ```
> cd ~/ut2004/System
> ```
> ...

 

If I understand correctly, this means that if you want to play UT, (wihtout xlaunch for the moment) you have to go into that directory before, you run ./ut2004-bin-linux-amd64   :Question: 

And if you don't, the game complains about missing shared librairies, right?

If I'm right, then 

```
xlaunch ./ut2004-bin-linux-amd64 
```

won't be enough.

You also need to know, how xinit handle options

```

                clientargs                                   serverargs

       --------------^---------------{separator}--------^----------

xinit  blablabla bliblo qsdfqqlmkj          --                :1
```

This means: if clientargs first character isn't a '/' (it's not a full path), then clientargs is considered to be options for xterm. (eg: you can try xinit -bg black -fg limegreen -- :1 will launch  xterm -bg black -fg limegreen on an other display.

But if clientargs first character is a '/', then it's considered to be the the full path to the application to run on the other display.

The good news is that your shell will expand ./ut2004-bin-linux-amd64  to /home/nnd/something/ut2004-bin-linux-amd64  (pathname expansion), but it wouldn't work if you run xinit relative/path/to/ut2004-bin-linux-amd64 -- :1

 *Quote:*   

> and also tried:
> 
> ```
> DISPLAY="" xinit ./ut2004-bin-linux-amd64  -- :1
> ```
> ...

 

The same, do you mean, bad color? or in a window on your actual desktop? I can't test righ now (still at work..), but it should start an UT, on an other Display, but I don't think your previous cd ~/ut2004/System has any effect (do you have any complaints about missing shared librairies on the terminal from where you run this command ?

if you need the cd step before launching the game, then you can create a small script do do that for you, take script I gave in IV a) wine  for warcraft3, 

put something like

```
#!/bin/sh

cd /home/nnd/ut2004/System

./ut2004-bin-linux-amd64

exit $?
```

chmod it and then try

```
DISPLAY="" xinit /full/path/to/your_UT_script -- :1
```

(chose the number :1 if there is no /var/tmp/.X1-lock, but if there is one, and no ]/var/tmp/.X2-lock, then use number 2 instead (and so on)

If it still start the game inside XGL, then log into the console (CTRL+ALT+F1-6) and try to run:

```
xinit /full/path/to/your_UT_script -- :1
```

 is it better?

 *Quote:*   

> I consider the reason is in my kdm configuration (as I said before kdm startx Xgl by default).

 

But we are not using kdm when using xinit. May be there's an option for the Xgl server (but I can access randomly the wiki at work and still don't know them (the options) :/)

 *Quote:*   

> So we need either not to use kdm(e.g. use startx) or "tell" kdm not to run Xgl for this session(e.g. just fix its conf for the session using sed). I prefer the filrst way. Do you know how to do this?

 

same comment as above, I don't think it's necessary. But I'll try to see later (in the wiki).

 *Quote:*   

> Thanks

 

Thanks to you too, we will success!  :Smile: 

----------

## nnd

 *Quote:*   

> "now": Do you mean with the version 20060822?

 

Yes, I do.

 *Quote:*   

> If I understand correctly, this means that if you want to play UT, (wihtout xlaunch for the moment) you have to go into that directory before, you run ./ut2004-bin-linux-amd64  
> 
> And if you don't, the game complains about missing shared librairies, right?

 

Correctly.

 *Quote:*   

> put something like your ut script:
> 
> #!/bin/sh 
> 
> cd /home/nnd/ut2004/System 
> ...

 

The same result, it runs on Xgl

 *Quote:*   

> If it still start the game inside XGL, then log into the console (CTRL+ALT+F1-6) and try to run:Code:
> 
> xinit /full/path/to/your_UT_script -- :1
> 
> is it better?

 

No, it isn't  :Sad: 

 *Quote:*   

> The same, do you mean, bad color? or in a window on your actual desktop?

 

You didn't unserstand me. Ok, I'll try to explain:

Now, ut2004 runs on the sepatate tty(display), ir really runs and with no errors. But it has bad textures, colors, etc

I saw such screenshots in Novell's Bugzilla(they were done with Xgl running). That's why I think in my case ut2004 runs on Xgl.

This is one of them: https://bugzilla.novell.com/attachment.cgi?id=74328&action=view

----------

## truc

 *nnd wrote:*   

> You didn't unserstand me. Ok, I'll try to explain:
> 
> Now, ut2004 runs on the sepatate tty(display), ir really runs and with no errors. But it has bad textures, colors, etc
> 
> I saw such screenshots in Novell's Bugzilla(they were done with Xgl running). That's why I think in my case ut2004 runs on Xgl.
> ...

 

That's easy to see, once your game is running on the other display, come back to your desktop (CTRL+ALT+F7 ?), then in an terminal, run

```
ps aux
```

and post back the result.

----------

## nnd

Of course, I've already done it. It's really running on Xgl.

```
> cat ~/bin/ut_test

#!/bin/sh

cd /home/nnd/ut2004/System

./ut2004-bin-linux-amd64

exit $?
```

```
>DISPLAY="" xinit /home/nnd/bin/ut_test -- :1      

>ps aux | grep X

root      2999  4.3 10.5 139672 108108 ?       SL   12:49   7:06 /usr/X11R6/bin/X -br -nolisten tcp :0 vt7 -auth /var/lib/xdm/authdir/authfiles/A:0-sCvkJY

root      3334  0.1  1.3  52516 13408 tty7     SLs+ 12:49   0:14 /usr/X11R6/bin/Xorg -br vt7 -auth /tmp/.Xgl-auth-OJMYSY -nolisten tcp :93 -terminate

nnd  3470  0.0  0.1   9368  1680 ?        Ss   12:49   0:00 /bin/sh /usr/X11R6/bin/kde

nnd 3513  0.0  0.0  22244   620 ?        Ss   12:49   0:00 ssh-agent /bin/bash /etc/X11/xinit/xinitrc

nnd  3517  0.0  0.0   9064   676 ?        S    12:49   0:00 /usr/bin/dbus-launch --sh-syntax --exit-with-session /usr/X11R6/bin/kde

nnd  2095 49.6 10.4 144336 107916 pts/2   RL   15:33   0:29 X :1

root      2097  3.5  1.2  52108 12988 tty8     SLs+ 15:33   0:02 /usr/X11R6/bin/Xorg -auth /tmp/.Xgl-auth-CmsqgZ -nolisten tcp :94 -terminate

```

I noticed to lines added:

```

nnd  2095 49.6 10.4 144336 107916 pts/2   RL   15:33   0:29 X :1

root      2097  3.5  1.2  52108 12988 tty8     SLs+ 15:33   0:02 /usr/X11R6/bin/Xorg -auth /tmp/.Xgl-auth-CmsqgZ -nolisten tcp :94 -terminate
```

Do you see see the second? No doubt, it's Xgl.

----------

## truc

 *nnd wrote:*   

> I do not use gentoo on this computer. Does it really matter?

 

No it doesn't, and it explains lot of things:) It looks like Suze and gentoo doesn't work the same way when it comes to Xgl

```
root      2766  0.0  0.0  11200   908 ?        S    20:21   0:00 /opt/kde3/bin/kdm

root      2843  3.0  8.9 128848 92224 ?        SL   20:21   0:50  \_ /usr/X11R6/bin/X -br -nolisten tcp :0 vt7 -auth /var/lib/xdm/authdir/authfiles/A:0-UnSes1

root      3224  0.1  1.2  52432 13332 tty7     SLs+ 20:21   0:03  |   \_ /usr/X11R6/bin/Xorg -br vt7 -auth /tmp/.Xgl-auth-RemV3N -nolisten tcp :93 -terminate

```

So you said X (usr/X11R6/bin/X) is Xgl, That's why I  asked you (by pm) to give me the result of ls -l /usr/bin/X* (Note /usr/X11R6 is usually a link to /usr)

Here is what I get on gentoo:

```
lrwxrwxrwx 1 root root       4 jun 30 19:34 /usr/bin/X -> Xorg

-rwxr-xr-x 1 root root 1680988 jun 30 19:34 /usr/bin/Xdmx

-rwxr-xr-x 1 root root 1356984 jui 27 22:09 /usr/bin/Xgl

-rwxr-xr-x 1 root root 3480452 jun 30 19:34 /usr/bin/Xnest

-rws--x--x 1 root root 1656708 jun 30 19:34 /usr/bin/Xorg

-rwxr-xr-x 1 root root 4074620 jun 30 19:34 /usr/bin/Xprt

-rwxr-xr-x 1 root root 3769328 jun 30 19:34 /usr/bin/Xvfb
```

On gentoo X is a symbolic link to Xorg, and to run Xgl, we have to run /usr/bin/Xgl While on Suse, it seems /usr/bin/X is either a symbolic link to /usr/bin/Xgl, or the executable of Xgl itself.

(that's also why we, gentoo users, would have to modify kdm script to make it work with Xgl, see gentoo-wiki)

But I aslo have a good news:)

 *man xinit wrote:*   

> SYNOPSIS
> 
>        xinit [ [ client ] options ] [ -- [ server ] [ display ] options ]
> 
> 

 

We can specify whichh Xserver to use.

So, now, you should be able to try this:

```
xinit ~/bin/ut_test -- /usr/bin/Xorg :1
```

And now it should work (there should be no  need to set DISPLAY="" )

If it works, then just tell me and I'll had an xserver_to_use variable in the script.  :Smile: 

/me waiting  :Razz: 

----------

## nnd

```
> ls -l /usr/X11R6/bin/X*

lrwxrwxrwx 1 root root      16 2006-08-20 11:24 /usr/X11R6/bin/X -> /var/X11R6/bin/X

-rwxr-xr-x 1 root root 2225920 2006-05-02 11:35 /usr/X11R6/bin/Xdmx

lrwxrwxrwx 1 root root       4 2006-07-17 16:07 /usr/X11R6/bin/XFree86 -> Xorg

-rwxr-xr-x 1 root root 1710688 2006-07-29 13:40 /usr/X11R6/bin/Xgl

-rwxr-xr-x 1 root root   27494 2006-05-02 11:32 /usr/X11R6/bin/Xmark

-rws--x--x 1 root root 2086520 2006-05-02 11:35 /usr/X11R6/bin/Xorg

-rwxr-xr-x 1 root root 4792784 2006-05-02 11:35 /usr/X11R6/bin/Xvnc

lrwxrwxrwx 1 root root       7 2006-07-17 16:02 /usr/X11R6/bin/Xwrapper -> XFree86
```

```
> ls -l /var/X11R6/bin/X

lrwxrwxrwx 1 root root 18 2006-08-23 21:38 /var/X11R6/bin/X -> /usr/X11R6/bin/Xgl
```

So, in my case /usr/X11R6/bin/X points to /usr/X11R6/bin/Xgl! 

```
xinit ~/bin/ut_test -- /usr/X11R6/bin/Xorg :1
```

Ok, it works like a charm  :Smile:  Also it's possible to use default loki's ut2004 script instead of ut_test.

 *Quote:*   

> there should be no need to set DISPLAY="" 

 

Yes, there is no need to set it.

 *Quote:*   

> If it works, then just tell me and I'll had an xserver_to_use variable in the script.

 

Ok, it's nice, but could you also add these routes as default: /usr/bin/Xorg and /usr/X11/bin/Xorg? I think, most systems has them.

Thank you! /me is waiting for the next release  :Smile: 

----------

## truc

version=20060824

xlaunch, will now set the Xserver to use, since on some system, /usr/bin/X is a link to /usr/bin/Xgl, while on other /usr/bin/X is a link to /usr/bin/Xorg

@nnd, 

```
 ls -l /usr/X11R6

lrwxrwxrwx 1 root root 6 aoû 17 00:16 /usr/X11R6 -> ../usr
```

It's like that on every system I check, so I assume it is the default

 *Quote:*   

> Also it's possible to use default loki's ut2004 script instead of ut_test

 

I don't know this script, I tried looking for loki+ut2004 but didn't get any interesting result, what am I missing?  :Razz: 

----------

## arabis

Is there someboby using an Ati card + ati-drivers who has succeeded to use this script?

----------

## Xamindar

I don't think this script works anymore.  My x servers crash when I use it.  Anyone care to update?

----------

## surferjox

Seems nice :=)

----------

## Xamindar

Is it possible to set the resolution of the new xserver with this script?  For example, set it to 800x600 at 16 when I launch DiabloII.

----------

## truc

 *Xamindar wrote:*   

> I don't think this script works anymore.  My x servers crash when I use it.  Anyone care to update?

 

Did it work before? do you have an ATI card ? if so, and if you're using XGL then yoou might be interested with this 

 *Quote:*   

> Is it possible to set the resolution of the new xserver with this script? For example, set it to 800x600 at 16 when I launch DiabloII.

 

How do you set the resolution? If it's with x11-apps/xrandr? or do you have a second xorg.conf file? more info needed  :Wink: 

EDIT: well it looks like you've got an ATI card, and that you're also running XGL. so before even trying this script, make sure you can run two xserver with you card (eg try running xinit -- :1) if you can't then just read the workaround given above. I'm thinking how to make the script working for you too (those who can't start two xserver because of ati drivers), but right now I have some school work to do, and it can't wait anymore  :Sad: 

===========================================================

EDIT2: Sorry, just didn't want to pump the thread again

version=20060904

corrected wrong behaviour, when using XPLAYER feature and when link was added is a different directory than where the xlaunch script is.

If using this feature, then now, here is what you can add in the sudoers file:

```
viduso

```

then once inthe file, delete the previous line about xlaunch if you had one, and write this instead:

```
Cmnd_Alias      XLAUNCH          = /bin/su - xplayer -l -c FULL_PROG_NAME=* /home/scripts/xlaunch *

%games          ALL=(root)              NOPASSWD: XLAUNCH
```

*updated first post the reflect this.

----------

## Xamindar

 *truc wrote:*   

> 
> 
> EDIT: well it looks like you've got an ATI card, and that you're also running XGL. so before even trying this script, make sure you can run two xserver with you card (eg try running xinit -- :1) if you can't then just read the workaround given above. I'm thinking how to make the script working for you too (those who can't start two xserver because of ati drivers), but right now I have some school work to do, and it can't wait anymore 
> 
> 

 

No, I have a nvidia card.  When I launch a second xserver then my xgl one will randomly crash, sometimes imediately and sometimes after a couple of minutes.  Your script works fine if I launch it with no other server running.  Actually, your script is probably fine.  Looks like it is a problem with the most rescent drivers.

----------

## Pentahex

Xamindar:

I've noticed the same behavior since the recent nvidia-driver upgrade with Xgl.  I'm sure it's not related to the Xlaunch script

because the same thing happens with Xgame.  The strange thing is, sometime it will work, but usually X will crash and

have to be restarted.

----------

## baigsabeeh

I was wondering something.  This is my first time using XLaunch and I didn't like the fact that applications ran without a windeco in the other X.  So, I did xlaunch startkde when I switched back to X from XGl.  This ran another KDE sessions.  So, would it be ok if I did some other lightweight WM on the other X to play games with.

----------

## truc

 *baigsabeeh wrote:*   

> I was wondering something.  This is my first time using XLaunch and I didn't like the fact that applications ran without a windeco in the other X.  So, I did xlaunch startkde when I switched back to X from XGl.  This ran another KDE sessions.  So, would it be ok if I did some other lightweight WM on the other X to play games with.

 

You obviously didn't read the whole first post.. But I can't blame you for that.. it's a bit  long..  :Embarassed: 

so, for full screen application,we usually don't need any window manager to run onthis display. but for windowed programs you might be interested with this part(in the first post):

III - The xlaunch script

b) HowTo use it -The new way - The link trick 

* Windowed application

Honestly I don't really like the way of doing it(modifying the script etc.. ), that's why I'm planning to rewrite xlaunch in a different way, so that, the script has not to be modified (handy if it's installed with the xgl-coffee overlay, and if the user don't have root acces). until then, it should work as you want.  :Question: 

 :Smile: 

----------

## baigsabeeh

Here's another problem.  When I launch an application in XLaunch when I'm using XGl/Compiz/cgwd, sometimes it just shows for 3 or 4 seconds and then throws me back to KDM and then I end up logging into another KDE session, manually killing that one and then going to the original.  Is there a way around this.  This doesn't happen if I use Xlaunch in Xorg.

----------

## truc

This doesn't seem to be xlaunch related, so I'm affraid I can't do anything. But it could be interesting to know if it happen only with a few program, or with each one?

Did you look at the log? if it was on DISPLAY=:1 then the log is /var/log/Xorg.1.log , Any Error (EE)  :Question: 

----------

## baigsabeeh

It just randomly happens.  Sometimes a program worked with Xlaunch fine and then the next time, boom what I describe above happens or the machine locks up.

----------

## Xamindar

 *baigsabeeh wrote:*   

> Here's another problem.  When I launch an application in XLaunch when I'm using XGl/Compiz/cgwd, sometimes it just shows for 3 or 4 seconds and then throws me back to KDM and then I end up logging into another KDE session, manually killing that one and then going to the original.  Is there a way around this.  This doesn't happen if I use Xlaunch in Xorg.

 

Did you look at my post above?  I already mentioned this.  It must be a problem with the recent drivers or xorg updates.

----------

## truc

NEW!  :Laughing:  version=20060911a little fix, so that launching specific programs for a given application now correctly works. (eg, if you use xlaunch to launch blender, there are chances that you also like to start a window manager on this display.

=====================================

 *Xamindar wrote:*   

> Is it possible to set the resolution of the new xserver with this script?  For example, set it to 800x600 at 16 when I launch DiabloII.

 

It is possible, I can see two ways for doing it

the brutal way:

your xorg.conf must be already configured to support this resolution, ie when you're in X type xrandr -q, here is what I get:

```
 SZ:    Pixels          Physical       Refresh

*0   1280 x 1024   ( 382mm x 313mm )  *75  

 1   1024 x 768    ( 382mm x 313mm )   75  

Current rotation - normal

Current reflection - none

Rotations possible - normal 

Reflections possible - none

```

so I want to use the 1024 x 768 resolution, I need to issue xrandr -s 1 just after the Xserver is launch (ie just after the xinit line in the script (do it the same way as described in :

 III - The xlaunch script

--> b) HowTo use it -The new way - The link trick --> * Windowed application

I won't say anything more for this method, since I don't really like it, but it works..

And the prefered way:

For that you'd need (as root) a copy of your existing xorg.conf, 

```
cp /etc/X11/xorg.conf /etc/X11/xorg-diablo.conf
```

(name it whatever you feel like!)

Then edit this file, and delete the resolution you don't need:

e.g.:

```

Section "Screen"

        Identifier "Screen0"

        Device     "Card0"

        Monitor    "Monitor0"

        SubSection "Display"

                Viewport   0 0

                Depth     24

                Modes   "1280x1024" "1024x768"

        EndSubSection

EndSection

```

```
Section "Screen"

        Identifier "Screen0"

        Device     "Card0"

        Monitor    "Monitor0"

        SubSection "Display"

                Viewport   0 0

                Depth     24

                Modes   "1024x768"

        EndSubSection

EndSection
```

(if I want to have 1024x768. Use your settings instead!)

Now, you have your second xorg config ready, time to tell xlaunch to use it, I don't know how yourun DiabloII, I'll assume you have a diabloII command :

In the xlaunch script, in the case loop: (about line 363) add the diabloII case, 

eg: *---insert what 's in bold--- wrote:*   

> case "${FULL_PROG_NAME##*/}" in
> 
>     xlaunch)
> 
> echo "The program can't call itself. Exiting!"
> ...

 

Now, when you'll run xlaunch diabloII, or xdiabloII if you've created the link, that'll launch the game with the wanted resolution.

EDIT: note, than in the same way as we redefined the Xserverargs variable for daibloII, it's also possible de re-define almost what you want(XSET_ARGS, userxbindkeysrc, Xresources and so on..)

As an exemple, here is what I use for XSET_ARGS

I have a default 

```
XSET_ARGS="m 7/10 1"
```

 which is uncommented, in the 'configuration' part of the script, then in the case loop, here is what I added

```
    quake3*|et|warsow)

        XSET_ARGS="m 0 0"

        echo "Starting ${FULL_PROG_NAME} on DISPLAY $DISPLAY_TO_USE"

        xinit "${FULL_PROG_NAME}" $* -- $Xserver :$DISPLAY_TO_USE $Xserverargs &>/dev/null &

        ;;
```

This way I have no acceleration for theses games (quake3, quake3-osp, quake3-cpma..., et, warsow ), and I still have XSET_ARGS="m 7/10 1" when I'm doing anything else than these games.

----------

## gentunian

I dont really read all the 5 pages of this post. I only want to say that im running Xgl, and im able to run apps in 3d mode, say like: googleearth, flightgear, xmoto, the screensaver with GL preffix, this last one hung first and I made some changes to the arguments for Xgl, and I use, only for testing, a game in cedega Dream match tennis. 

I have an nvidia card, and the arguments i've passed to Xgl are the same poste in the xgl gentoo wiki

Well, thats all.

Adios

----------

## truc

I'm not sure I understood everything:

You're trying to tell you don't need xlaunch right? (except for your 'Dream match tennis' game). Xgl is getting better and better, and that's a good point. 

Actually xlaunch is not just for XGL user. I personnally don't use xgl, but use xlaunch, why? because, I can switch easily between a game and my desktop, because, I can make my multimedia keys working inside a full screen game, because, I can launch a given game in a  xserver with a lower resolution, or depth (ok, I don't use this one..), and so forth and so on (other reasons are given in the first post)

----------

## Ronin324

First off thanks to truc for writing the script. Also thanks to CoffeeBuzz for emplimenting in to the coffee overlay.

I decided to emerge the xlauch script threw portage since I am xgl-coffee overlay user. The script works fine. I was just wondering if there was a way to get lets say quake 3 to run in a windowed mode. I read the post about the script but since I got it through portage it seems like its setup a little differently. Anyone have any ideas?

Thanks for the help.

----------

## truc

So you don't have the latest version, but that shouldn't be a problem (a few days ago, I pm'd CoffeeBuz so that he put the latest version, but he had some problem with his computer..)

This shouldn't be a problem anyway.

You want quake3 to run in window mode so that you have your 'fun keys' working right?

You just have to follow the part III - The xlaunch script c) Making your multimedia keys working In the first post.

In short, start the game(with xlaunch if you're using the XPLAYER feature, with or without xlaunch otherwise (if you don't know, then you're not using it)then set Fullscreen to Off, then clic Accept , you're now in window mode, you can now exit the game, and next time you'll play quake3 it will be in window mode.

Note: are you using quake3-bin, or quake3 (from source)  :Question: 

There is sthg you need to know, if you're using quake3 from source, there is a bug with window mode and brightness, I've reported it here:When Fullscreen is off, Brightness has no effect. 

Here is an easy work around:

Once the quake3 game based is launch (in window mode) just type:

ALT+ENTER

it will make it fullscreen, then again

ALT+ENTER

To have window mode again. This way, brightness now works, and so does xbindkeys  :Smile: 

For Those who are using the XPLAYER feature and who use XQF, I've also noticed a bug with the working directory, I've made a patch , you can find it on gentoo bugzilla(here ), but also here, but this seems hard to understand why would I need to correct this bug, and there are not enough gentoo-dev to take care of it.. So if you don't want to wait until it's added 'officially', use the ebuild provided

----------

## BlackTiger

It's me again  :Razz: 

Just tried the latest version of your script but now it totally ignores the -p (--path) function

It always says ... ( and yes i sure have rights to execute it  :Shocked:  )

 *Quote:*   

> 
> 
> Error: can't find ut2004-bin-linux-amd64:
> 
>    - Is it in you PATH?
> ...

 

And I also noticed the bug that my X Server crashes when using your script - just when I updated to the latest NVidia drivers ... so it has something to do with a change inside the drivers - now the thing is, need to find a workaround because I don't think nvidia will fix anything!?

Regards

BlackTiger

----------

## truc

 *BlackTiger wrote:*   

> It's me again 

 

hi  :Wink: 

 *Quote:*   

> Just tried the latest version of your script but now it totally ignores the -p (--path) function

 

Do you know now the --path is no longer needed? (Normally  :Razz:  ) you can run either xlaunch program or xlaunch /path/to/program or even xlaunch relative/path/to/program (but xlaunch --path path/to/prog should still work!)

 *Quote:*   

> It always says ... ( and yes i sure have rights to execute it  )
> 
>  *Quote:*   
> 
> Error: can't find ut2004-bin-linux-amd64:
> ...

 I suppose here you're trying to run 

```
xlaunch ut2004-bin-linux-amd64
```

, but if I refer to your previous posts, 

ut2004-bin-linux-amd64 is in /home/blacktiger/games/ut2004/System and I don't think you put this directory in your PATH, so here is what you can do

run the game with xlaunch ~/games/ut2004/System/ut2004-bin-linux-amd64

create a symlink with :

xlaunch --addlink /home/blacktiger/games/ut2004/System/ut2004-bin-linux-amd64

or

xlaunch --addlink path/to/writable/directory /home/blacktiger/games/ut2004/System/ut2004-bin-linux-amd64     if you don't have write permission on the directory where xlaunch is stored (path/to/writable/directory must appear in your PATH)

then chose the name you want for that symlink, e.g. ut, then to run the game, just run xut

 *Quote:*   

> And I also noticed the bug that my X Server crashes when using your script - just when I updated to the latest NVidia drivers ... so it has something to do with a change inside the drivers - now the thing is, need to find a workaround because I don't think nvidia will fix anything!?

 

Actually I also noticed that, I've made some tests, and it appears that it's the new xorg-7.1 fault (and not nvidia drivers) , It was *really* annoying!, (for example, when I play frozenthrone, going back to my desktop (CTRL-ALT-F7) will kill one of the wine process.

So, my work around is to mask the new xorg, here is a part of my packages.mask concerning this issue:

```
...

>=x11-base/xorg-server-1.1.0

=x11-base/xorg-x11-7.1

=x11-drivers/xf86-input-evdev-1.1.2-r1

=x11-drivers/xf86-input-keyboard-1.1.0

>=x11-drivers/xf86-input-mouse-1.1.0

=x11-drivers/xf86-video-nv-1.1.2

...
```

----------

## BlackTiger

As always thanks for your fast and competent help  :Razz: 

It was my mistake with the "xlaunch -p ut2004-bin-linux-amd64" Command. I used the command when I was in the System directory of ut2004, but well just then it tries to find the path ... my fault ... ""xlaunch -p ./ut2004-bin-linux-amd64" for example works (when already in the dir ^^")

But finally made that tiny symlink xut  :Surprised:  Works great, I tried switching between my Desktops (CTRL+Alt+FX) many times but for this time no crash o_O" This is really amusingly ... it works one time without a single problem, but then problems occur  :Shocked:  Anyway ... I want to keep my XOrg 7.1  :Wink: 

Thanks

BlackTiger

----------

## Ronin324

Truc.. Thanks for the info. I will keep an eye out for updates in portage for the script. Thanks for the quake3 tips as well. Right now I am just running the demo, just something to pass the time when I am getting ticked off at something.  Now I just have to try and use wine to get some of my other games working. I wish Americas Army had not gotten rid of linux support but ohh well.

----------

## stahlsau

cool that there's still development going on. I use this script on a daily basis, everytime i start a game. Really useful stuff, keep it up  :Wink: 

----------

## BlackTiger

Hi,

seems that I somehow was right thinking that the NVidia driver is crashing X when switching between the servers  :Confused: 

Some days ago the Nvidia Beta Driver 1.0-9625 was released and since then the crashing problem is gone  :Very Happy: 

Test it for yourself and report your experiences here  :Wink: 

Regards

BlackTiger

----------

## Xamindar

 *BlackTiger wrote:*   

> Hi,
> 
> seems that I somehow was right thinking that the NVidia driver is crashing X when switching between the servers 
> 
> Some days ago the Nvidia Beta Driver 1.0-9625 was released and since then the crashing problem is gone 
> ...

 

Thanks for the info, I suspected that but wasnt sure.  Nice to hear they fixed it.  I noticed that my server crashes even if I go to a console.

----------

## jballou

Hey, using the script on several machines and it works great. One thing though, when I switch VTs from a Wine game, and come back, I get the Big Ugly X cursor in the center of the screen with no way to remove it. Everything else works great, game runs fine, but the cursor sticks. Is this a Wine issue I need to deal with or any ideas hot to remove it? Thanks for the script.

----------

## truc

I remember having this issue a long time ago, I don't really remember if I did sthg to fix it, or not.

which wine version are you using?

in winecfg, did you disable "allow the window manager to control de window" ?

 *BlackTiger wrote:*   

> Hi,
> 
> seems that I somehow was right thinking that the NVidia driver is crashing X when switching between the servers 
> 
> Some days ago the Nvidia Beta Driver 1.0-9625 was released and since then the crashing problem is gone 
> ...

 

thanks a lot, I did unmask the new xorg, and the new beta nvidia drivers, and it's working, I no longer have theses crashes!

----------

## jballou

 *truc wrote:*   

> I remember having this issue a long time ago, I don't really remember if I did sthg to fix it, or not.
> 
> which wine version are you using?
> 
> in winecfg, did you disable "allow the window manager to control de window" ?
> ...

 

Yep. It's a Wine deal, native Quake 3 in xlaunch doesn't do it, but does if I wine quake3.exe .

----------

## marcelvs

Hi, I use Xgl and I have to say xlaunch is a great script   :Very Happy: . My problem is when I run xlaunch in console (with xdm stoped) it works great. When I run xlaunch inside a Xgl (call from  xterm window) XGL shuts down and is restarted (restarted by xdm script of course) and nothing else happens.

If (with xdm runing ) I press ctrl + alt + f1 and switch to console mode and run xlaunch from console, my computer locks and I have to reboot.

I have an ATI radeon 9600 pro video card, latest version of xlaunch for this date and I did not read nothing like this in this forum (I did not read all five pages)....

Any help will be welcome, thanks.

Marcelo

----------

## truc

hi, some ATI users have problem running two Xserver, so my question is, are you one of them?

I mean, can you do this ( from the console, no X server running yet ) :

xlaunch xterm

# it should start an Xserver, then inside the xterm, run 

xlaunch term

If it's working, (two Xservers running at the same time, and you can switch between them with ctrl-alt-FX ) then xe should be able to get the script working correctly otherwise, you can still follow this link

----------

## marcelvs

If I shutdown Xgl I can run xlaunch twice as you said. I tried and it worked. It fails if I try to run xlaunch with Xgl running.

----------

## truc

 *marcelvs wrote:*   

> If I shutdown Xgl I can run xlaunch twice as you said. I tried and it worked. It fails if I try to run xlaunch with Xgl running.

 

it "worked"  means you can switch between the two display with ctrl-alt-f7 and ctrl-alt-f8 right?

Are you using gentoo? can you post the result of ls -l /usr/bin/X*. Can you also try when you're in xgl :

in xterm: 

* First post the result of ps aux (on this thread, or pm me)

* try xinit -- :1 , does it crash your xgl? if so, pastbin /var/log/xorg.1.log, now try DISPLAY="" xinit -- :1 does it work?

we need something, we don't have any log from you, no nothing  :Confused: 

----------

## marcelvs

 *Quote:*   

> 
> 
> it "worked" means you can switch between the two display with ctrl-alt-f7 and ctrl-alt-f8 right?
> 
> Are you using gentoo? can you post the result of ls -l /usr/bin/X*. Can you also try when you're in xgl :
> ...

 

Yes, I can switch between desktops.

I am using gentoo, I'd like to point out I use xgl and use DISPLAY=0 with XGL, but I did all tests with "xinit -- :1", and all tests crashed the whole computer.

Here is the output:

 ps aux 

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND

root         1  0.0  0.1   1508   528 ?        Ss   13:07   0:00 init [3]  

root         2  0.0  0.0      0     0 ?        SN   13:07   0:00 [ksoftirqd/0]

root         3  0.0  0.0      0     0 ?        S    13:07   0:00 [watchdog/0]

root         4  0.0  0.0      0     0 ?        S<   13:07   0:00 [events/0]

root         5  0.0  0.0      0     0 ?        S<   13:07   0:00 [khelper]

root         6  0.0  0.0      0     0 ?        S<   13:07   0:00 [kthread]

root         8  0.0  0.0      0     0 ?        S<   13:07   0:00 [kblockd/0]

root        23  0.0  0.0      0     0 ?        S<   13:07   0:00 [kseriod]

root        26  0.0  0.0      0     0 ?        S<   13:07   0:00 [khubd]

root        57  0.0  0.0      0     0 ?        S    13:07   0:00 [kapmd]

root        81  0.0  0.0      0     0 ?        S    13:07   0:00 [pdflush]

root        82  0.0  0.0      0     0 ?        S    13:07   0:00 [pdflush]

root        83  0.0  0.0      0     0 ?        S    13:07   0:00 [kswapd0]

root        84  0.0  0.0      0     0 ?        S<   13:07   0:00 [aio/0]

root       666  0.1  0.0      0     0 ?        S<   13:07   0:00 [vesafb]

root       690  0.0  0.0      0     0 ?        S<   13:07   0:00 [kpsmoused]

root       756  0.0  0.0      0     0 ?        S<   13:08   0:00 [kjournald]

root       956  0.0  0.1   1728   556 ?        S<s  13:08   0:00 /sbin/udevd --daemon

root      2702  0.0  0.0      0     0 ?        S    13:08   0:00 [saa7133[0]]

root      4340  0.0  0.0      0     0 ?        S<   13:08   0:00 [kgameportd]

root      6288  0.0  0.1   1544   596 ?        Ss   13:08   0:00 /usr/sbin/syslogd -m 0

101       6490  0.0  0.1   3840   888 ?        Ss   13:08   0:00 /usr/bin/dbus-daemon --system

102       6696  0.0  1.5   9284  7800 ?        Ss   13:08   0:00 /usr/sbin/hald --use-syslog

root      6698  0.0  0.1   2696   944 ?        S    13:08   0:00 hald-runner

root      6786  0.0  0.2   2232  1216 ?        Ss   13:08   0:00 /usr/sbin/klogd -c 3 -2

102       7179  0.0  0.1   1884   772 ?        S    13:08   0:00 /usr/libexec/hald-addon-keyboard

root      7364  0.0  0.1   1772   616 ?        S    13:08   0:00 /usr/libexec/hald-addon-storage

root      7421  0.0  0.1   1772   620 ?        S    13:08   0:00 /usr/libexec/hald-addon-storage

root      7693  0.0  0.0   1524   224 ?        Ss   13:08   0:00 /sbin/dhcpcd -h darkstar eth0

root      7788  0.0  0.1   3940  1016 ?        Ss   13:08   0:00 /usr/sbin/sshd

root      7813  0.0  0.4   7688  2092 ?        Ss   13:08   0:00 /usr/sbin/smbd -D

root      7822  0.0  0.2   3752  1180 ?        Ss   13:08   0:00 /usr/sbin/nmbd -D

root      7849  0.0  0.1   7688   908 ?        S    13:08   0:00 /usr/sbin/smbd -D

root      7851  0.0  0.7   5620  3968 ?        S    13:08   0:00 ddclient - sleeping for 240 seconds

root      7867  0.0  0.3  11900  1876 ?        Ss   13:08   0:00 /usr/bin/gdm

root      7868  0.0  0.4  12440  2568 ?        S    13:08   0:00 /usr/bin/gdm

root      7887  6.3 14.1  83284 73324 ?        SL   13:08   0:42 /usr/bin/Xgl :0 -ac -accel xv:pbuffer -accel glx:pbuffer -auth /var/gdm/:0.X

root      7888  0.4  1.4  15728  7732 tty7     SLs+ 13:08   0:03 /usr/bin/Xorg vt7 -auth /tmp/.Xgl-auth-AKmjDe -nolisten tcp :93 -terminate

root      7971  0.0  0.0   1504   512 tty1     Ss+  13:08   0:00 /sbin/agetty 38400 tty1 linux

root      7972  0.0  0.0   1500   508 tty2     Ss+  13:08   0:00 /sbin/agetty 38400 tty2 linux

root      7973  0.0  0.0   1504   512 tty3     Ss+  13:08   0:00 /sbin/agetty 38400 tty3 linux

root      7974  0.0  0.0   1504   512 tty4     Ss+  13:08   0:00 /sbin/agetty 38400 tty4 linux

root      7976  0.0  0.0   1500   508 tty5     Ss+  13:08   0:00 /sbin/agetty 38400 tty5 linux

root      7977  0.0  0.0   1504   508 tty6     Ss+  13:08   0:00 /sbin/agetty 38400 tty6 linux

mribeiro  8013  0.0  0.2   2788  1236 ?        Ss   13:08   0:00 /bin/sh /usr/kde/3.5/bin/startkde

mribeiro  8036  0.0  0.1   2792   664 ?        S    13:08   0:00 /usr/bin/dbus-launch --sh-syntax --exit-with-session

mribeiro  8037  0.0  0.1   3724   568 ?        Ss   13:08   0:00 dbus-daemon --fork --print-pid 8 --print-address 6 --session

mribeiro  8040  0.0  0.1   3496   632 ?        Ss   13:08   0:00 /usr/bin/ssh-agent -- /usr/kde/3.5/bin/startkde

mribeiro  8080  0.0  0.6  23888  3552 ?        Ss   13:08   0:00 kdeinit Running...                    

mribeiro  8083  0.0  0.7  13732  3672 ?        S    13:08   0:00 dcopserver --nosid

mribeiro  8085  0.0  1.5  24732  7836 ?        S    13:08   0:00 klauncher [kdeinit] --new-startup     

mribeiro  8087  0.0  2.7  29216 14108 ?        S    13:08   0:00 kded --new-startup

mribeiro  8092  0.0  0.0   1484   356 ?        S    13:08   0:00 kwrapper ksmserver --windowmanager compiz-decorator

mribeiro  8094  0.0  1.8  20436  9812 ?        S    13:08   0:00 ksmserver --windowmanager compiz-decorator

mribeiro  8100  0.1  2.9  28088 15072 ?        S    13:09   0:01 kdesktop

mribeiro  8102  0.5  3.1  29540 16036 ?        S    13:09   0:03 kicker

mribeiro  8103  0.0  1.3  24156  7152 ?        S    13:09   0:00 kio_file [kdeinit] file /tmp/ksocket-mribeiro/klauncher29lJfc.slave-socket /

mribeiro  8111  0.0  1.6  20544  8460 ?        S    13:09   0:00 kaccess

mribeiro  8112  0.0  2.1  24936 11020 ?        S    13:09   0:00 krandrtray -session 10d7d5d3dd000113045375900000139960019_1160700920_765501

mribeiro  8114  0.0  2.5  25188 13092 ?        S    13:09   0:00 kget -session 10d7d5d3dd000112241259900000117810017_1160700920_694955

mribeiro  8116  0.0  2.5  26760 13420 ?        S    13:09   0:00 kmix -session 10d7d5d3dd000114903119700000150360008_1160700920_695453

mribeiro  8118  0.0  2.4  25820 12692 ?        S    13:09   0:00 kcheckgmail -session 10d7d5d3dd000115695054600000082100012_1160700920_672333

mribeiro  8130  0.2  1.1  14528  6096 ?        S    13:09   0:01 compiz --replace decoration wobbly fade minimize cube rotate zoom scale move

mribeiro  8134  0.0  3.2  33260 16944 ?        S    13:09   0:00 knotes -session 10d7d5d3dd000115513595600000138640011_1160700920_890803

mribeiro  8141  0.0  1.3  13768  6996 ?        S    13:09   0:00 gtk-window-decorator

mribeiro  8143  0.0  0.5   4056  2600 ?        S    13:09   0:00 /usr/libexec/gconfd-2 14

mribeiro  8156  0.0  0.2   2916  1356 ?        S    13:09   0:00 /bin/bash /usr/libexec/mozilla-launcher

mribeiro  8165  4.1 10.2 131188 53036 ?        Sl   13:09   0:25 /usr/lib/mozilla-firefox/firefox-bin

mribeiro  8175  0.0  0.0      0     0 ?        Z    13:09   0:00 [netstat] <defunct>

mribeiro  8196  0.0  0.9   8548  4944 ?        S    13:14   0:00 urxvt -depth 32 -fg grey90 -bg rgba:0000/0000/0000/dddd

mribeiro  8197  0.0  0.3   3120  1668 pts/1    Ss   13:14   0:00 bash

root      8203  0.0  0.1   2224  1028 pts/1    S    13:17   0:00 su -

root      8206  0.0  0.3   2856  1636 pts/1    S    13:17   0:00 -su

root      8214  0.0  0.1   2132   876 pts/1    R+   13:19   0:00 ps aux

----------------------------------------------------------------

ls -l /usr/bin/X*

lrwxrwxrwx 1 root root       4 Sep 30 11:56 /usr/bin/X -> Xorg

lrwxrwxrwx 1 root root       6 Dec  4  2005 /usr/bin/X11 -> ../bin

-rwxr-xr-x 1 root root 1542268 Sep 30 21:57 /usr/bin/Xgl

-rwxr-xr-x 1 root root 3930748 Sep 30 11:56 /usr/bin/Xnest

-rws--x--x 1 root root 1742756 Sep 30 11:56 /usr/bin/Xorg

-rwxr-xr-x 1 root root 4253768 Sep 30 11:56 /usr/bin/Xvfb

-------------------------------

cat /var/log/Xorg.1.log

X Window System Version 7.1.1

Release Date: 12 May 2006

X Protocol Version 11, Revision 0, Release 7.1.1

Build Operating System: Linux 2.6.17-gentoo-r8 i686 

Current Operating System: Linux darkstar 2.6.17-gentoo-r8 #2 PREEMPT Thu Sep 28 20:55:55 UTC 2006 i686

Build Date: 30 September 2006

	Before reporting problems, check http://wiki.x.org

	to make sure that you have the latest version.

Module Loader present

Markers: (--) probed, (**) from config file, (==) default setting,

	(++) from command line, (!!) notice, (II) informational,

	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.

(==) Log file: "/var/log/Xorg.1.log", Time: Fri Oct 13 13:07:25 2006

(==) Using config file: "/etc/X11/xorg.conf"

(==) ServerLayout "Server Layout"

(**) |-->Screen "Screen0" (0)

(**) |   |-->Monitor "Monitor0"

(**) |   |-->Device "ATI Graphics Adapter"

(**) |-->Input Device "Mouse1"

(**) |-->Input Device "Keyboard1"

(**) FontPath set to:

	/usr/share/fonts/local/,

	/usr/share/fonts/misc/,

	/usr/share/fonts/75dpi/:unscaled,

	/usr/share/fonts/100dpi/:unscaled,

	/usr/share/fonts/Type1/

(**) RgbPath set to "/usr/X11R6/lib/X11/rgb"

(==) ModulePath set to "/usr/lib/xorg/modules"

(WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)

(II) Open APM successful

(II) Module ABI versions:

	X.Org ANSI C Emulation: 0.3

	X.Org Video Driver: 1.0

	X.Org XInput driver : 0.6

	X.Org Server Extension : 0.3

	X.Org Font Renderer : 0.5

(II) Loader running on linux

(II) LoadModule: "bitmap"

(II) Loading /usr/lib/xorg/modules/fonts/libbitmap.so

(II) Module bitmap: vendor="X.Org Foundation"

	compiled for 7.1.1, module version = 1.0.0

	Module class: X.Org Font Renderer

	ABI class: X.Org Font Renderer, version 0.5

(II) Loading font Bitmap

(II) LoadModule: "pcidata"

(II) Loading /usr/lib/xorg/modules/libpcidata.so

(II) Module pcidata: vendor="X.Org Foundation"

	compiled for 7.1.1, module version = 1.0.0

	ABI class: X.Org Video Driver, version 1.0

(--) using VT number 8

(II) PCI: PCI scan (all values are in hex)

(II) PCI: 00:00:0: chip 1106,3189 card 1043,807f rev 00 class 06,00,00 hdr 00

(II) PCI: 00:01:0: chip 1106,b168 card 0000,0000 rev 00 class 06,04,00 hdr 01

(II) PCI: 00:0a:0: chip 1274,5880 card 1274,2003 rev 02 class 04,01,00 hdr 00

(II) PCI: 00:0d:0: chip 1131,7133 card 11bd,002b rev 10 class 04,80,00 hdr 00

(II) PCI: 00:10:0: chip 1106,3038 card 1043,80a1 rev 80 class 0c,03,00 hdr 80

(II) PCI: 00:10:1: chip 1106,3038 card 1043,80a1 rev 80 class 0c,03,00 hdr 80

(II) PCI: 00:10:2: chip 1106,3038 card 1043,80a1 rev 80 class 0c,03,00 hdr 80

(II) PCI: 00:10:3: chip 1106,3104 card 1043,80a1 rev 82 class 0c,03,20 hdr 00

(II) PCI: 00:11:0: chip 1106,3177 card 1043,80a1 rev 00 class 06,01,00 hdr 80

(II) PCI: 00:11:1: chip 1106,0571 card 1043,80a1 rev 06 class 01,01,8a hdr 00

(II) PCI: 00:12:0: chip 1106,3065 card 1043,80a1 rev 74 class 02,00,00 hdr 00

(II) PCI: 01:00:0: chip 1002,4150 card 18bc,0190 rev 00 class 03,00,00 hdr 80

(II) PCI: 01:00:1: chip 1002,4170 card 18bc,0191 rev 00 class 03,80,00 hdr 00

(ended here) -> I have to push the reset button

----------

## destr0yr

Does anybody else receive the following, or am I the only lucky one?

```
$ xlaunch

/home/scripts/xlaunch: 111: Syntax error: Bad substitution

```

The script, xlaunch, is in /home/scripts, which is in my path.  I am the owner of the file (user and group).  xlaunch version is 20060913.

However... I am running Ubuntu (Edgy) w/bash 3.1-5ubuntu3.  I wasn't able to find anything useful in the ubuntuforums, so I figured I'd come back to the source, and arguably the most helpful forums on the 'net.

----------

## truc

I don't know which version bash 3.1-5ubuntu3 exactly is, but I'm running bash-3.1_p17 here and it's ok, it's probably due to a bad copy&pasting:?::

 try to download the script again:

```
wget http://fatimademe.free.fr/truc/xlaunch -O /home/scripts/xlaunch
```

btw, line 111 is 

```
 if [ "${arg/\/}" != "${arg}" ]; then
```

this test should not fail:

```
$ TRY=/home

$ echo ${TRY/\/}

home
```

hope that helps:/

----------

## destr0yr

 *truc wrote:*   

> I don't know which version bash 3.1-5ubuntu3 exactly is, but I'm running bash-3.1_p17 here and it's ok, it's probably due to a bad copy&pasting:?::
> 
>  try to download the script again:
> 
> ```
> ...

 

Tried that.  Same result.

 *truc wrote:*   

> 
> 
> btw, line 111 is 
> 
> ```
> ...

 

That works successfully.  I edited line 111 using sed to product the same result - ran into another issue on line 123.   On a whim I changed line 1 from #!/bin/sh to #!/bin/bash, and would you believe, that solved the issue.

 *truc wrote:*   

> 
> 
> hope that helps:/

 

Thank you, it did.  

Next on the docket, figuring out why it's not exiting properly and returning me to my desktop...   :Confused: 

----------

## truc

glad you soved it, I should probably set /bin/bash instead of /bin/sh 

 *Quote:*   

> Next on the docket, figuring out why it's not exiting properly and returning me to my desktop..

 

on the first(s) page, there were the same problem, it was with the ut game which actually doesn't exit properly, try running your program in a term, exit from it, and see if you get the prompt back in the term.

----------

## destr0yr

 *truc wrote:*   

> glad you soved it, I should probably set /bin/bash instead of /bin/sh 
> 
> on the first(s) page, there were the same problem, it was with the ut game which actually doesn't exit properly, try running your program in a term, exit from it, and see if you get the prompt back in the term.

 

I tried simply running 'xlaunch xterm' which launched full screen but didn't allow for any input.  I had to Ctrl-alt-backspace to get out.  (AIGLX on Ubuntu 6.10 (Edgy)).  In any case, I have figured out that I can use beryl-manager to change my WM from Beryl to Metacity and back again when desired.  Using this rather cumbersome method, I can launch any game I like sans xlaunch.  I'll continue to play around with it and report back if I figure it out.

I appreciate your time.  Thank you.

----------

## ThomasAdam

I notice that the following is being used:

```

if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then

```

Don't do this -- at least, don't check for "$USER" being equal to root since anyone can change it:

Just check for the $EUID, this is a read-only environment variable.

-- Thomas Adam

----------

## truc

 *ThomasAdam wrote:*   

> I notice that the following is being used:
> 
> ```
> 
> if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
> ...

 

 :Question:  I never did this, the script doesn't even need root privileges  :Question: 

----------

## ThomasAdam

 *truc wrote:*   

>  *ThomasAdam wrote:*   I notice that the following is being used:
> 
> ```
> 
> if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
> ...

 

You recommend the change in /etc/profile -- and whilst the initial check might not even be yours -- the use of checking $USER is completely unnecessary and dangerous.

-- Thomas Adam

----------

## truc

oh, I use the $USER env variable in the script, but it is just ignore if you don't use the "XPLAYER" feature, and even if you do, I don't think there is anything dangerous, but I can be wrong. anyway, so what would you recommend to me, using $UID right?

----------

## ThomasAdam

 *truc wrote:*   

> oh, I use the $USER env variable in the script, but it is just ignore if you don't use the "XPLAYER" feature, and even if you do, I don't think there is anything dangerous, but I can be wrong. anyway, so what would you recommend to me, using $UID right?

 

Yes, consider the following:

```

[n6tadam@workstation ~]% echo "$USER"

n6tadam

```

Which is fine, but then:

```

[n6tadam@workstation ~]% USER=root && echo "$USER"   

root

```

Oops.  It's not a reliable means of ascertaining if a user is root or not.  Plus, if you then had commands thereafter to change one's PATH or what have you, that's just going to be bad all round.

-- Thomas Adam

----------

## user317

I cant seem to get this script to work with the -screen option on 7.1.  the server exits before starting the program

----------

## truc

 *user317 wrote:*   

> I cant seem to get this script to work with the -screen option on 7.1.  the server exits before starting the program

 

Could you say exactly how you're using this option? I think you can use the -screen option as I described here(second part of the post) how to use the -config option.

I didn't know this option, but it looks like it's even better than the -config one  :Idea:   :Question: 

----------

## Xamindar

 *Condex wrote:*   

> I've tried Ubuntu Forum solution, so:
> 
> Changed: ServerCmd=/usr/bin/Xgl -br -ac -accel glx:pbuffer -accel xv:pbuffer
> 
> To: ServerCmd=/usr/bin/Xgl -br -ac -accel glx:pbuffer -accel xv:fbo -xorgAc
> ...

 

I can't get that to work.  Are there any other solutions?  I get an error about -xorgAc not supported.

----------

## dejawoo

i wanna thank for the topic, and other points in this topic..

----------

## truc

there was a problem with xlaunch when the arg/options to the program had spaces in it.

This is fixed now with xlaunch-20070210

for those who modify their xlaunch script, here is a short diff, with the previous (20070127)

```
--- xlaunch     2007-01-27 16:26:30.000000000 +0100

+++ xlaunch-20070210    2007-02-10 10:54:46.075366591 +0100

@@ -6,7 +6,7 @@

 # commented so you should be able to easily use it.

 # See forum thread http://forums.gentoo.org/viewtopic-t-483004.html for more explanation.

 # 

-VERSION=20070127

+VERSION=20070210

 

 #########

 # ======= configuration ======= #

@@ -322,7 +322,7 @@ if [ "x$XPLAYER" != "x" ]; then 

                 fi

 

                 echo "Launching ${FULL_PROG_NAME##*/} as user: $XPLAYER"

-                sudo su - $XPLAYER -l -c "FULL_PROG_NAME=\"$FULL_PROG_NAME\" ${XLAUNCH_PATH:-$0} $*"

+                sudo su - $XPLAYER -l -c "FULL_PROG_NAME=\"$FULL_PROG_NAME\" ${XLAUNCH_PATH:-$0} ${*// /\\ }"

                 exit $?;;

                 

             error) 

@@ -336,8 +336,6 @@ if [ "x$XPLAYER" != "x" ]; then 

     fi

 fi

 

-

-

 ######

 # Thanks to LXj I added the following lines, which allows you launch several programs

 # each one on its own DISPLAY

@@ -374,7 +372,7 @@ case "${FULL_PROG_NAME##*/}" in

     

     *)  

         echo "Starting ${FULL_PROG_NAME} on DISPLAY $DISPLAY_TO_USE"

-        xinit "${FULL_PROG_NAME}" $* -- $Xserver :$DISPLAY_TO_USE $Xserverargs &>/dev/null &

+        xinit "${FULL_PROG_NAME}" "$@" -- $Xserver :$DISPLAY_TO_USE $Xserverargs &>/dev/null &

         ;;

 esac

 

@@ -412,7 +410,4 @@ if [ $? -eq 0 ]; then

     DISPLAY=:$DISPLAY_TO_USE numlockx on

 fi

 

-

-

-

 exit 0

```

----------

## garr0n

Hey, very nice work here, truc. I'm having a strange issue running the script from within X though, maybe you or someone else here know what's wrong.

If I login to another text-mode tty (i.e. ctrl-alt-F2) and run a program with xlaunch, everything works fine. However, if I run xlaunch from an xterm or a graphical menu in X or whatnot, performance is much worse than it should be. The exact same parameters are used both times. 

I'm using updated nvidia drivers, Xorg 6.9 on Slackware. I don't have any fancy composite WMs running.

As an aside, I thought I was having issues running the script in zsh, but it seems to work fine if I specify the path to xlaunch when running it.

Merci beaucoup! keep up the good work

----------

## truc

this is wierd :O

When your in X you should check if variables such as __GL_FSAA_MODE are set (used for antialiasing and things like that). this is the only thing I can think of, so check your env :/

----------

## garr0n

Nope, definately not the problem. I'll keep experimenting and report back if I find a solution (or the cause of the problem at least  :Razz: ).

EDIT: Bah, nevermind, I must have just had some secret runaway processes or something... everything's working fine after a reboot. (What is this, Windows 98?   :Confused: )

Thanks for the help anyhow.

----------

## tekknokrat

very complex script with a lot of features in mind!

I just wonder how it would be to include (seperate) root access.

I know that root cannot use it by design for security reason but I am looking for a solution running seamonkey, firefox or thunderbird with root 

access for installing several xpi plugins.

other tools like k3b sometimes also need more privileges (e.g. for testing device access)

how would it be if your script has something like an 

```
--root
```

 switch which gathers root privileges via su/sudo and then executes x based apps

for installation/maintaining purposes.

Suggestions or Alternatives???

----------

## truc

I'm not sure I've understood exactly what you want  :Confused:  you want to start an X session being root?

What's preventing you from running this script as root?

Also, if you edit your sudoers file you can even run this script as a normal user, and launch the different application as root (including the Xseesion), have a look at the "XPLAYER" feature, (I didn't find better for the name  :Very Happy:  )

around line 316

```
        case "$PROG_GROUP" in

            games)

                if [ -h "$0" ]; then

                    XLAUNCH_PATH=`readlink $0` || echo "Error: could not read the \"$0\" link"

                fi

                

                echo "Launching ${FULL_PROG_NAME##*/} as user: $XPLAYER"

                sudo su - $XPLAYER -l -c "FULL_PROG_NAME=\"$FULL_PROG_NAME\" ${XLAUNCH_PATH:-$0} ${*// /\\ }"

                exit $?;;

            

            error)

                echo "Could not determine group of ${FULL_PROG_NAME}. (Do you have 'stat' on your system?)"

                echo "Launching $FULL_PROG_NAME on DISPLAY=$DISPLAY_TO_USE as user: $USER"

                ;;

            

            *)  

                ;;

        esac

```

you can very easily create a script which will launch your different programs, chgrp it, then ass the case for this group in this loop, and either modify the XPLAYER value (set it to root) or even add your own new variable  :Smile: 

I'm probably not very clear, but I explain a bit this on the first page, so you might wana have a look  :Smile: 

----------

## tekknokrat

sorry for obfuscate my intention - sometimes i think/write too much in general terms.

when i can run this script also via sudo then everything is ok   :Very Happy: 

thought the script path (and because of that access for root was denied) because of the line in /etc/profile

 *Quote:*   

> 
> 
> in /etc/profile, replace:
> 
> if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
> ...

 

will have a deeper look in script now!

thanks for your fast answer!

----------

## KevinLarson

So I'm trying to use xlaunch to run another script of mine.  The contents of the other script are:

wc3

```

#! /bin/bash

setarch i386 -X wine ~/.wine/drive_c/Program\ Files/Warcraft\ III/Frozen\ Throne.exe -opengl 

```

When I run $xlaunch wc3 it says:

Starting /home/scripts/wc3 on DISPLAY 1

It then prints out 50-ish line feeds,

then it prints xrdb:  "XTerm*boldMode" on line 19 overrides entry on line 3,

followed by around 100 prompts (user@localhost ~ $).

Sometimes it will NOT have the line feeds or the prompts, other times it will, but the rest is always the same.

It seems to more frequently print them (last 5 or times I tried, as I was trying to find some sort of correlation(I didn't)), than not.

Thanks,

-Kevin

----------

## truc

I do also have sometimes the 100 prompts, and sometimes don't, I just don't know why   :Rolling Eyes: 

Anyway, so your script isn't working?

Be sure 

```
xinit wc3 -- :1
```

 works.

----------

## KevinLarson

It opens another x session, but doesnt seem to do the script.  Do you know why this might be?

----------

## KevinLarson

Do you want some of the output?  I would have posted it, but I can't seem to find anything relevant.

----------

## KevinLarson

Update: I tried running the script in the second session, and it crashed it.

This printed:

 *Quote:*   

> Backtrace:
> 
> 0: X(xf86SigHandler+0x7d) [0x4898bd]
> 
> 1: /lib/libc.so.6 [0x2ad65f6dbac0]
> ...

 

----------

## truc

what about 

```
xinit /path/to/wc3 -- :1
```

 then?

----------

## KevinLarson

It's a step closer, instead of opening the new session and doing nothing, it now opens the session, shows the little box while loading, then the whole thing dies, session and all.

Heres the output (after removing hundreds of line feeds (what is with this, I see this using xlaunch with other things as well))

 *Quote:*   

>  xinit /home/scripts/wc3 -- :1
> 
> X Window System Version 7.2.0
> 
> Release Date: 22 January 2007
> ...

 

I removed alot of line feeds.

I know alot of these messages display when running wine regardless of the wc3 script or xlaunch.

----------

## truc

I also have the 'line feeds' from time to time, I just don't know why :/

Anyway, it may be due to how setarch works,  may be once it has started the wine process, it exits (that would explain why the Xsession also closes itself).

I'm not sure! This is just a test, could you try to add something like [i)sleep 300[/i] in your wc3 script ?:

```
#! /bin/bash

setarch i386 -X wine ~/.wine/drive_c/Program\ Files/Warcraft\ III/Frozen\ Throne.exe -opengl 

sleep 300
```

and try launching it again, and tell me what happens?

----------

## manojpm

how do i start cstrike under wine using xlaunch??

i tried "xlaunch wine hl.exe -game cstrike" while in the installation folder of cstrike , it gives me : "Unknown id: hl.exe"

then i made a script called "startcs" which had "wine hl.exe -game cstrike" . this time, counter strike starts but displays a dialog(possibly asking cd key) with no text( i had solved this(no text)  problem by copying some windows ttf fonts to wine dir to get it working normally). if i close it, game closes. 

wine hl.exe -game strike works normally. but when i run thru xlaunch, i get this strange prob. any idea?

----------

## Sedrik

I just want to say, THANKS  :Very Happy: 

This is wounderfull. Now I can play Diablo 2 and still get access to firefox without problems  :Smile:  Happy mephing  :Wink: 

----------

## KevinLarson

I was using xlauch to play starcraft, but I also used it (with a special xorg.conf) to use mplayer on my tv.  This worked beautifully for a few months then suddenly stopped working.  Instead of mplayer popping up on the tv, a new x session is opened on my computer monitors and I see the error after the normal mplayer text:

 *Quote:*   

> 
> 
> FreeFontPath: FPE "/usr/share/fonts/misc/" refcount is 2, should be 1; fixing.
> 
> xinit:  connection to X server lost.
> ...

 quote]

I'm not sure whether it was an emerge of x or what. I have the same problem when trying to use mplayer-bin and xine as well so I dont think it is mplayer.

----------

## truc

well, I've just downloaded latest xlaunch, (dunno which versio you're using right now)

 *Quote:*   

> xlaunch mplayer path/to/film
> 
> => works
> 
> xlaunch mplayer path/to/film\ with\ space
> ...

 

I don't know what can be wrong, which version are you using?

I've just changed a little thing about space handling, but this change should affect you only if you're using the "xplayer" features. and this is probably not the case:)

```
--- xlaunch.orig        2007-04-18 15:30:01.000000000 +0200

+++ xlaunch     2007-06-07 19:03:13.000000000 +0200

@@ -6,7 +6,7 @@

 # commented so you should be able to easily use it.

 # See forum thread http://forums.gentoo.org/viewtopic-t-483004.html for more explanation.

 # 

-VERSION=20070418

+VERSION=20070607

 

 #########

 # ======= configuration ======= #

@@ -320,7 +320,7 @@ if [ "x${XPLAYER}" != "x" ]; then 

                 fi

 

                 echo "Launching ${FULL_PROG_NAME##*/} as user: ${XPLAYER}"

-                sudo su - ${XPLAYER} -l -c "FULL_PROG_NAME=\"${FULL_PROG_NAME}\" ${XLAUNCH_PATH:-${0}} ${*// /\\ }"

+                sudo su - ${XPLAYER} -l -c "FULL_PROG_NAME=\"${FULL_PROG_NAME}\" ${XLAUNCH_PATH:-${0}} \"${@}\""

                 exit $?;;

                 

             error)
```

I'm not really sure how I can help   :Confused: 

----------

## KevinLarson

result of typo  :Sad: Last edited by KevinLarson on Sun Jun 17, 2007 12:35 am; edited 1 time in total

----------

## KevinLarson

Nevermind, got it working.

----------

## KevinLarson

```
$ xlaunch mplayer -fs \[Lunar\]\ Gigantic\ Formula\ -\ 09\ \[x264\]\[FCF81670\].mkv 
```

Does not work properly and displays:

 *Quote:*   

> xrdb:  "XTerm*boldMode" on line 19 overrides entry on line 3
> 
> 

 

while:

```
$ xlaunch mplayer -fs \[A-Kraze\]_Seirei_no_Moribito_-_10_\[2F5AEA97\].mkv  
```

works flawlessly.  I'm not sure whether this has to do with spaces, symbols, or what, but I thought you would like to know.

----------

## truc

```
xrdb: "XTerm*boldMode" on line 19 overrides entry on line 3 
```

this looks more like a problem in one of these files 

```
Xresources="${HOME}/.Xresources ${HOME}/.Xdefaults ${xinitdir}/Xresources ${xinitdir}/Xdefault"
```

That's not really a problem though  :Smile: 

----------

## Warhead

Imagine the following: I have an X session running on display 0 in which i started a teamspeak client. I configured teamspeak to use push-to-talk, since voice activation sometimes results in inappropriate results. Now I start a game with xlaunch on display 1. I do that, because some games do not work well with beryl and I want do be able to switch back to my desktop to have a look on my instant manager from time to time. Is there a way to get the event of the keystroke or pointerbutton I use to activate the microphone to the teamspeak appilcaton on the other display?

Regards

Warhead

----------

## truc

if this action can be made with the command line, then you probably can configure a daemon like xbindkeys to bind that command to a key

----------

## chrsin

You should make you script able to use a config file, and then contact the games maintainer group. it would be very easy for them to add a xlaunch use flag, which would make a game use your xlauncher.

Would be a great addition to the games section as the ALT-TAB is something a lot of users are missing

Great work with that script!  :Smile: 

----------

## truc

yeah, a while ago, I wanted to learn lisp, because

1) it looks interesting

2) a xlaunch configuration file can be rather complicated, and I think lisp could be usefull

but.. Never took the time to look deeper at it.

I'll try to think about this. Feel free to give me some other ideas!  :Smile: 

Thanks for the feedback

----------

## J.M.I.T.

hi, the download link is broken... could you please fix it, or could someone post the script itself? I would love to try it, but can't find it anywhere...

----------

## truc

Sorry, as I said on PM, I'm having some trouble with my ISP.

xlaunch script is now hosted somewhere else : http://sam.intelunix.fr/truc/xlaunch

Thanks

----------

## genry

Can anyone give link to this awesome script?

----------

