Re: Script that starts X11.app needs to be rerun to get gnome to start
Re: Script that starts X11.app needs to be rerun to get gnome to start
- Subject: Re: Script that starts X11.app needs to be rerun to get gnome to start
- From: Jeremy Huddleston <email@hidden>
- Date: Thu, 17 Mar 2011 22:28:55 -0700
On Mar 17, 2011, at 21:58, Richard Miles wrote:
> I use the $program value in this script called 74-x.sh which is in .xinitrc.d
>
> Here is the 74-x.sh:
> #!/bin/bash
> . /sw/bin/init.sh
> case $program
> in
> ctwm) exec ctwm;;
> ...
> esac
>
> it should show what is in the window manager of choice.
> This works, but not after an initial start of snow leopard. It has to run again and then it works, and it will work
> every time after.
This looks like the correct thing to do (as opposed to your previous example), but the problem is that $program isn't getting set...
My guess is that you're running the script you provided in the first example, and you're expecting the program you set there to be read in your .xinitrc, but that's just not the case. xinitc is a child of xinit which is a child of startx which is uaully a child of launchd, so you will not get the value set in your shell script. In some cases (where you don't use launchd), startx is a child of X11.app.
The reason this works some of the time for you is that your 'open -a X11' forks X11 from the current process (inheriting $program) which failed to initialize the launchd startup and thus forked startx on its own (thus passing along $program).
You should probably do this a different way. Instead of exporting $program, have your startup script edit ~/73-program.sh to set program there.
> I have checked what processes are running and it looks like, as an example, $program contains
> gnome or kde3 is waiting for something.
I am unable to parse this last sentence, sorry =/
>
> On Mar 17, 2011, at 3:50 PM, Jeremy Huddleston wrote:
>
>> What are you trying to do with this script? If you want to choose a specific WM, you should just put that selection in ~/.xinitrc.d/99-wm.sh
>>
>> mkdir ~/.xinitrc.d
>> echo "USERWM=/opt/local/bin/blackbox" > ~/.xinitrc.d/99-wm.sh
>> chmod 755 ~/.xinitrc.d/99-wm.sh
>>
>> Your script is doing many weird things, and I don't know why you're trying to do it that way... perhaps if you explain the reason, I can help you find the best solution.
>>
>> On Mar 17, 2011, at 14:14, Richard Miles wrote:
>>
>>> I have a strange curiosity as to why I must run this script again when run the first time after leopard ver 6.6.0.
>>> Here is the script:
>>> #!/bin/bash
>>> #invoke a X program using X windows
>>> # first kill any X running by me
>>> p_found=`ps ax|grep -v grep|grep X|wc -l`
>>> if [ $p_found -gt 0 ]
>>> then
>>> killall X
>>> #open -a -n x11.app
>>> fi
>>> p_found=`ps ax|grep -v grep|grep quartz-wm|wc -l`
>>> if [ $p_found -gt 0 ]
>>> then
>>> killall quartz-wm
>>> fi
>>> doit=0
>>> case "$1"
>>> in
>>> 1) export program=fluxbox
>>> doit=1;;
>>> 2) export program=fvwm
>>> doit=1;;
>>> f) export program=fvwm2
>>> doit=1;;
>>> 3) export program=gnome
>>> doit=1;;
>>> 4) export program=icewm
>>> doit=1;;
>>> 5) export program=kde3
>>> doit=1;;
>>> 6) export program=kde4
>>> doit=1;;
>>> 7) export program=ratpoison
>>> doit=1;;
>>> 8) export program=wmaker
>>> doit=1;;
>>> 9) export program=xfce4
>>> doit=1;;
>>> a) export program=amiga
>>> doit=1;;
>>> o) export program=openbox
>>> doit=1;;
>>> g) export program=ognome
>>> doit=1;;
>>> k) export program=okde
>>> doit=1;;
>>> c) export program=ctwm
>>> doit=1;;
>>> d) export program=dwm
>>> doit=1;;
>>> e) export program=evilwm
>>> doit=1;;
>>> p) export program=pwm
>>> doit=1;;
>>> v) export program=vtwm
>>> doit=1;;
>>> esac
>>> if [ "$doit" -eq 1 ]
>>> then
>>> sleep 20 seconds
>>> open -a /Applications/Utilities/X11.app
>>> fi
>>>
>>> This script will run on a second execution, but when run after the imac is initial started, it will start X11.app but not
>>> start the intended window manager from the selection chosen.
>>> Can someone tell me why?
>>>
>>> Richard E. Miles
>>> email@hidden
>>>
>>>
>>>
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> X11-users mailing list (email@hidden)
>>>
>>> This email sent to email@hidden
>>>
>>
>
> Richard E. Miles
> email@hidden
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> X11-users mailing list (email@hidden)
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden