[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: multiple xservers on one machine?



Vincent Murphy <murphyv@wisdom.ucc.ie> writes:

> I and a colleague share a PC.  We would like to each run our own Xserver,
> which can be switched to using Ctrl-Alt-F7 and F8, as with virtual
> consoles.
> 
> Is such a situation possible?  I'm running hamm.

Yes, just use the shell function (can be defined in your .bashrc
file):

x() {
      D=x
      for i in `seq 0 4`;do if [ ! -f /tmp/.X${i}-lock ]; then D=$i; break; fi; done
      if [ "${D}" = "x" ]; then
        echo "No free virtual terminal"
      else
        if [ $# -lt 1 ];
          then startx -- :${D} -bpp 16 2> ~/.X.err > ~/.X.out &
          else startx -- :${D} -bpp $1 2> ~/.X.err > ~/.X.out  &
        fi; 
      fi
}

instead of the normal startx call.  Default colordepth is 16, you can
override this with passing an argument to this function.

	Torsten

-- 
Homepage: http://www.in-berlin.de/User/myrkr


Reply to: