LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 11:57 AM   #1
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Glendale, AZ
Distribution: Distro-homeless. Lost.
Posts: 1,884

Rep: Reputation: 62
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, 12:55 PM   #2
JWJones
Member
 
Registered: Jun 2009
Location: Cascadia
Distribution: Slackware, LinuxBBQ, OpenBSD, Mac OSX
Posts: 723

Rep: Reputation: 187Reputation: 187
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 Images
File Type: png Screenshot - 04052013.png (64.6 KB, 19 views)
 
1 members found this post helpful.
Old 04-05-2013, 01:05 PM   #3
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Glendale, AZ
Distribution: Distro-homeless. Lost.
Posts: 1,884

Original Poster
Rep: Reputation: 62
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 01:07 PM.
 
Old 04-05-2013, 01:24 PM   #4
JWJones
Member
 
Registered: Jun 2009
Location: Cascadia
Distribution: Slackware, LinuxBBQ, OpenBSD, Mac OSX
Posts: 723

Rep: Reputation: 187Reputation: 187
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 01:38 PM. Reason: clarity
 
Old 04-05-2013, 03:18 PM   #5
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 1,773

Rep: Reputation: 197Reputation: 197
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, 03:32 PM   #6
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Glendale, AZ
Distribution: Distro-homeless. Lost.
Posts: 1,884

Original Poster
Rep: Reputation: 62
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 03:51 PM.
 
Old 04-06-2013, 10:20 AM   #7
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 1,773

Rep: Reputation: 197Reputation: 197
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, 03:16 PM   #8
Captain Pinkeye
Member
 
Registered: Oct 2012
Location: The Czech Republic
Posts: 201

Rep: Reputation: Disabled
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 03:18 PM.
 
Old 04-06-2013, 09:47 PM   #9
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Glendale, AZ
Distribution: Distro-homeless. Lost.
Posts: 1,884

Original Poster
Rep: Reputation: 62
I'm using antiX.
 
Old 04-06-2013, 10:20 PM   #10
frankbell
Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Mageia, Mint
Posts: 8,230

Rep: Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552
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 10:25 PM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 11:12 PM
desktop switching not clean after .xinitrc creation gp42 Mandriva 3 08-22-2004 11:14 PM
Default xinitrc please oneandoneis2 Slackware 3 06-29-2004 06:15 PM
How to change Desktop environment, xinitrc & xsession TheBartman Debian 5 03-31-2004 11:04 PM


All times are GMT -5. The time now is 12:04 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration