⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 linux-x-multiple.html

📁 Linus guide, Linus guide, Linus guide,
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><HTML><HEAD><TITLE>Running Multiple Sessions of X</TITLE>	<META NAME="description" CONTENT="A document telling how to run multiple sessions of the X windowing system.">	<META NAME="keywords" CONTENT="run, running, multiple, sessions, X"></HEAD><LINK REL="stylesheet" TYPE="text/css" HREF="default.css"><BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#7F007F"><H2><A NAME="0">Running Multiple Sessions of X</A></H2><B><FONT SIZE="-1">Created on December 11, 1997</FONT></B><BR><B><FONT SIZE="-1">Last updated: October 3, 1998</FONT></B><P>I think this is very, very neat. I got it off of <AHREF="http://www.linuxgazette.com/" TARGET="_top">Linux Gazette</A> Issue23. Let me know if it works for you.</P><P>I would think that a lot of people would want to know how to runmultiple X sessions; sometimes you have a different user who wants to login and use X, but you're tied up downloading the newest version ofWindowMaker with Netscape inside your own X session. Or something likethat.</P><P>The solution? Run multiple X sessions. This can be done with only a fewextensions to your command line. For your first X session, all you had todo was type <B>startx</B>, or if you run in high color mode like I do, youmight have to type <B>startx -- -bpp 24</B>. That defaults to running iton screen 0, which is really your first X session.</P><P>What you want to do is make X run in screen 1 for the second, screen 2for the third, screen 3 for the fourth, and so on. Here's how you wouldstart a second X session:</P><PRE><B>startx -- :1</PRE></B><P>Now, if you run in high color mode, you would enter the properparamaters <I>after</I> the <B>:1</B> part of the command line. If youwanted to run in 24 bits per pixel (16.7 million colors), you would type<B>startx -- :1 -bpp 24</B> as your full command line.</P><P>If you want to start yet another X session, a third one, you would type<B>startx -- :2</B> and <B>startx -- :2 -bpp 24</B> for 24 bit color.After that, you would use the numbers 3, 4, and 5 for additional Xsessions.</P><H3><A NAME="1">Switching Between X Screens</A></H3><P>You probably have a default number of 6 virtual consoles. Those arehow many logins you can have in plain text mode, basically. If you haveF12, you would probably have 6 &quot;empty&quot; screens if you're notrunning X.</P><P>Your first X session, as you may already know, is accessible bypressing Alt-F7 (use the left Alt key). For your second, it's Alt-F8. Forthe third, Alt-F9, and so on. This is what you would do to switch from text mode to an X screen.</P><P>If you want to <I>switch from one X screen to another</I>, you'll haveto use Ctrl-Alt and then whatever F-key you'd normally use. For example,if you want to access X screen number 3, you'd press Ctrl-Alt-F9 from anexisting X session. From text mode, you'd only have to press Alt-F9.</P><H3><A NAME="2">Suggestions</A></H3><P><A HREF="mailto:extremeforce@pcisys.net">Tim Briggs</A> previously sentin an e-mail concerning his frustration starting more than one X. Heincluded it with a script, but then he sent in another version whichis much cleaner and has a few improvements over his old one, which was previously posted here.</P><PRE>#!/bin/shif [ $# -eq 0 ]      # check to see if arguements are given (color depth)       then a=16    # default color depth        else a=$1    # use given arguementfiif [ $a -ne 8 -a $a -ne 16 -a $a -ne 24 ]        then                echo "Invalid color depth. Use 8, 16, or 24."        exit 1fifor display in 0 1 2 3 4 5    # checks for open display, starts X on next available        {        if [ ! -f "/tmp/.X$display-lock" ]                then                        exec startx -- :$display -bpp $a                exit0        fi        }echo "No displays available."exit 1</PRE><P>The way I manage multiple X seesions is put stuff in alias form in<TT>/etc/bashrc</TT>. You'll probably want to use Tim Brigg's script.</P><PRE>alias x="startx -- -bpp 24 -quiet &"alias x2="startx -- :1 -bpp 24 -quiet &"alias x3="startx -- :2 -bpp 24 -quiet &"alias x4="startx -- :3 -bpp 24 -quiet &"alias x5="startx -- :4 -bpp 24 -quiet &"alias x6="startx -- :5 -bpp 24 -quiet &"</PRE><P>If you want to, go ahead and copy that to paste in your<TT>/etc/bashrc</TT>. You'll need to log out and log in again for thechanges to take effect after changing that, and from then on those aliaseswill be carried in to all new logins.</P><P>When I type <B>x</B> it starts up my first X session. Then it starts upto 5 more X sessions. The first one is referred to as session 0, althoughit's actually number one. That's fairly common in Unix.</P><P>It's also worth noting that I put the ampersand (&quot;&amp;&quot;) atthe end of the startx command line in order to make it run in thebackground. That way it frees up a text mode console for me instead ofkeeping it and making me log in again on another virtual terminal.</P><H3><A NAME="3">Related Pages</A></H3><OL><LI><A HREF="linux-X-remote.html">Remote X</A></LI><LI><A HREF="linux-X-config.html">Configuring and Troubleshooting X</A></LI><LI><A HREF="linux-X-upgrade.html">Installing and Upgrading X</A></LI></OL><HR><P>Send all comments, questions, suggestions, corrections, and complaints<A HREF="mailto:jgo@local.net">jgo@local.net</A>.</P><HR><P><B><FONT SIZE="-1">Copyright &copy; 1997-1999 <AHREF="mailto:jgo@local.net">Joshua Go (jgo@local.net)</A>. Allrights reserved. Permission to use, distribute, and copy this document ishereby granted. You may modify this document as long as credit to me isgiven.</FONT></B></P></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -