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

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

Revision 1.76, Mon May 17 12:47:49 2021 UTC (6 months, 3 weeks ago) by martin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.75: +10 -10 lines

Regen for 9.2

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="generator" content="Website XSL Stylesheet V2.6.0">
<link rel="home" href="../../." title="Welcome to The NetBSD Project: Of course it runs NetBSD.">
<link rel="up" href="../../docs/." title="NetBSD Documentation">
<link rel="previous" href="../../docs/updating.html" title="Updating a stable NetBSD release">
<link rel="next" href="../../donations/." title="Donations to The NetBSD Foundation">
<link rel="first" href="../../docs/Hardware/." title="Hardware Documentation">
<link rel="stylesheet" href="../../global.css" type="text/css">
<link rel="stylesheet" href="../../donations/thermo/fundraiser.css" type="text/css">
    

    <title>NetBSD Documentation: The X Window System</title>
  </head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<body class="website"><div class="webpage">
<a name="docs-x-index"></a><div id="top"><a href="#mainContent" id="skiplink" tabindex="1">Skip to main content.</a></div>
<input id="hamburger" type="checkbox"><label class="menuicon" for="hamburger"><span></span><span></span><span></span></label><div id="navBar" role="navigation">
<div id="centralHeader"><div id="logo">
<a href="../../"><img id="projectLogo" alt="" height="120" src="../../images/NetBSD-smaller-tb.png"></a><a href="/"><div id="fundraiser">
<br><div id="fundraiser-amount"><div id="fundraiser-raised"></div></div>
</div></a>
</div></div>
<span class="doNotDisplay">
	  Navigation:
	</span><ul>
<li>
<a href="../../">
	  Home</a><ul>
<li><a href="../../changes/">
	    Recent changes</a></li>
<li><a href="//blog.NetBSD.org/">
	    NetBSD blog</a></li>
<li><a href="../../gallery/presentations/">
	    Presentations</a></li>
</ul>
</li>
<li>
<a href="../../about/">
	  About</a><ul>
<li><a href="../../people/developers.html">
	    Developers</a></li>
<li><a href="../../gallery/">
	    Gallery</a></li>
<li><a href="//wiki.NetBSD.org/ports/">
	    Ports</a></li>
<li><a href="//www.pkgsrc.org/">
	    Packages</a></li>
</ul>
</li>
<li>
<a href="../../docs/">
	  Documentation</a><ul>
<li><a href="../../docs/misc/index.html">
	    FAQ &amp; HOWTOs</a></li>
<li><a href="../../docs/guide/en/">
	    The Guide</a></li>
<li><a href="//man.NetBSD.org/">
	    Manual pages</a></li>
<li><a href="//wiki.NetBSD.org/">
	    Wiki</a></li>
</ul>
</li>
<li>
<a href="../../support/">
	  Support</a><ul>
<li><a href="/community/">
	    Community</a></li>
<li><a href="/mailinglists/">
	    Mailing lists</a></li>
<li><a href="../../support/send-pr.html">
	    Bug reports</a></li>
<li><a href="../../support/security/">
	    Security</a></li>
</ul>
</li>
<li>
<a href="../../developers/">
	  Developers</a><ul>
<li><a href="http://cvsweb.NetBSD.org/">
	    CVSWeb</a></li>
<li><a href="//anonhg.NetBSD.org/">
	    Mercurial</a></li>
<li><a href="//nxr.NetBSD.org/">
	    Cross-reference</a></li>
<li><a href="//releng.NetBSD.org/">
	    Release engineering</a></li>
<li><a href="//wiki.NetBSD.org/projects/">
	    Projects list</a></li>
</ul>
</li>
</ul>
</div>
<div id="content"><div id="mainContent" class="fullWidth"><div class="rowOfBoxes">
<h1>NetBSD Documentation: The X Window System</h1>
<div class="sect1">
<div class="titlepage"></div>
    <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>Please see the NetBSD Guide's
     <a class="ulink" href="../guide/en/chap-x.html" target="_top">chapter on X</a> for more
     information about X.</div>
  </div>
<h3 class="title"><a name="running-x">Running X</a></h3>
<ul>
<li><a href="#x-keyboard-nocaps">How to make the Caps Lock key another Control key</a></li>
<li><a href="#bypassing_xdm">How to bypass xdm</a></li>
<li><a href="#startx_not_found">startx: not found</a></li>
<li><a href="#startx_fails">startx fails -'X connection to: 0.0 broken'</a></li>
<li><a href="#x_wm">How do I change the default window manager?</a></li>
</ul>
<h3 class="title"><a name="compiling-programs">Compiling programs</a></h3>
<ul><li><a href="#compile_basic">Program fails to link: cannot find -lX11</a></li></ul>
<hr>
<h3 class="title">Running X</h3>
	<h4 class="title">
<a name="x-keyboard-nocaps"></a>How to make the Caps Lock key another Control key</h4>

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

	<p>Add the following to your <code class="filename">~/.xsession</code> or 
	<code class="filename">~/.xinitrc</code>:</p>

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

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

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

	<p>Many other layout options are available, see
	<code class="filename">/usr/X11R7/lib/X11/xkb/rules/base.lst</code>.</p>
      
	<h4 class="title">
<a name="bypassing_xdm"></a>How to bypass xdm</h4>

	<p>If <a href="//man.NetBSD.org/NetBSD-9.2/i386/xdm.1">xdm(1)</a> 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:</p>

	  <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">Boot to single user mode - Usually this is
	      accomplished by passing '-s' at the end of the boot
	      command.</li>
<li class="listitem">Start the shell - Press <code class="code">ENTER</code> when
	      prompted for the shell.</li>
<li class="listitem">Check and mount the disks using <a href="//man.NetBSD.org/NetBSD-9.2/i386/fsck.8">fsck(8)</a> and
	      <a href="//man.NetBSD.org/NetBSD-9.2/i386/mount.8">mount(8)</a> - <code class="code">fsck -p ; mount -vat ffs</code>
</li>
<li class="listitem">Set term terminal type -
	      <code class="code">TERM=<span class="emphasis"><em>vt100</em></span> ; export TERM</code>
	      Note: you may need to use a different terminal type such
	      as 'pc3' or 'sun'.</li>
<li class="listitem">Fix problem - Edit
	      <code class="filename">/etc/rc.conf</code> to disable xdm, run
	      <a href="//man.NetBSD.org/NetBSD-9.2/i386/passwd.1">passwd(1)</a> to set root's password, or take whatever
	      other corrective action is needed</li>
</ul></div>
      
	<h4 class="title">
<a name="startx_not_found"></a>startx: not found</h4>
	<p>If the X sets are installed but no X commands work,
	  you need to add the location of the X binaries
	  (<code class="filename">/usr/X11R7/bin</code>) to your
	  shell's <code class="varname">PATH</code> variable. For <a href="//man.NetBSD.org/NetBSD-9.2/i386/sh.1">sh(1)</a> and
	  its derivatives, you'll need to modify your
	  <code class="filename">~/.profile</code>.
	  For <a href="//man.NetBSD.org/NetBSD-9.2/i386/csh.1">csh(1)</a> and its derivatives, add
	  to the line in your <code class="filename">.cshrc</code> file which
	  sets the <code class="varname">path</code>.</p>
      
	<h4 class="title">
<a name="startx_fails"></a>startx fails -'<span class="bold"><strong>X connection to: 0.0 broken</strong></span>'</h4>

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

	  </p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">If your shell is <a href="//man.NetBSD.org/NetBSD-9.2/i386/sh.1">sh(1)</a>, <a href="//man.NetBSD.org/NetBSD-9.2/i386/ksh.1">ksh(1)</a>, or similar:
	      <pre class="programlisting">startx &gt; ~/x.log 2&gt;&amp;1</pre>
</li>
<li class="listitem">If your shell is <a href="//man.NetBSD.org/NetBSD-9.2/i386/csh.1">csh(1)</a> or 
	      <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/shells/tcsh/index.html" target="_top"><code class="filename">shells/tcsh</code></a>:
	      <pre class="programlisting">startx &gt;&amp; ~/x.log</pre>
</li>
</ul></div>
<p>

	  Then, view <code class="filename">~/x.log</code>.</p>
      
	<h4 class="title">
<a name="x_wm"></a>How do I change the default window manager?</h4>

	<p>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 <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/wm/index.html" target="_top"><code class="filename">wm</code></a> category. After
	  a successful installation, figure out how is the
	  binary named. It will usually match package's name.</p>

	<p>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 class="code">ctwm</code>:</p>

	<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">If you are using <a href="//man.NetBSD.org/NetBSD-9.2/i386/startx.1">startx(1)</a>, edit the
	    <code class="filename">~/.xinitrc</code> file and
	    append the following line to it:
	    <code class="code">exec ctwm</code>
</li>
<li class="listitem">If you are using <a href="//man.NetBSD.org/NetBSD-9.2/i386/xdm.1">xdm(1)</a>, edit the
	    <code class="filename">~/.xsession</code> file and append the 
	    following line to it:
	    <code class="code">exec ctwm</code>
</li>
</ul></div>

	<p>You can see that the content for each file is the same,
	  so you may want to create a link between them.</p>
      <hr>
<h3 class="title">Compiling programs</h3>
	<h4 class="title">
<a name="compile_basic"></a>Program fails to link: cannot find -lX11</h4>

	<p>If it is a third party item of software, you should
	  check if a version is available via the <a class="ulink" href="../software/packages.html" target="_top">NetBSD packages collection</a>.
	  Otherwise, you need to ensure the linker flags (or
	  <code class="varname">LDFLAGS</code>) contain 
	  <code class="code">-L/usr/X11R7/lib, -Wl,-R/usr/X11R7/lib</code>.</p>
      <hr>Back to em><a href="../">NetBSD Documentation</a></em>
</div></div></div>
<div class="navfoot"></div>
<div id="footer"><div id="footerContent"><center>
<span class="footfeed"><a href="//www.NetBSD.org/cgi-bin/feedback.cgi">
	  Contact</a> |
      </span><span class="footcopy"><a href="../../about/disclaimer.html">
      Disclaimer</a> |

      <span class="copyright">Copyright 1994-2021 The NetBSD Foundation, Inc. </span>ALL RIGHTS RESERVED.<br>NetBSD<sup>/sup> is a registered trademark of The NetBSD
	Foundation, Inc.</span>
</center></div></div>
</div></body>
</html>