LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Arch- Multiple DEs- switch without editing ~/.xinitrc? (https://www.linuxquestions.org/questions/linux-newbie-8/arch-multiple-des-switch-without-editing-%7E-xinitrc-4175501557/)

maples 04-13-2014 12:28 PM

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!

joe_2000 04-13-2014 02:08 PM

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


maples 04-13-2014 02:48 PM

Quote:

Originally Posted by joe_2000 (Post 5151838)
This is something you would configure in your display manager. Which one do you use?

I don't know...How would a :newbie: 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


joe_2000 04-13-2014 03:21 PM

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

joe_2000 04-13-2014 03:25 PM

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...

maples 04-13-2014 03:48 PM

Quote:

Originally Posted by joe_2000 (Post 5151870)
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. :D

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.

joe_2000 04-14-2014 02:29 PM

Have you modified your xinitrc to interpret the first command line argument ($1) similar to the one I posted?

maples 04-14-2014 07:44 PM

No...:redface:...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)


All times are GMT -5. The time now is 05:13 PM.