/etc/X11/Sessions/Gnome has a bug in following results it cannot run ~/.xinitrc. # run all system xinitrc shell scripts. if [ -d /etc/X11/xinit/xinitrc.d ]; then for i in /etc/X11/xinit/xinitrc.d/* ; do if [ -x "$i" ]; then . "$i" fi done fi The bug is caused by the fact that there is no directory named xinitrc.d under /etc/X11/xinit/ except a script file named xinitrc. In /etc/X11/xinit/xinitrc, ~/.xinitrc is checked and executed if exits. Becaused of this bug, ~/.xinitrc will not be checked and executed. So either make a directory named xinitrc.d under /etc/X11/xinit/ and put /etc/X11/xinit/xinitrc under /etc/X11/xinit/xinitrc.d/ or just modify the above code in /etc/X11/Sessions/Gnome as below will check and execute ~/.xinitrc. # run all system xinitrc shell scripts. if [ -d /etc/X11/xinit/xinitrc.d ]; then for i in /etc/X11/xinit/xinitrc.d/* ; do if [ -x "$i" ]; then . "$i" fi done # check ~/.xinitrc elif [ -f $HOME/.xinitrc ]; then exec /bin/sh "$HOME/.xinitrc" fi
On another note, the Gnome script in /etc/X11/Sessions doesn't properly set up its environment before starting the desktop. This became apparent to me when launching a KDE program from within GNOME, and noticing that none of the kde-env environment variables were present in my GNOME session.
i'm tempted to mark this invalid/wontfix because : 1. If you choose a Gnome session in GDM, then you should be using ~/.gnomerc instead of ~/.xinitrc 2. If you don't want to launch gnome-session, then you should choose "xsession" as your session in GDM and use ~/.xsession instead. 3. I've always thought that ~/.xinitrc was only for when X is started from the console using "startx". Brad, I don't understand why KDE environment variables should be in the Gnome init script. Shouldn't you be putting those varibles in your .bash_profile or such? Or am I missing the point?
Yes, you are. One of the greater nuisances caused by this code is that people have to maintain two system-wide Xmodmap (and possibly other config) files: "/etc/X11/Sessions/Gnome" assumes "/etc/X11/Xmodmap" for system-wide configuration, where "/etc/X11/xinit/xinitrc" searches for "/etc/X11/xinit/.Xmodmap". At least we should setup a symlink from one file to the other to ensure only one configuration file; OTOH it would be a much cleaner solution to unify xinit-related stuff (such as xmodmap, xrdb and the like) in *one* place rather than enforcing painful config clutter (as, in fact, being the current situation). So there three options: 1. Symlink /etc/X11/Xmodmap to /etc/X11/xinit/.Xmodmap. This seems to be the easiest one, but it's neither portable nor safe to future changes. Furthermore, vanilla X11 installations don't have this file; we then have to create it during emerge or live with a dead symlink until the user creates the link target. 2. Change "/etc/X11/Sessions/Gnome" (and wherever else necessary) to look in "/etc/X11/xinit" directly instead of "/etc/X11/xinit/xinitrc.d". This is nice and clean, but we lose the possibilities of the additional level of indirection. OTOH I'm not sure if it is used at all. 3. Create "/etc/X11/xinit/xinitrc.d/", symlink "/etc/X11/xinit/xinitrc.d/default" to "/etc/X11/xinit/xinitrc" and remove xinit-related stuff from "/etc/X11/Sessions/Gnome" (and wherever else necessary). This seems to be the cleanest solution, as it respects the "traditional way" to setup system-wide xinit-related stuff via "/etc/X11/xinit/xinitrc" and separates X-related configuration from DM-related configuration. IMHO, we should choose between 2. and 3., depending on whether the additional level of "indirection" through "xinitrc.d" is needed or not. Opinions, anyone?
Oops, I made a slight mistake in my previous comment. It should read: [...] 2. Change "/etc/X11/Sessions/Gnome" (and wherever else necessary) to look in "/etc/X11/xinit" directly instead of "/etc/X11/xinit/xinitrc.d" _and remove xinit-related stuff from "/etc/X11/Sessions/Gnome" (and wherever else necessary)_. This is nice and clean, as it separates xinit-stuff from DM-stuff; we still give up the possibilities of the additional level of indirection. OTOH I'm not sure if it is used at all. 3. Create "/etc/X11/xinit/xinitrc.d/", symlink "/etc/X11/xinit/xinitrc.d/default" to "/etc/X11/xinit/xinitrc" and remove xinit-related stuff from "/etc/X11/Sessions/Gnome" (and wherever else necessary). This seems to be the cleanest solution, as it respects the "traditional way" to setup system-wide xinit-related stuff via "/etc/X11/xinit/xinitrc" and separates X-related configuration from DM-related configuration. Sorry for the mistake.
So basically this comes down to a conflict caused by the following situation: /etc/X11/Sessions/Gnome has these lines: #---- sysresources=/etc/X11/Xresources sysmodmap=/etc/X11/Xmodmap sysxkbmap=/etc/X11/Xkbmap #---- while /etc/X11/xinit/xinitrc has: #---- xinitdir=/usr/X11R6/lib/X11/xinit sysresources=$xinitdir/.Xresources sysmodmap=$xinitdir/.Xmodmap #---- x11 guys: Do you have any suggestions? Should we modify our Gnome session script? Also worth checking out bug #89624 while we're at it.
I like #3 personally. It would appear that this would align well with what some other distributions (IE, Fedora and thus I'm sure many others) are doing.
I like 3 as well, Donnie?
Created attachment 67948 [details] xinitrc-common I think 3 is along the right track, and now that upstream is (almost) modular, I think we could get some code together (perhaps from redhat) and send a patch up. Also in modular, Josh, could you change xinitdir=/usr/X11R6/lib/X11/xinit to xinitdir=/etc/X11 and see what happens? That will at least fix up comment #5. For reference, I've attached the main part of fedora's xinitrc-common file, which is "common code shared between the Xsession and xinitrc scripts which has been factored out to avoid duplication."
I just uploaded http://dev.gentoo.org/~spyderous/xorg-x11/redhat/xinitrc-4.0.19-1/, which is the latest development Fedora release, for anyone who's interested in perusing it.
(In reply to comment #8) > Also in modular, Josh, could you change xinitdir=/usr/X11R6/lib/X11/xinit to > xinitdir=/etc/X11 and see what happens? That will at least fix up comment #5. This has been committed to modular.
you I love old bugs :) So what is the status of this ? I see that the "/etc/X11/xinit/xinitrc.d/" directory exists but there is just a script for dbus in it.
Closing time?;)
Yeah :) To all, feel free to reopen if it's still an issue.