Click to See Complete Forum and Search --> : X11 startup file independent of GNOME/KDE ?


MDesigner
07-17-2004, 02:30 AM
I was wondering why .xinitrc doesn't work. I use GNOME 2.6.2. I know I can use the GNOME Session Manager, but I'm looking for another way to do that, by editing a text file of some kind. Is there any other way?

Loki3
07-17-2004, 03:55 AM
Well if you're not running XServer by the startx command .xinitrc won't work. If your using GDM or KDM try looking at your ~/.xsessions file.

MDesigner
07-17-2004, 04:56 AM
Nope. I put "sleep 800 &" in my .xsessions file, logged in (via GDM).. and did "ps ax" but didn't see the sleep command running.
There must be something else..

angustia
07-17-2004, 11:51 AM
.xsession and
in gdm select "predeterminada del sistema" (system default?, i've got it in spanish).

first try loggin in console mode, and be sure that it works with startx.

angustia
07-17-2004, 11:55 AM
and "exec" must be only at the last line.

MDesigner
07-25-2004, 04:27 PM
I don't see a "system default" in gdmsetup, if that's what you mean..

JohnT
07-25-2004, 04:40 PM
Are you just wanting another display manager other than KDE or Gnome? Am I understanding you correctly?

MDesigner
07-25-2004, 04:53 PM
No, I love GNOME :)

I want certain commands (X based commands like numlockx and xset) to run when I log into GNOME..but without using the GNOME Session Manager thing. Something like ~/.xinitrc or ~/.xsession... something I can edit and add some commands like "numlockx &". But those files don't seem to be executed when GNOME starts.

JohnT
07-25-2004, 05:17 PM
Originally posted by MDesigner
No, I love GNOME :)

I want certain commands (X based commands like numlockx and xset) to run when I log into GNOME..but without using the GNOME Session Manager thing. Something like ~/.xinitrc or ~/.xsession... something I can edit and add some commands like "numlockx &". But those files don't seem to be executed when GNOME starts. You want to use the GDM, but not use the session manger for these extra apps? Thats one reason I dont use a DM...not enough control over the start-up procedure. I always use just plain old vanilla "startx".
Try and create a ~/.Xresources and see that /etc/X11/gdm/Xsession contains a line:allow-user-resources some say it works.

angustia
07-25-2004, 05:23 PM
first be sure that it works with startx

MDesigner
07-25-2004, 06:49 PM
John,

I like the GDM though.. so there's no way of having a startup file like I describe? I thought .Xresources just specifies settings for certain apps.

JohnT
07-25-2004, 10:37 PM
Originally posted by MDesigner
John,

I like the GDM though.. so there's no way of having a startup file like I describe? I thought .Xresources just specifies settings for certain apps. Try it...it wont break anything.:D

angustia
07-26-2004, 11:48 AM
if its gdm 2.6^ , the sessions are in /usr/share/xsession (this is Debian), they're .desktop files, inside in the Exec entry, put the path to a script in /usr/bin or /usr/local, that script must be ending with "exec gnome-session" and must be executable. In other versions of gdm, the files are in /etc/gdm/Sessions

XiaoKJ
07-26-2004, 12:46 PM
For numlockx, RTFM! it says it must be added to Xsetup_0 to work, and Xsession too. (in /etc/xdm)

For kdm, check /opt/kde/app/kdm/.... I forgot, but its somewhere there. Its related.

For some systems, just manually edit that startup file for the WM and add it to the bottom.

rbrimhall
07-26-2004, 01:37 PM
Wouldn't these be .Xdefaults, .Xmodmap, et al? All of the xinitrc's included with slack look for these files in a users ~/ and run them if applicable... I'm not sure if this is what you mean... anyways, look in /etc/X11/xinit/ for the xinitrc's for each of the WM's...

MDesigner
07-26-2004, 01:45 PM
I don't trust numlockx's manual. The startup scripts really depend on which WM you're using, don't they? KDM vs. GNOME vs. whatever. I looked at the Xsession file and it didn't look relevant. How can the manual just tell you "hey, put numlockx in here," when they have no clue if I'm using XOrg or XFree86, or GNOME, or KDE, Xfce, etc.

However, /etc/X11/xinit/xinitrc looked pretty relevant. When is that executed exactly? When a user logs into X?

I also found some other interesting files in /etc/X11/gdm.. there are folders called Init, PostLogin, PostSession, and PreSession. It looks like you can have scripts in there run at those times. I'll try playing with those as well.

rbrimhall
07-26-2004, 02:01 PM
xinitrc is created when you run xwmconfig as root... a .xinitrc is created when you run xwmconfig as a user. Pretty sure they are run when you log in to the default session (ie, you don't select a wm from the sessions menu of gdm).

MDesigner
07-26-2004, 02:04 PM
Originally posted by lupin_the_3rd
xinitrc is created when you run xwmconfig as root... a .xinitrc is created when you run xwmconfig as a user. Pretty sure they are run when you log in to the default session (ie, you don't select a wm from the sessions menu of gdm).

I already tried having an ~/.xinitrc file.. that didn't work. I'll try the above suggestions though.

MDesigner
07-26-2004, 02:17 PM
Aha..figured it out. ~/.xprofile is what works. Figured it out by checking out /etc/X11/gdm/Xsession. xdm/Xsession also has the reference to .xprofile. ~/.xprofile and /etc/xprofile are both executed. This may just apply to XOrg.. I'm not totally sure.

But it works!

Thanks for pointing me in the right direction.