You are not logged in.

#1 2009-05-21 09:30:53

andu
Member
Registered: 2009-05-01
Posts: 16

switch DE-s from grub

well,

I am running kde4 right now, but sometimes I would like to quickly use smth lighter like fluxbox or awsome,

So I am figuring is there any method to switch which DE to use from grub?

I know that for example in Knoppix you could easily change DE during bootup, just Desktop="fluxbox" for an example.

all ideas are welcome,
cheers.

Offline

#2 2009-05-21 09:46:48

HashBox
Member
Registered: 2009-01-22
Posts: 271

Re: switch DE-s from grub

Sorry I can't help directly, but I was reading a page on the Arch wiki that had some pointers for this exact set up. I think it involves doing something with init, but that's about all I can say off hand. If I find the article I'll edit my post here.

EDIT: Ok I can't find the exact article, but this http://wiki.archlinux.org/index.php/Add … on_startup seems to have some relevant info. Basically with this method you can set different window managers to different runlevels and then set the runlevel from grub.

Last edited by HashBox (2009-05-21 09:57:19)

Offline

#3 2009-05-21 09:56:50

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: switch DE-s from grub

Couldnt you just switch sessions in KDM? Why go all the way back to grub?

Offline

#4 2009-05-21 10:29:04

andu
Member
Registered: 2009-05-01
Posts: 16

Re: switch DE-s from grub

no no, I dont think go back to it, I just think to run fluxbox directly from grub during computer startup.

thx  HashBox, it actually gave me an idea, I know that I am new to Arch but as I remember, there was that way to change init level from grub and now I`ll say which DE to use as well,
please fix me:

kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/4444e5c9-9958-4b8e-af94-36edc8bdbfb9 ro 5:respawn:/usr/bin/fluxbox

cheers.

Last edited by andu (2009-05-21 13:30:30)

Offline

#5 2009-05-21 10:56:30

ak-89
Member
From: Finland
Registered: 2008-08-26
Posts: 86
Website

Re: switch DE-s from grub

andu wrote:

kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/4444e5c9-9958-4b8e-af94-36edc8bdbfb9 ro 5:respawn:/usr/bin/fluxbox

cheers.

How can fluxbox start if there is no X running? And if you start it like that it will start as root. I don't even know can it be started like that.

You should make some script that asks what DE/WM to use when X starts. Little bash scripting with help of zenity at the end of xinitrc, instead of just simply executing WM/DE.


//edit:
Something like this, I don't know if kde/gnome command are right, but this is just an example.

WM=$(zenity --list --column=DEs/WMs --text="Select DE/WM of your choice" KDE GNOME Openbox)
if [ $WM == "KDE" ];then exec kde-session
elif [ $WM == "GNOME" ]; then exec gnome-session
elif [ $WM == "Openbox" ]; then exec openbox
fi

Last edited by ak-89 (2009-05-21 11:23:09)

Offline

#6 2009-05-22 01:10:28

ao
Member
From: 青
Registered: 2008-02-02
Posts: 16

Re: switch DE-s from grub

Here's kind of a hackish way to do that by referencing the kernel commandline:

COMMANDLINE=`dmesg | grep "Kernel command line"`

if   [ `echo $COMMANDLINE | grep -c kde` == 1 ]; then exec kde-session
elif [ `echo $COMMANDLINE | grep -c gnome` == 1 ]; then exec gnome-session
elif [ `echo $COMMANDLINE | grep -c openbox` == 1 ]; then exec openbox
fi

I haven't tested that for syntax or validity, but the theory is sound.  And there's probably a better way to retrieve the kernel commandline.  But oh well.

Offline

#7 2009-05-22 06:15:01

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: switch DE-s from grub

But as already mentioned, none of this can happen until X starts, so why not use the conventional method of selecting WM/DE from KDM/Slim/etc?

Offline

#8 2009-05-22 06:44:36

HashBox
Member
Registered: 2009-01-22
Posts: 271

Re: switch DE-s from grub

@ao you can use cat /proc/cmdline smile

Offline

#9 2009-05-22 07:55:05

Primoz
Member
From: Ljubljana-Slovena-EU
Registered: 2009-03-04
Posts: 688

Re: switch DE-s from grub

I would need this too, but not for DE switching, I think that *should* be done from KDM or similar, but for watching TV.
I have IPTV which I can view with VLC and I added it to xinitrc, so that if that xinit or startx starts VLC with IPTV playlist.
Anyway I would like to have it in Grub as it would simplify the whole only watching TV thing...
So if I understand correctly starting DE/WM from Grub won't work because X wouldn't be started and if it would it would be under root, not normal user.
But what if I would to start X, or in my case xinti with only VLC playing the IPTV playlist, then what?
Would that work?


Arch x86_64 ATI AMD APU KDE frameworks 5
---------------------------------
Whatever I do, I always end up with something horribly mis-configured.

Offline

#10 2009-05-22 11:19:36

markc
Member
From: Gold Coast, Australia
Registered: 2007-05-15
Posts: 502
Website

Re: switch DE-s from grub

Why not try something like su - userid -c 'startx' in /etc/rc.local (within perhaps some bash case switch) and put exec vlc playlist in ~/.xinitrc.

Offline

#11 2009-05-22 21:14:01

ao
Member
From: 青
Registered: 2008-02-02
Posts: 16

Re: switch DE-s from grub

@HashBox - we're talking reading the kernel commandline, rather than the commandline of any old process'
@tomk - this would be in the xinitrc and X would be started on boot, either as markc says, or like: http://wiki.archlinux.org/index.php/Sta … logging_in

Offline

#12 2009-05-22 22:04:40

HashBox
Member
Registered: 2009-01-22
Posts: 271

Re: switch DE-s from grub

@ao: I'm aware of that, have to tried to read /proc/cmdline? on my machine it gives me "root=/dev/disk/by-uuid/0b46821a-624e-459f-b3f7-468c111f3325 ro vga=792 acpi=off apm=off noacpi noapm" which are my kernel parameters.

Offline

#13 2009-05-23 00:41:11

ao
Member
From: 青
Registered: 2008-02-02
Posts: 16

Re: switch DE-s from grub

Oops, I have /proc/*/cmdline on the brain big_smile  Thank you!

Offline

Board footer

Powered by FluxBB