LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-10-2003, 08:45 PM   #1
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Rep: Reputation: 168Reputation: 168
script for startx


this may be a ? more for the programing forum, but, i'll take my chances here. is there, or, could i write a script (my programing experience is limited( a little html and a little visual basic) i have recently delved into perl(still learning)) that would give me the option of which window manager loads when i startx? i understand wfmconfig and have successfully used it to explore different window managers just for the heck of it (learning). i'm just wondering if i could talk slack into asking me which wm to load when i startx. anyone who reads this, understand , it is not imperitive, i'm not in dire need of help here. just curios. thx in advance.
 
Old 12-10-2003, 09:01 PM   #2
Tyir
Member
 
Registered: Sep 2003
Distribution: Slackware 9.1 with fluxbox
Posts: 259

Rep: Reputation: 30
I'm not sure exactly what you mean, but what i do is edit my ~/.xinitric file for whic WM to load when you do startx to start

Just put them all there, comment them all out, and uncomment the one you want to use.
 
Old 12-10-2003, 09:17 PM   #3
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Original Poster
Rep: Reputation: 168Reputation: 168
thx for the response. what i mean is i can run wfmconfig every time i log in. what i'd like to do is get some kind of script or config that when i type startx...the sys asks me which wm to load. kinda like when i was running mandrake, and, could just pick a dropdown box for which session to run, but different in that i always start from the command line (now). I'd ultimatly like to type startx and have the sys ask which wm would you like to load? it may be a stretch, but, i'm learning and the more i learn about how configurable the linux sys is the more ? i have as to what i can really config the sys to do. again just curious, not in any trouble, just learning.

Last edited by Peacedog; 12-10-2003 at 09:33 PM.
 
Old 12-10-2003, 09:54 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
One way of dealing with that would be to edit
/usr/X11R6/bin/startx...
Where it says
Code:
userclientrc=$HOME/.xinitrc
you could make like 5 similar entries, corresponding
to five similar .xinitrcX files in the users home.
Code:
userclientrc1=$HOME/.xinitrc1
userclientrc2=$HOME/.xinitrc2
userclientrc3=$HOME/.xinitrc3
userclientrc4=$HOME/.xinitrc4
userclientrc5=$HOME/.xinitrc5

echo "1 = Fluxbox"
echo "2 = Blackbox"
echo "3 = Openbox"
echo "4 = IceWM"
echo "5 = Ratpoison"
echo "Press a number and <Enter>"
read selection

case "$selection" in
  "1"   ) userclientrc=$userclientrc1;;
  "2"   ) userclientrc=$userclientrc2;;
  "3"   ) userclientrc=$userclientrc3;;
  "4"   ) userclientrc=$userclientrc4;;
  "5"   ) userclientrc=$userclientrc5;;
esac

Is that what you meant? :)


Cheers,
Tink
 
Old 12-11-2003, 01:39 AM   #5
Shade
Senior Member
 
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
Tink nails it.

Another way wouldbe to write another script.... Actually, an alias might work.

alias xstart="xwmconfig; startx"

then try to use xstart.

If that works, you can define that alias in your .bash_profile or elsewhere.
-Shade
 
Old 12-11-2003, 06:42 AM   #6
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Original Poster
Rep: Reputation: 168Reputation: 168
Quote:
originally posted by Tinkster
Is that what you meant?
Quote:
Another way wouldbe to write another script.... Actually, an alias might work.
that's exactly what i'm trying to do. i'll give both a try and post the results. thx Tinkster you truly are a guru. also thx Shade. i love being part of something (this forum) where there is so much information, and so many individuals just waiting to help someone learn. thx again.
 
Old 12-11-2003, 01:30 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
From what I understand the disadvantage of
xwmconfig is that it will kill individual settings
that you put in your scripts, though. That is,
if you have .xinitrc start stuff before the actual
windowmanager (like gkrellm or you default
xterm) it will be removed.


Cheers,
Tink
 
Old 12-11-2003, 05:09 PM   #8
Shade
Senior Member
 
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
I believe all xwmconfig does is link xinitrc.whatever to xinitrc in /etc/X11/xinit...

I may be wrong though.
Am I missing something, Tink?

-Shade
 
Old 12-11-2003, 05:59 PM   #9
delta9
Member
 
Registered: Dec 2003
Distribution: Gentoo
Posts: 66

Rep: Reputation: 15
Isn't what you're looking for exactly what xdm, kdm, gdm... do?

Try starting X with one of those commands instead of startx, they give you a choice of which WM to use (btw, xdm = x desktop manager i think)

greetz
 
Old 12-11-2003, 06:02 PM   #10
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Original Poster
Rep: Reputation: 168Reputation: 168
something is going wrong, when i type starx i get the prompt for the options o.k., but, whether i select 1 or 2 i still get gnome. i am posting the edit. also when gnome comes up it's like 4 destops at 1 time w/ no end, or i should say no right side of the screen end. it stops in the middle of the screen and the next desktop stars...etc. 4 times.

Code:
userclientrc1=$HOME/.xinitrc1
userclientrc2=$HOME/.xinitrc2
userclientrc3=$HOME/.xinitrc3
userclientrc4=$HOME/.xinitrc4
userclientrc5=$HOME/.xinitrc5

echo "1 = KDE"
echo "2 = Gnome"
echo "3 = IceWM"
echo "4 = Fluxbox"
echo "Press a number and <Enter>"
read selection

case "$selection" in
  "1"   ) userclientrc=$userclientrc1;;
  "2"   ) userclientrc=$userclientrc2;;
  "3"   ) userclientrc=$userclientrc3;;
  "4"   ) userclientrc=$userclientrc4;;
esac
can anyone see anything wrong with this code. i may have messed it up as i only used the code tink provided as a guide. i thought i followed it pretty closly though. thx.

edit: i tried 3 & 4 also, still getting gnome w/ the above problems.thx

Last edited by Peacedog; 12-11-2003 at 06:09 PM.
 
Old 12-11-2003, 07:48 PM   #11
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
What do your ~/.xinitrcX files look like?


Cheers,
Tink
 
Old 12-11-2003, 07:53 PM   #12
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Quote:
Originally posted by Shade
I believe all xwmconfig does is link xinitrc.whatever to xinitrc in /etc/X11/xinit...

I may be wrong though.
Am I missing something, Tink?

-Shade
Hmmm ...

less `which xwmconfig`

Code:
# Also set up a new $HOME/.xinitrc:
if [ -r /etc/X11/xinit/$OUTPUT -a ! "$HOME" = "/" ]; then
  if [ -r $HOME/.xinitrc ]; then
    rm -f $HOME/.xinitrc-backup
    mv $HOME/.xinitrc $HOME/.xinitrc-backup
  fi
  cat /etc/X11/xinit/$OUTPUT > $HOME/.xinitrc
fi
Nope :)

It does change your ~/.xinitrc if you're not running
as root ... which we don't.



Cheers,
Tink
 
Old 12-12-2003, 06:53 AM   #13
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Original Poster
Rep: Reputation: 168Reputation: 168
Quote:
What do your ~/.xinitrcX files look like?
here is .xinitrc

#!/bin/sh
# $XConsortium: xinitrc.cpp,v 1.4 91/08/22 11:41:34 rws Exp $

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/usr/X11R6/lib/X11/xinit/.Xresources
sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi

if [ -f $userresources ]; then
xrdb -merge $userresources
fi

if [ -f $usermodmap ]; then
xmodmap $usermodmap
fi

# Start the window manager:
startkde
Tinkster did you see anything wrong with the code? also do i need to edit any other files? thx.

Last edited by Peacedog; 12-12-2003 at 08:22 AM.
 
Old 12-12-2003, 01:35 PM   #14
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Peace, that looks fine, even though I don't understand
how it could EVER start up Gnome :) since it says
startkde on the last line ...

The idea would be to have 4 ~/.xintrc's, with 1 to 4
attached and pointing to the respective WM's in
the last line.


Cheers,
Tink
 
Old 12-12-2003, 02:06 PM   #15
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Original Poster
Rep: Reputation: 168Reputation: 168
i'm going to do some more doodling when i get home this afternoon, and try to fix it. i'll post any success. thx again.
 
  


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
Improving the startx script Woodsman Slackware 14 11-05-2005 08:08 AM
WHY should I type startx twice to startx? hiux Debian 6 09-09-2005 09:12 AM
startx doesn't startx for user vdemuth Mandriva 10 11-08-2004 07:41 PM
Bug / Xwindows / startx : xinit works but startx crash www.rzr.free.fr Linux - Software 4 10-17-2004 08:06 AM
startx vs startx -- :2 (font dimension is different!!) moly82 Linux - General 7 09-15-2003 12:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:11 PM.

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
Open Source Consulting | Domain Registration