Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
starting applications during X.. how?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
_savage
Guru
Guru


Joined: 06 Jun 2004
Posts: 308
Location: Redmond, WA

PostPosted: Fri Jul 09, 2004 6:54 pm    Post subject: starting applications during X.. how? Reply with quote

hello,

i am using evilwm (or any other window manager, for that matter) but i just can't seem to get applications started when i run 'startx'. i put them in ~/.xinitrc, or ~/.Xsession, or ~/.Xstartup and nothing happens....

what am i doing wrong?? do i have the wrong flags set?

thanks heaps,
jens
_________________
Jens Troeger
http://savage.light-speed.de/
Back to top
View user's profile Send private message
corsair
Retired Dev
Retired Dev


Joined: 06 Oct 2003
Posts: 451
Location: Aachen, Germany

PostPosted: Fri Jul 09, 2004 7:57 pm    Post subject: Reply with quote

could you please post your configs? I'm using xdm for log in and here is my .xsession (works like a charm :D )

Code:

fbsetbg -f .fluxbox/backgrounds/Inclined_v2_0.jpg &
xscreensaver &
lineakd &
gkrellm2 -w &
fluxbox


Markus
Back to top
View user's profile Send private message
_savage
Guru
Guru


Joined: 06 Jun 2004
Posts: 308
Location: Redmond, WA

PostPosted: Fri Jul 09, 2004 11:59 pm    Post subject: Reply with quote

corsair wrote:
could you please post your configs?


ok, what config file(s) would you like?
_________________
Jens Troeger
http://savage.light-speed.de/
Back to top
View user's profile Send private message
_savage
Guru
Guru


Joined: 06 Jun 2004
Posts: 308
Location: Redmond, WA

PostPosted: Sun Jul 11, 2004 2:30 am    Post subject: [solved] starting applications during X.. how? Reply with quote

_savage wrote:
i am using evilwm (or any other window manager, for that matter) but i just can't seem to get applications started when i run 'startx'. i put them in ~/.xinitrc, or ~/.Xsession, or ~/.Xstartup and nothing happens....


it all goes into ~/.xinitrc, i deleted the other two files. in .xinitrc, the first commands to execute are the window manager in the background, followed by all other applications that you want to start. however, the last application must not be run in background. my .xinitrc looks like this now
Code:
evilwm -term xterm &
gtkpbbuttons -d &
exec gkrellm2

(note, exec is optional).

cheers :)
jens
_________________
Jens Troeger
http://savage.light-speed.de/


Last edited by _savage on Sun Jul 11, 2004 3:54 pm; edited 1 time in total
Back to top
View user's profile Send private message
stimuli
Apprentice
Apprentice


Joined: 16 Dec 2002
Posts: 292
Location: Vancouver, BC, Canada

PostPosted: Sun Jul 11, 2004 5:04 am    Post subject: Reply with quote

exec isn't REALLY optional, iirc, as not putting it there means quitting (xterm, whatever) kills your x session.

Last edited by stimuli on Sun Jul 11, 2004 5:24 am; edited 1 time in total
Back to top
View user's profile Send private message
_savage
Guru
Guru


Joined: 06 Jun 2004
Posts: 308
Location: Redmond, WA

PostPosted: Sun Jul 11, 2004 5:17 am    Post subject: Reply with quote

stimuli wrote:
exec isn't REALLY optional, iirc, as not putting it there means quitting, eg, xterm kills your x session.


i thought it "takes over" the executing shell process instead of creating a new one, thus saving memory? you can start the window manager without exec and it will still work, just don't append "&" :-)

jens
_________________
Jens Troeger
http://savage.light-speed.de/
Back to top
View user's profile Send private message
zojas
Veteran
Veteran


Joined: 22 Apr 2002
Posts: 1138
Location: Phoenix, AZ

PostPosted: Mon Jul 12, 2004 10:45 pm    Post subject: Reply with quote

using exec on the last program you run is nice, because the process which is running your .xinitrc script is overlayed with the process of the last program. thus, you run one less process on your system. in the days where typical machines have hundreds or thousands of megabytes of ram, one process more or less isn't a big deal. but I still like to do the exec.

either way, when the process running the .xinitrc script exits, the X server will shut down. it doesn't matter if you exec the last client or not, it will still shut down when the .xinitrc is done.

as a proof of this, if you leave out the exec, once you're in X, run 'ps auxww |grep xinitrc'. you'll see something like this:


Code:

ps auxww|grep xinitrc                                                                                     
kevin    26720  0.0  0.0  2748  736 tty3     S    08:33   0:00 xinit /home/kevin/.xinitrc -- -nolisten tcp -deferglyphs 16
kevin    26728  0.0  0.0  2460 1188 tty3     S    08:33   0:00 /bin/zsh /home/kevin/.xinitrc
kevin     3269  0.0  0.0  1392  472 pts/263  S    15:31   0:00 grep xinitrc


now if you kill that little process running the .xinitrc (26728 in my example), X will shut down. note that if you kill the last client ran in your .xinitrc, x will still shut down, since when the last client dies, the .xinitrc script will be done, so that process will die too, then the X server will shut down. (xinit probably handles the SIGCHLD, and that's the impetus to shut down)

if instead, you put in the exec, you won't see the zsh in there. (my .xinitrc is a zsh script, yours is probably bash or /bin/sh if you don't specify) in that case, if you kill the last client ran in the .xinitrc, that will cause xinit to get the SIGCHLD and shut down.

bottom line, it doesn't matter, but the exec will end up causing one less process to be lieing around running on your system.

now, if you want X to quit when you quit your window manager, but you still need the window manager to run first so it can handle dockapps and stuff like that correctly, here's an easy way to do it (which leaves the extra shell still running but oh well):

Code:

#!/bin/zsh

ratpoison > /tmp/ratpoison 2>&1 &
wmpid=$!

xtoolwait xterm -j -fn 7x14 -ls  -bg black -bd black -cr yellow -fg yellow +sb -sl 0 +ah -name Run
xtoolwait xterm -name Root -ls -fn 7x14 -g 80x24+0-0 -j -bg black -fg red -sb -sl 5000 +ah  -e su -
xtoolwait psi

wait $wmpid


(zsh is bash compatible when it comes to scripting so all that will work for bash too)

notice I got extra fancy there and didn't even run the other apps in the background, thanks to the magic of xtoolwait. xtoolwait forks/execs the client for you, waits until it maps a window, then exits. that way the machine is only trying to launch one app at a time. normally I wouldn't care, but I actually have a bunch of other stuff in my .xinitrc file which i left out; it also restores a bunch of ratpoison frames, and I need apps to launch in the correct order.
_________________
http://www.desertsol.com/~kevin/ppc
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum