LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 04-05-2013, 10:57 AM   #1
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,375

Rep: Reputation: Disabled
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?
 
Old 04-05-2013, 11:55 AM   #2
JWJones
Senior Member
 
Registered: Jun 2009
Posts: 1,444

Rep: Reputation: 709Reputation: 709Reputation: 709Reputation: 709Reputation: 709Reputation: 709Reputation: 709
Here's what mine looks like (Slackware 14):

Code:
#!/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.
Attached Thumbnails
Click image for larger version

Name:	Screenshot - 04052013.png
Views:	50
Size:	64.6 KB
ID:	12228  
 
1 members found this post helpful.
Old 04-05-2013, 12:05 PM   #3
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,375

Original Poster
Rep: Reputation: Disabled
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.
 
Old 04-05-2013, 12:24 PM   #4
JWJones
Senior Member
 
Registered: Jun 2009
Posts: 1,444

Rep: Reputation: 709Reputation: 709Reputation: 709Reputation: 709Reputation: 709Reputation: 709Reputation: 709
Quote:
Originally Posted by newbiesforever View Post
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
 
Old 04-05-2013, 02:18 PM   #5
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,137
Blog Entries: 6

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
User .xinitrc is hidden
Code:
ls -a | grep xinit
.xinitrc
~/.xinitrc can be as simple as
Code:
exec fluxbox
Start your X session with startx or xinit

Or if you want a diplay mgr, point ~/.xinitrc to it.

http://wiki.xfce.org/tips
http://forum.manjaro.org/index.php?topic=651.0
https://wiki.archlinux.org/index.php/Xfce
http://www.gentoo.org/doc/en/xfce-config.xml
 
1 members found this post helpful.
Old 04-05-2013, 02:32 PM   #6
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,375

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by teckk View Post
~/.xinitrc can be as simple as
Code:
exec fluxbox
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.
 
Old 04-06-2013, 09:20 AM   #7
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,137
Blog Entries: 6

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
Your ~/.xinitrc should not be a sh script.

If you want icewm when you run xinit then something like
Code:
exec icewm
That's it. You may need to use the whole path
Code:
exec /usr/bin/icewm
What flavor of Linux are you using? That will help a member zero in on it for you.

http://www.icewm.org/manual/icewm-3.html
http://celettu.wordpress.com/icewm-guide/
http://www.icewm.org/FAQ/
 
1 members found this post helpful.
Old 04-06-2013, 02:16 PM   #8
Captain Pinkeye
Member
 
Registered: Oct 2012
Location: The Czech Republic
Posts: 280

Rep: Reputation: 98
Quote:
My system currently starts with Xfce by default, despite that this xinit doesn't specify a desktop.
AFAIK .xinitrc work only with startx command. What distro do you have? What init level do you use (do you boot into some X or plain terminal)?

Archwiki has very good info on this matter.

Last edited by Captain Pinkeye; 04-06-2013 at 02:18 PM.
 
Old 04-06-2013, 08:47 PM   #9
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,375

Original Poster
Rep: Reputation: Disabled
I'm using antiX.
 
Old 04-06-2013, 09:20 PM   #10
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,323
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
If you are using a graphical login manager, such as GDM, it normally will allow you to select your session.

If you want to control sessions through .xinitrc, you commonly need to disable to graphical display manager.

That's what I did on my Debian box. Here's my .xinitrc:

Code:
# gkrellm &
# /home/frankbell/scripts/wallpaper.sh &
# exec fvwm-themes-start
exec startfluxbox
# exec fvwm-crystal
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.

Last edited by frankbell; 04-06-2013 at 09:25 PM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
set default sh and xinitrc problems provkitir Debian 3 01-20-2005 10:12 PM
desktop switching not clean after .xinitrc creation gp42 Mandriva 3 08-22-2004 10:14 PM
Default xinitrc please oneandoneis2 Slackware 3 06-29-2004 05:15 PM
How to change Desktop environment, xinitrc & xsession TheBartman Debian 5 03-31-2004 10:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration