How to make startx use alternate xinitrc?
According to the xinit
man page that I read, xinit
(and thereby startx
) looks in its command line parameters for a client program to run. If it doesn't find one, it runs ~/.xinitrc
instead. So you should be able to write
startx path/to/my_alternate_xinitrc
and it will do what you want. You will need to provide a path, though, and not just a filename. In my testing, startx ./my_xinitrc
worked but startx my_xinitrc
did not.
Related videos on Youtube
phunehehe
Updated on September 17, 2022Comments
-
phunehehe almost 2 years
I don't have a desktop manager installed (and I don't want to). After logging in through the terminal I use
startx
to start the GUI. I have entries in~/.xinitrc
for my GUI sessions. Right now I have xmonad in there, but sometimes I want to run a GNOME session, and sometimes a KDE session. I used to edit~/.xinitrc
for that purpose, but I think there should be a more elegant way (something like using alternate configurations). However, I can't find anything inman startx
orman xinit
.I plan to have several configuration files (one for each GUI session), and then tell
startx
to load them when I want. How can I do that? -
phunehehe over 13 yearsThe file name thing is weird, anyway this answer works for me, thanks!
-
Leo about 5 yearsIn my case the path must be absolute. The relative paths not work.