LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-13-2014, 01:28 PM   #1
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 813

Rep: Reputation: 264Reputation: 264Reputation: 264
Arch- Multiple DEs- switch without editing ~/.xinitrc?


Hi!
I just installed Arch Linux on an Eee PC this weekend. So far, it's gone good! I had one question that I haven't quite found an answer to. I have LXDE and Xfce4 installed, and I switch between the two a lot. As of now, I have to commennt/uncomment lines in my ~/.xinitrc file to switch between the two.. I was hoping that there would be something like Slackware's "xwm-config" but that command doesn't exist. Is there something I'm missing, or should I look into writing my first seme-useful shell script?

Thanks!
 
Old 04-13-2014, 03:08 PM   #2
joe_2000
Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Arch, Debian
Posts: 843

Rep: Reputation: 242Reputation: 242Reputation: 242
This is something you would configure in your display manager. Which one do you use?

Anyway it's supposed to launch X with the right DE parameter. This gets picked up by the xinitrc. E.g. mine looks like this:

Code:
#!/bin/bash
DEFAULT_SESSION="openbox-session"

case $1 in
kde)
        /etc/X11/Xsession startkde
        ;;  
gnome)
        /etc/X11/Xsession gnome-session
        ;;  
xfce)
        /etc/X11/Xsession startxfce4
        ;;  
openbox)
        /etc/X11/Xsession openbox-session
        ;;  
fluxbox)
        /etc/X11/Xsession startfluxbox
        ;;  
xmonad)
        /etc/X11/Xsession xmonad
        ;;  
dwm)
        /etc/X11/Xsession dwm 
        ;;  
wmii)
        /etc/X11/Xsession wmii
        ;;  
awesome)
        /etc/X11/Xsession awesome
        ;;  
*)
        /etc/X11/Xsession $DEFAULT_SESSION
        ;;  
esac
EDIT:

In case you are using slim (which is the default of crunchbang, which I am using, quite nice btw), you can configure this in /etc/slim.conf
See below the relevant sections of my slim.conf
Code:
 Commands executed when starting and exiting a session.
# They can be used for registering a X11 session with
# sessreg. You can use the %user variable
#
sessionstart_cmd        /usr/share/crunchbang/cb-user-setup %user

# Available sessions (first one is the default).
# The current chosen session name is replaced in the login_cmd
# above, so your login command can handle different sessions.
# see the xinitrc.sample file shipped with slim sources
sessions            openbox-session,xmonad,dwm,wmii,awesome

Last edited by joe_2000; 04-13-2014 at 03:12 PM. Reason: Added slim config
 
Old 04-13-2014, 03:48 PM   #3
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 813

Original Poster
Rep: Reputation: 264Reputation: 264Reputation: 264
Quote:
Originally Posted by joe_2000 View Post
This is something you would configure in your display manager. Which one do you use?
I don't know...How would a find out?
I have XFCE4 and LXDE as desktop environments. I think LXDE uses Openbox, not sure about XFCE4.

I think I installed XFCe first, but again I'm not sure.

Here's my .xinitrc, I just comment/uncomment the last 2 lines where appropriate:
Code:
[anthony@anthony-eee ~]$ cat .xinitrc 
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

exec startxfce4
#exec startlxde
 
Old 04-13-2014, 04:21 PM   #4
joe_2000
Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Arch, Debian
Posts: 843

Rep: Reputation: 242Reputation: 242Reputation: 242
How do you start your X session? Do you boot into cli and type startx? That would mean you are using no display manager at all...

Otherwise it's probably stated in
Code:
/etc/X11/default-display-manager
 
Old 04-13-2014, 04:25 PM   #5
joe_2000
Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Arch, Debian
Posts: 843

Rep: Reputation: 242Reputation: 242Reputation: 242
Just tried startx with an argument, which works, too.

So in case you are not using a display manager you could use an xinitrc similar to mine and do

Code:
startx xfce4
and
Code:
startx lxde
Alternatively, you may want to install slim. It's nice because it's very lightweight and configurable...
 
Old 04-13-2014, 04:48 PM   #6
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 813

Original Poster
Rep: Reputation: 264Reputation: 264Reputation: 264
Quote:
Originally Posted by joe_2000 View Post
How do you start your X session? Do you boot into cli and type startx? That would mean you are using no display manager at all...
I have CLI login and type 'startx' to start the gui. I would prefer to keep it, mostly because I like it, but it keeps my (computer-illiterate) sisters out of everything even if they guess my password.

Quote:
Just tried startx with an argument, which works, too.

So in case you are not using a display manager you could use an xinitrc similar to mine and do

Code:
Code:
startx xfce4
and
Code:
startx lxde
Alternatively, you may want to install slim. It's nice because it's very lightweight and configurable...
For whatever reason, regardless of whatever I type as an argument to startx, it just starts the gui specified in the .xinitrc file. Even
Code:
startx --help
goes straight into the desktop.
 
Old 04-14-2014, 03:29 PM   #7
joe_2000
Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Arch, Debian
Posts: 843

Rep: Reputation: 242Reputation: 242Reputation: 242
Have you modified your xinitrc to interpret the first command line argument ($1) similar to the one I posted?
 
Old 04-14-2014, 08:44 PM   #8
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 813

Original Poster
Rep: Reputation: 264Reputation: 264Reputation: 264
No......that's probably why.

I'll try to look into that tomorrow, but I can't guarantee it, I have a lot going on at school right now (the robotics team that I'm a member of is going to St. Louis for world championships in a week!...and oh, yeah, there's that pesky homework too)
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing the Arch iso barnac1e Arch 2 02-12-2012 05:51 AM
How can I start a program when gnome loads w/out editing .xinitrc for all users? DaneM Linux - Software 3 07-01-2006 12:31 AM
gdm and multiple WMs/DEs Vigacmoe Linux - Software 2 03-15-2006 11:20 PM
video editing in arch linux? greythorne Arch 4 07-28-2005 08:19 PM
editing .xinitrc question bosewicht Linux - Newbie 1 04-04-2004 03:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:33 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration