[BACK]Return to index.xml CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / htdocs / docs / x

File: [cvs.NetBSD.org] / htdocs / docs / x / index.xml (download)

Revision 1.5, Tue Apr 13 06:49:42 2021 UTC (7 months, 2 weeks ago) by nia
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +38 -343 lines

various updates since we no longer use xfree86

<?xml version="1.0"?>
<!DOCTYPE webpage
  PUBLIC "-//NetBSD//DTD Website-based NetBSD Extension//EN"
         "http://www.NetBSD.org/XML/htdocs/lang/share/xml/website-netbsd.dtd">

<webpage id="docs-x-index">
  <config param="desc" value="NetBSD Documentation: The X Window System"/>
  <config param="cvstag" 
    value="$NetBSD: index.xml,v 1.5 2021/04/13 06:49:42 nia Exp $"/>
  <config param="rcsdate" value="$Date: 2021/04/13 06:49:42 $"/>

  <head>
    <!-- Copyright (c) 1994-2005
    The NetBSD Foundation, Inc.  ALL RIGHTS RESERVED. -->

    <title>NetBSD Documentation: The X Window System</title>
  </head>

  <sect1 id="see-guide">
    <note>Please see the NetBSD Guide's
     <ulink url="../guide/en/chap-x.html">chapter on X</ulink> for more
     information about X.</note>
  </sect1>

  <sect1 role="toc">

    <sect2 id="running-x">
      <title>Running X</title>

      <sect3 id="x-keyboard-nocaps">
	<title>How to make the Caps Lock key another Control key</title>

	<para>Many Unix key bindings are designed around this layout,
	because it was traditional on older terminals until the standard
	layout was changed by IBM.</para>

	<para>Add the following to your <filename>~/.xsession</filename> or 
	<filename>~/.xinitrc</filename>:</para>

	<code>
	setxkbmap -layout us -option ctrl:swapcaps
	</code>

	<para>You can also disable Caps Lock entirely:</para>

	<code>
	setxkbmap -layout us -option ctrl:nocaps
	</code>

	<para>Many other layout options are available, see
	<filename>/usr/X11R7/lib/X11/xkb/rules/base.lst</filename>.</para>
      </sect3>
	
      <sect3 id="bypassing_xdm">
	<title>How to bypass xdm</title>

	<para>If &man.xdm.1; is enabled but you are unable to login
	  for some reason, possibly because there is no root password,
	  and you do not have virtual consoles enabled (or they are
	  not yet supported on your port), you can either press ^C at
	  the immediately after the boot messages indicate xdm is
	  starting, or:</para>

	  <itemizedlist>
	    <listitem>Boot to single user mode - Usually this is
	      accomplished by passing '-s' at the end of the boot
	      command.</listitem>
	    <listitem>Start the shell - Press <code>ENTER</code> when
	      prompted for the shell.</listitem>
	    <listitem>Check and mount the disks using &man.fsck.8; and
	      &man.mount.8; - <code>fsck -p ; mount -vat ffs</code></listitem>
	    <listitem>Set term terminal type -
	      <code>TERM=<emphasis>vt100</emphasis> ; export TERM</code>
	      Note: you may need to use a different terminal type such
	      as 'pc3' or 'sun'.</listitem>
	    <listitem>Fix problem - Edit
	      <filename>/etc/rc.conf</filename> to disable xdm, run
	      &man.passwd.1; to set root's password, or take whatever
	      other corrective action is needed</listitem>
	  </itemizedlist>
      </sect3>

      <sect3 id="startx_not_found">
	<title>startx: not found</title>
	<para>If the X sets are installed but no X commands work,
	  you need to add the location of the X binaries
	  (<filename>/usr/X11R7/bin</filename>) to your
	  shell's <varname>PATH</varname> variable. For &man.sh.1; and
	  its derivatives, you'll need to modify your
	  <filename>~/.profile</filename>.
	  For &man.csh.1; and its derivatives, add
	  to the line in your <filename>.cshrc</filename> file which
	  sets the <varname>path</varname>.</para>
      </sect3>
	  
      <sect3 id="startx_fails">
	<title>startx fails -'<emphasis role="bold">X connection to: 0.0 broken</emphasis>'</title>

	<para>To see the error messages in this case, run:

	  <itemizedlist>
	    <listitem>If your shell is &man.sh.1;, &man.ksh.1;, or similar:
	      <screen>startx &gt; ~/x.log 2&gt;&amp;1</screen></listitem>
	    <listitem>If your shell is &man.csh.1; or 
	      <filename role="pkg">shells/tcsh</filename>:
	      <screen>startx &gt;&amp; ~/x.log</screen></listitem>
	  </itemizedlist>

	  Then, view <filename>~/x.log</filename>.</para>
      </sect3>

      <sect3 id="x_wm">
	<title>How do I change the default window manager?</title>

	<para>First thing to do is to install the window manager you
	  prefer. You can find a lot of them, ready to install, in
	  pkgsrc's <filename role="pkg">wm</filename> category. After
	  a successful installation, figure out how is the
	  binary named. It will usually match package's name.</para>

	<para>Once you know how to execute the window manager, you
	  have to configure your X session to start it up. We will be
	  using ctwm in our examples (which comes with X), whose binary
	  is named <code>ctwm</code>:</para>

	<itemizedlist>
	  <listitem>If you are using &man.startx.1;, edit the
	    <filename>~/.xinitrc</filename> file and
	    append the following line to it:
	    <code>exec ctwm</code></listitem>
	  <listitem>If you are using &man.xdm.1;, edit the
	    <filename>~/.xsession</filename> file and append the 
	    following line to it:
	    <code>exec ctwm</code></listitem>
	</itemizedlist>

	<para>You can see that the content for each file is the same,
	  so you may want to create a link between them.</para>
      </sect3>
    </sect2>

    <sect2 id="compiling-programs">
      <title>Compiling programs</title>

      <sect3 id="compile_basic">
	<title>Program fails to link: cannot find -lX11</title>

	<para>If it is a third party item of software, you should
	  check if a version is available via the <ulink
	    url="../software/packages.html">NetBSD packages collection</ulink>.
	  Otherwise, you need to ensure the linker flags (or
	  <varname>LDFLAGS</varname>) contain 
	  <code>-L/usr/X11R7/lib, -Wl,-R/usr/X11R7/lib</code>.</para>
      </sect3>
    </sect2>
  </sect1>

  <parentsec url="../" text="NetBSD Documentation"/>

</webpage>