what do I write in xinitrc to specify default desktop?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
what do I write in xinitrc to specify default desktop?
I understand I can specify my default desktop manager by editing xinitrc. What's the syntax? My user account didn't seem to have its own xinitrc, so I just copied the one in /etc/X11/xinit to my account. All it says is:
Quote:
#!/bin/sh
# /etc/X11/xinit/xinitrc
#
# global xinitrc file, used by all X sessions started by xinit (startx)
# invoke global X session script
. /etc/X11/Xsession
My system currently starts with Xfce by default, despite that this xinit doesn't specify a desktop. Is that because Xfce was the most recent one I installed?
#!/bin/sh
# xinitrc.xfce - modified to work around xfce4session bug
# https://bugzilla.xfce.org/show_bug.cgi?id=8841
########################################################################
## Merge in defaults and keymaps ##
########################################################################
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
if [ -f $sysresources ]; then
/usr/bin/xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
/usr/bin/xmodmap $sysmodmap
fi
if [ -f $userresources ]; then
/usr/bin/xrdb -merge $userresources
fi
if [ -f $usermodmap ]; then
/usr/bin/xmodmap $usermodmap
fi
########################################################################
## Start xfce Desktop Environment ##
########################################################################
if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
exec ck-launch-session dbus-launch --exit-with-session /usr/bin/startxfce4
else
exec dbus-launch --exit-with-session /usr/bin/startxfce4
fi
And a screenshot of the directory, with the other WMs.
Okay. So I guess the xinitrc.xfce line at the top means the file is called xinitrc.xfce instead of xinitrc? And the system will use it instead of xinitrc? Or does the xinitrc need to contain an instruction to use xintrc.xfce?
Last edited by newbiesforever; 04-05-2013 at 12:07 PM.
Okay. So I guess the xinitrc.xfce line at the top means the file is called xinitrc.xfce instead of xinitrc? And the system will use it instead of xinitrc? Or does the xinitrc need to contain an instruction to use xintrc.xfce?
That filename is actually "xinitrc". But it's specifying using xfce. You will notice the separate files for each WM/DE in the screenshot.
Most distros will give you a (GUI) method to start one or another at the login manager. In Slackware, I choose by typing in the terminal:
Code:
$ xwmconfig
And then choosing from the available options, which would then change "xinitrc" to reflect that choice.
Last edited by JWJones; 04-05-2013 at 12:38 PM.
Reason: clarity
Okay, thanks. I haven't tried restarting X yet, but my own .xinitrc now says:
Code:
#!/bin/sh
# /etc/X11/xinit/xinitrc
#
# global xinitrc file, used by all X sessions started by xinit (startx)
# invoke global X session script
. /etc/X11/Xsession
exec icewm
...but that doesn't work. It only does nothing for about 30 seconds, then starts Xfce.
Last edited by newbiesforever; 04-05-2013 at 02:51 PM.
Not that "fluxbox" did not work. I went to the Fluxbox site and learned that I needed to use "startfluxbox." The rest of Fluxbox's startup is handled by Fluxbox's own ~/.fluxbox/startup and ~/.fluxbox/init files. (All the other lines are there to start FVWM, which I played with for a few months out of curiosity.)
My Debian .xinitrc file is much simpler than Slackware's .xinitrc, I think because Slackware's must be prepared to understand choices made with Slackware's xwmconfig script.
The Arch wiki, always a great reference, has a good article on .xinitrc.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.