LinuxQuestions.org
Review your favorite Linux distribution.
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 08-03-2004, 07:51 AM   #1
suslik
Member
 
Registered: Jul 2004
Distribution: OpenSuse 10.x
Posts: 262

Rep: Reputation: 30
Question Fast User Switching or Multiple X login screens - How?


I was trying to achieve Windows XP style "Fast User Switching" using multiple Xwindows screens, similar to what Xandros does.

I am satisfied with what I achieved (bellow), but would like to perfect it further (further bellow).

Rules:
1. I run strictly GUI, no tty logins followed by startx -- :1 would satisfy.
2. My preferred stream is KDM > KDE.

What I achieved:
As suggested on this excellent site I put the following 2 lines into my /opt/kde/share/conf/kdm/Xservers file
Code:
:0 local /usr/bin/X11/X :0 vt7
:1 local /usr/bin/X11/X :1 vt8
Now 2 KDMs start, one on vt7 (CTRL+ALT+F7), the other on vt8 (CTRL+ALT+F8). This way i can work as normal user on default vt7, and have my wife or me with root log in on vt8 without logging out off on vt7.

The "HOW DO I...?" portion
1. Xandros somehow allows switching vt's using a menu or a button or something... Any one knows where to get it? I skimmed Freshmeat and Sourceforge without luck.

2. This present set up is wasteful and unflexible.
a. It runs an extra KDM which is good to have, but unneeded most of the time.
b. only allows for 2 logins. More logins require hand tweaking and more mostly unused KDM.

I imagine a system where KDM starts on vt4 for example, and instead of exiting and replacing itself with KDE session I would prefer it to stay on vt4 and open a new X session on vt5. If I want more users, I would CTRL+ALT+F4 and log in one more user, who would go to next available vt. This way I would get, no wasteful KDMs sitting for no reason, and numerous log in flexibility. Any ideas on how to approach this?
 
Old 08-03-2004, 08:52 AM   #2
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
Quote:
My current system:
RedHat 6.1
XFree86 3.3.5-3

gdm 2.0beta2-13
that is an old help file...........as you can see this just another
Idea that started in UNIX/Linux first and was stolen by M$
and used in XP==but I digress..........
You'll just have to experiment with your system until you get it
working to how you like it, Linux is a true multi-user platform and
the ability to start different Xsessions shows the true power of Linux.....

you can just open a konsole window and type

startx -- :2
startx -- :3
etc........and start new Xsession when you need them.......
take out the extra line in that conf/kdm/Xservers file

<edit/> you can make a shell script, with a desktop conf file pointing to it----
if you want to start new sessions........then you would just click on the desktop icon and wa la.......

Last edited by 320mb; 08-03-2004 at 08:57 AM.
 
Old 08-03-2004, 09:06 AM   #3
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
your shell script would look like this...........
Code:
#!/bin/bash

startx -- :4
put it in /usr/local/?? so normal users have access to it.........
and right click on desktop and select new link to application
right click on the new icon and click the execute tab and point it
to the shell script..........

Last edited by 320mb; 08-03-2004 at 09:17 AM.
 
Old 08-03-2004, 09:19 AM   #4
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 63
Switching to a given vt is done with the swithto command, in the open package (at least in Mandrake).
I agree with you about the limitations of running exactly 2 kdm. You could make a script whose job would be to sudo(NOPASSWD) start a new kdm on a dynamically found display number. Here's some bash:
Code:
function nextAvailableDisplay() {
  disp=0
  while [ -e "/tmp/.X${disp}-lock" ]; do disp=$(( $disp + 1 )); done
  echo $disp
}
You'll have to check how the lock files are named. If I remember correctly, they are in /tmp, and named .X0-lock, .X1-lock...

Yves.

Last edited by theYinYeti; 08-03-2004 at 09:21 AM.
 
Old 08-03-2004, 12:00 PM   #5
suslik
Member
 
Registered: Jul 2004
Distribution: OpenSuse 10.x
Posts: 262

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by 320mb
your shell script would look like this...........
Code:
#!/bin/bash

startx -- :4
put it in /usr/local/?? so normal users have access to it.........
and right click on desktop and select new link to application
right click on the new icon and click the execute tab and point it
to the shell script..........
There is one tincy problem with this way... I don't get a log in screen. What I get this way is another screen for a user who is already logged in. In my case, I need a log in prompt on. Thx for suggestion anyway.


theYinYeti, checking for lock files is a great idea. I was wandering how I can check which vt is taken.

What the show stopper is - if any of the *dm managers allow to redirect the log in to a different screen. I am not sure what is ran by *dm on successful log in. I am going to go over kdm and gdm docs to see if I can keep them around after log on, see if -daemon makes any diff.

on switchto: Endless thx on switchto suggestion.

switchto will change the current VT to the vt specified. Useful to
change VTs when the hotkey sequence is unavailable for some reason, or
from within scripts.

Exactly what I was looking for. In fact, while poking around for it, I found some more scripts for detecting running vt's on a ... Quake howto.
 
Old 08-04-2004, 04:22 AM   #6
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 63
Thanks a LOT for the tip from quake! I've always wanted a tool to tell me how many vc were oppened

Yves.
 
Old 08-30-2004, 01:30 PM   #7
arete
LQ Newbie
 
Registered: Aug 2004
Posts: 1

Rep: Reputation: 0
possible partial solution for Fast User Switching

I haven't tried this yet, so bear with me.

1) You have enough information to create a script which generates a new X session regardless of how many currently exist.

2) You expect to have to switch vts to get to the login prompt.




My suggestion is to set up a script that runs whenever someone logs in - that script generates a new X session which has a new vt and which will have it's own login window. That way you'll always have a login screen, no matter how many people log in.


For bonus points, you create a mechanism that knows whether a vt is still logged in (the simplest would be to add your own lock file somewhere on login and remove it on logout) Then you can only generate a new X session if you don't already have at least one other free one.

Similarly, if you're keeping track like that you could create a shortcut script that would go to the vt that is a gui but isn't locked.

Hope that helps -

Arete
 
Old 08-30-2004, 03:27 PM   #8
suslik
Member
 
Registered: Jul 2004
Distribution: OpenSuse 10.x
Posts: 262

Original Poster
Rep: Reputation: 30
It turns out this functionality is built into KDE since 3.1.x

You have to put in (uncomment) the following in /opt/kde/share/config/kdm/Xservers

:0 local@tty1 /usr/X11R6/bin/X -nolisten tcp
:1 local@tty2 reserve /usr/X11R6/bin/X -nolisten tcp :1

You get a "Start New Session" in Start menu.

There are some issues with conflicting sound, but otherwise works great.
 
Old 08-30-2004, 05:08 PM   #9
the who
Member
 
Registered: Feb 2004
Location: FRG, EU
Distribution: Slackware current
Posts: 51

Rep: Reputation: 15
According to the KDE 3.4 feature list, fast-user switching is planned for 3.4.
 
Old 08-31-2004, 12:23 AM   #10
suslik
Member
 
Registered: Jul 2004
Distribution: OpenSuse 10.x
Posts: 262

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by the who
According to the KDE 3.4 feature list, fast-user switching is planned for 3.4.
Well, I've been using this "planned" feature in 3.2.3 and 3.3. Twilight Zone!

They should probably replace "planned" with "further enhance" cause I'm still looking for a gui way to switch between open consoles. Too lazy to press CTRL+ALT+F#
 
Old 08-31-2004, 07:50 AM   #11
the who
Member
 
Registered: Feb 2004
Location: FRG, EU
Distribution: Slackware current
Posts: 51

Rep: Reputation: 15
Quote:
Originally posted by suslik
They should probably replace "planned" with "further enhance"
Yeah, probably.

The exact wording is "Proper session-on-demand implementation including fast user switching."
 
  


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
Fast User Switching Arrowx7 Linux - Software 3 08-03-2005 03:32 AM
Multiple X login screens sbalasuriya Linux - General 3 04-29-2004 08:12 PM
Fast user switching Davin Linux - General 2 02-17-2004 02:34 PM
Fast user switching and USB Kernel Panic daphantom Mandriva 2 10-20-2003 01:19 PM
New user does not login-X spawning too fast chem1 Linux - General 1 08-14-2002 11:02 PM

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

All times are GMT -5. The time now is 06:39 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration