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? |
A - presumably .xinitc or .Xclients
B - Erm, yeah if you were that anal a simple shell script would be easy enough to make |
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.
|
/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. |
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 ... |
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? |
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 |
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) |
It'a called Xtart, you can read about it, (and download it) here
|
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 |
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 |
The link to the Xstart utility is gone.
|
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. |