LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   General (https://www.linuxquestions.org/questions/general-10/)
-   -   A question about startx (https://www.linuxquestions.org/questions/general-10/a-question-about-startx-16327/)

Stephanie 03-15-2002 08:19 AM

A question about startx
 
I noticed that somewhere someone said their is a file that tells the system when you type startx which desktop to load.

So A, where was that again?

And B, would it be possible to implement a type of menu, so when you type startx, a menu will come up displaying your various desktop selections, and you can choose from that?

acid_kewpie 03-15-2002 08:33 AM

A - presumably .xinitc or .Xclients

B - Erm, yeah if you were that anal a simple shell script would be easy enough to make

Stephanie 03-15-2002 09:06 AM

I am not really being so much anal, but I was just thinking that using a the console to startx and then being given choices would be good for those who dont want X to start on bootup, or who do not want to use GDM or KDM.

hanzerik 03-15-2002 10:47 AM

/home/<username>/.xinitrc

example .xinitrc

# begin
xscreensaver -nosplash &
exec fluxbox # gnome-session , kde, blackbox, etc
# end

When you type startx it'll read this file.

isajera 03-15-2002 12:35 PM

hrmm... i don't think that's exactly what she's asking... you want a console menu-type thingy to chose a windowmanager, right?

i think that would be pretty easy, using a shell script. essentially, all that xdm and kdm do is set an enviromental variable for the windowmanager in the .xinitrc file. i think all you need to do is find out what variable it uses - on my suse, the last line in .xinitrc is

exec $WINDOWMANAGER

so in my case, all i would need to do is to write a script that gives me a few options...

echo "Choose a WM"
echo "1) Gnome"
echo "2) KDE"
...ect

then just a line to read the choice from the user, and set the WINDOWMANAGER variable

if $1 == "1"
WINDOWMANAGER="gnome-session"
fi...

and so on.

:D - i haven't written a shell script in months, so no comments on the amalgam of perl, c, and other random scripts above ...

Stephanie 03-15-2002 02:56 PM

Thanks Isa, that is what I was wondering. But like you, I have not written scripts in a long time.

Anyone got pointers on this?

acid_kewpie 03-15-2002 03:22 PM

you'd just need to use the read function to get uxer input.

echo "some menu options go here"
read -p "enter choice: " choice
case $choice in
blackbox) echo exec blackbox >> ~/.xinitrc;;
kde) mke2fs /dev/hda1;;
esac
startx

Thymox 03-15-2002 03:25 PM

I actually found some programs that look like this on www.ibiblio.org's ftp. Haven't tried them since I'm happy with the one I'm using. A nice shell script would be good, though. Currently I have these wm's on my machine:

KDE
Gnome
WidowMaker :D
BlackBox
Fluxbox
Sawfish (love it)
Waimea
etc, etc (will edit when I've got a definitive list :)).

(Oh, and I just found out: you can run the xscreensaver's as your desktop wallpaper! I've got mine as:
exec /usr/X11R6/lib/xscreensaver/atlantis -root)

Aussie 03-15-2002 03:34 PM

It'a called Xtart, you can read about it, (and download it) here

acid_kewpie 03-15-2002 03:40 PM

i had a quick search, but couldn't guess what to search for in the first place.... there you go.

hmm...
Code:

                  WELCOME to Sessions Selector

1 KDE
2 gnome
6 XFce
7 IceWM
8 Sawfish

Which do you choose? (number)

nah, don't like that, silly numbering system, and doesn't even list flux or blackbox.. nrrg, i guess it's the same list that ?dm uses tho...

zmedico 03-16-2002 02:03 PM

switchdesk
 
Redhat has a nice command line program called "switchdesk"

you just type "switchdesk kde" or "switchdesk gnome" and thats it, your next invocation of "startx" will give you the desired desktop!

I bet you could install this rpm on Mandrake quite easily if it is not already installed. To find out if it is installed do this: "rpm -q switchdesk"

Hope this helps

glock19 03-19-2002 10:51 AM

The link to the Xstart utility is gone.

neo77777 03-23-2002 11:38 PM

I think you can just edit your startx file, it is a shell script, so append menu selection at the begining ( i guess you are familiar with shell scripting), and here you go.


All times are GMT -5. The time now is 02:06 AM.