[Xquartz-dev] How to suppress .xinitrc warning dialog?

Jeremy Huddleston jeremyhu at apple.com
Sun Jun 26 15:41:09 PDT 2011


On Jun 26, 2011, at 11:06, Dave Ray wrote:

> On Sat Jun 25 11:28:06 PDT 2011, Jeremy Huddleston wrote:
>> On Jun 25, 2011, at 11:09, Dave Ray wrote:
>> 
>>> I am creating a pkg installer which includes a custom ~/.xinitrc file on the target machine.
>> 
>> Don't do that!  Use ~/.xinitrc.d scripts
> 
> Ok, fine, I can do that. Will the dialog go away of I do that?

Yes.

> FYI, I am using this startup script  to set the window manager to be something other than quartz-wm.
> 
> Just so I can improve my understanding, if I take the ~/.xinitrc and just rename it and put it in ~/.xinitrc.d, what's the difference? Why is that better?

Search the archives for plenty of discussion on this.  Having ~/.xinitrc means you override *everything* in the global xinitrc rather than just starting a different WM.

> The directory ~/.xinitrc.d doesn't exist by default. Is there any reason to expect that something else will need to go there?

Yes, users can place whatever they want in there to customize their X11 startup.

> My concern is that if I create a script in ~/.xinitrc.d that invokes window manager A, and then sometime in the future another script is placed there that is invoked window manager B, then we have a problem: two window managers will try to be invoked.

Yes.  That would be a problem.  Users of X11 are smart enough to understand this situation.  Just make sure you exec the WM or set the USERWM environment variable.

> If I am trying to create an installer that automates the setup for a different window manager, there's no way for the installer to know which previous startup script has to be disabled in ~/.xinitrc.d.

Please explain what you mean by installer.  What are you trying to do?  If you want to install another WM from a .pkg, just install it.  Let the user choose their WM themselves.

> If ~/.xinitrc.d is used, changing window managers would require editing the files by hand.

Yes, but replacing ~/.xinitrc is much worse because you are nuking the user's existing preferences without prejudice.

> Using ~/.xinitrc seems like a better solution to prevent that condition and allow an automated install. Do you have a suggestion for how the installer can manage the automated window manager change in ~/.xinitrc.d without creating this potential condition?

An installer should not do that.  I would just install the WM and let the user do what they want.  If they want your new WM, they can set USERWM themselves.  If you want to set USERWM for them, then give that as an optional choice in the installer.

--Jeremy



More information about the Xquartz-dev mailing list