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

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /htdocs/docs/x/index.html between version 1.72 and 1.73

version 1.72, 2021/04/12 14:32:08 version 1.73, 2021/04/13 06:49:42
Line 104 
Line 104 
   </div>    </div>
 <h3 class="title"><a name="running-x">Running X</a></h3>  <h3 class="title"><a name="running-x">Running X</a></h3>
 <ul>  <ul>
 <li><a href="#x-keyboard-nocaps">How do I make the Caps key another Control key</a></li>  <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="#bypassing_xdm">How to bypass xdm</a></li>
 <li><a href="#startx_not_found">When I type 'startx' I get the message: startx: Command not found. What's wrong?</a></li>  <li><a href="#startx_not_found">startx: not found</a></li>
 <li><a href="#xinit_not_found">Unable to run X - 'xinit: not found'</a></li>  
 <li><a href="#startx_fails">startx fails -'X connection to: 0.0 broken'</a></li>  <li><a href="#startx_fails">startx fails -'X connection to: 0.0 broken'</a></li>
 <li><a href="#xconsole">Console output (such as from 'su') garbles X display.</a></li>  
 <li><a href="#xfree86-docs">XFree86 Documentation</a></li>  
 <li><a href="#which_version">Which version of XFree86 am I running?</a></li>  
 <li><a href="#anti_aliased">How to setup anti-aliased fonts on NetBSD for X11</a></li>  
 <li><a href="#fc-cache">Xft using applications eat CPU cycles, but don't appear  
         to do anything!</a></li>  
 <li><a href="#font-error">'No fonts found' - what does this mean?</a></li>  
 <li><a href="#x_wm">How do I change the default window manager?</a></li>  <li><a href="#x_wm">How do I change the default window manager?</a></li>
 </ul>  </ul>
 <h3 class="title"><a name="compiling-programs">Compiling programs</a></h3>  <h3 class="title"><a name="compiling-programs">Compiling programs</a></h3>
 <ul>  <ul><li><a href="#compile_basic">Program fails to link: cannot find -lX11</a></li></ul>
 <li><a href="#compile_fails_xm">Compile fails - 'unable to locate libXm'</a></li>  
 <li><a href="#compile_fails_xpm">Compile fails - 'unable to locate xpm.h', or '-lXpm: no match'</a></li>  
 <li><a href="#compile_basic">Compile fails to link: Undefined symbol '_XOpenDisplay'</a></li>  
 </ul>  
 <hr>  <hr>
 <h3 class="title">Running X</h3>  <h3 class="title">Running X</h3>
         <h4 class="title">          <h4 class="title">
 <a name="x-keyboard-nocaps"></a>How do I make the Caps key another Control key</h4>  <a name="x-keyboard-nocaps"></a>How to make the Caps Lock key another Control key</h4>
   
         <p>For XFree 3.x (as shipped with NetBSD 1.l5), add          <p>Many Unix key bindings are designed around this layout,
           <span class="quote">&#8220;<span class="quote"><code class="code">XkbOptions "ctrl:nocaps"</code></span>&#8221;</span> if you          because it was traditional on older terminals until the standard
           want the caps-lock key become a second control-key. If you          layout was changed by IBM.</p>
           want to use the "Windows" keys on your keyboard, you can get  
           some useful keysyms for them by using  
           <span class="quote">&#8220;<span class="quote"><code class="code">XkbModel "pc105"</code></span>&#8221;</span> instead.</p>  
   
         <p>XFree 4.x uses a different config file format. For it,          <p>Add the following to your <code class="filename">~/.xsession</code> or
           put          <code class="filename">~/.xinitrc</code>:</p>
           </p>  
 <pre class="programlisting">Option "XkbOptions" "ctrl:nocaps"</pre>          <code class="code">
 <p>          setxkbmap -layout us -option ctrl:swapcaps
           into the "InputDevice" section of your XF86Config file.</p>          </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">          <h4 class="title">
 <a name="bypassing_xdm"></a>How to bypass xdm</h4>  <a name="bypassing_xdm"></a>How to bypass xdm</h4>
Line 173 
Line 167 
 </ul></div>  </ul></div>
   
         <h4 class="title">          <h4 class="title">
 <a name="startx_not_found"></a>When I type '<span class="bold"><strong><code class="code">startx</code></strong></span>' I get the message: <code class="code">startx: Command not found.</code> What's wrong?</h4>  <a name="startx_not_found"></a>startx: not found</h4>
         <p>You need to add the location of the X binaries to your          <p>If the X sets are installed but no X commands work,
           shell's <code class="code">path</code> variable. For <a href="//man.NetBSD.org/NetBSD-9.1/i386/csh.1">csh(1)</a> and its            you need to add the location of the X binaries
           derivatives, add <code class="filename">/usr/X11R6/bin</code>            (<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.1/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.1/i386/csh.1">csh(1)</a> and its derivatives, add
           to the line in your <code class="filename">.cshrc</code> file which            to the line in your <code class="filename">.cshrc</code> file which
           sets the <code class="code">path</code> variable. For <code class="code">sh</code> and            sets the <code class="varname">path</code>.</p>
           its derivatives, you'll need to modify you  
           <code class="filename">.profile</code> instead.</p>  
   
         <h4 class="title">  
 <a name="xinit_not_found"></a>Unable to run X - '<span class="bold"><strong>xinit: not found</strong></span>'</h4>  
   
         <p>You need <code class="filename">/usr/X11R6/bin</code> in your  
           path. As root add '<span class="bold"><strong><code class="code">set path = ( $path /usr/X11R6/bin )</code></strong></span>'  
           to <code class="filename">/etc/csh.cshrc</code>, and start a new  
           shell.</p>  
   
         <h4 class="title">          <h4 class="title">
 <a name="startx_fails"></a>startx fails -'<span class="bold"><strong>X connection to: 0.0 broken</strong></span>'</h4>  <a name="startx_fails"></a>startx fails -'<span class="bold"><strong>X connection to: 0.0 broken</strong></span>'</h4>
Line 197 
Line 185 
   
           </p>            </p>
 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">  <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.1/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>  
 <li class="listitem">If your shell is <a href="//man.NetBSD.org/NetBSD-9.1/i386/sh.1">sh(1)</a>, <a href="//man.NetBSD.org/NetBSD-9.1/i386/ksh.1">ksh(1)</a>, or similar:  <li class="listitem">If your shell is <a href="//man.NetBSD.org/NetBSD-9.1/i386/sh.1">sh(1)</a>, <a href="//man.NetBSD.org/NetBSD-9.1/i386/ksh.1">ksh(1)</a>, or similar:
               <pre class="programlisting">startx &gt; ~/x.log 2&gt;&amp;1</pre>                <pre class="programlisting">startx &gt; ~/x.log 2&gt;&amp;1</pre>
 </li>  </li>
 </ul></div>  <li class="listitem">If your shell is <a href="//man.NetBSD.org/NetBSD-9.1/i386/csh.1">csh(1)</a> or
 <p>                <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/shells/tcsh/index.html" target="_top"><code class="filename">shells/tcsh</code></a>:
           Then view <code class="filename">~/x.log</code></p>                <pre class="programlisting">startx &gt;&amp; ~/x.log</pre>
   
         <h4 class="title">  
 <a name="xconsole"></a>Console output (such as from 'su') garbles X display.</h4>  
   
         <p>The system is outputting a line to the console  
           indicating something has happened (such as 'su'). You should  
           really run <a href="//man.NetBSD.org/NetBSD-9.1/i386/xconsole.1">xconsole(1)</a> or one 'xterm -C' to capture  
           this console output.</p>  
   
         <p>You may need to ensure your kernel is compiled with the  
           following enabled:  
           </p>  
 <pre class="programlisting">options  UCONSOLE  # allow anyone to steal the virtual console</pre>  
 <p>  
           See <a class="ulink" href="../kernel/#how_to_build_a_kernel" target="_top">How to build a kernel</a>  
           for details on how to build your own kernels.</p>  
   
         <p>If you're logged in as root, and get annoying  
           <code class="code">portmap</code> notices, you may wish to look at the  
           <a class="ulink" href="../misc/#portmap-messup" target="_top">FAQ entry</a>  
           on how to turn those messages off.</p>  
   
         <h4 class="title">  
 <a name="xfree86-docs"></a><a class="ulink" href="http://www.xfree86.org/sos/resources.html" target="_top">XFree86 Documentation</a>  
 </h4>  
   
         <h4 class="title">  
 <a name="which_version"></a>Which version of XFree86 am I running?</h4>  
   
         <p>To quickly tell which version of the X server you are  
           running, you can use <a href="//man.NetBSD.org/NetBSD-9.1/i386/xdpyinfo.1">xdpyinfo(1)</a>. E.g.:  
           </p>  
 <pre class="programlisting">$ xdpyinfo | grep release  
 vendor release number:    335</pre>  
 <p>  
   
           In the case of XFree86, this tells us that the server  
           version is 3.3.5.</p>  
   
 <h4 class="title">  
 <a name="anti_aliased"></a>How to setup anti-aliased fonts on NetBSD for X11</h4>  
   
 <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">  
 <h3 class="title">Note</h3>  
 <p>  
 The paths below should be adjusted appropriately if using  
 <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/xpkgwedge/index.html" target="_top"><code class="filename">pkgtools/xpkgwedge</code></a>.  
 </p>  
 </div>  
   
 <div class="orderedlist"><ol class="orderedlist" type="1">  
 <li class="listitem">  
 <p>  
 Install the  
 <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/fonts/ms-ttf/index.html" target="_top"><code class="filename">fonts/ms-ttf</code></a> package from pkgsrc.  
 If you use the pkgsrc version of X, install also the  
 <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/fonts/mkfontscale/index.html" target="_top"><code class="filename">fonts/mkfontscale</code></a> and  
 <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/fonts/fontconfig/index.html" target="_top"><code class="filename">fonts/fontconfig</code></a> packages.  
 </p>  
 </li>  
 <li class="listitem">  
   
 <p>  
 If using the XFree86 shipped with NetBSD, you may consider  
 using <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/fonts/fontconfig/index.html" target="_top"><code class="filename">fonts/fontconfig</code></a> from pkgsrc  
 as it offers more tweaking options.  Set the variable <code class="varname">  
  PREFER.fontconfig</code> to pkgsrc in the <code class="filename">/etc/mk.conf  
 </code> file to ensure that the pkgsrc version is used in  
  favour of the shipped (or native) version:  
   </p>  
 <pre class="programlisting">  
   PREFER.fontconfig=pkgsrc  
   </pre>  
 <p>  
 </p>  
   
 <p>  
   You may also want to instruct fontconfig to never use  
   <span class="emphasis"><em>bitmap fonts</em></span> again:  
   </p>  
 <pre class="programlisting">  
   # cd /usr/pkg/etc/fontconfig/conf.d  
   # ln -s ../../../share/examples/fontconfig/conf.avail/70-no-bitmaps.conf .  
   </pre>  
 <p>  
 </p>  
   
 <p>  
 You may wish to replace the native fontconfig libraries entirely,  
 which is useful should you have any previously-compiled binaries  
 that used it.  
   </p>  
 <pre class="programlisting">  
   # cd /usr/X11R6/lib  
   # mv libfontconfig.so.1.0 libfontconfig.so.1.0.old  
   # rm libfontconfig.so.1  
   # ln -s ../../pkg/lib/libfontconfig.so.1 .  
   # cd /usr/X11R6/bin  
   # mv fc-cache fc-cache.old  
   # mv fc-list fc-list.old  
   </pre>  
 <p>  
 </p>  
   
 </li>  
 <li class="listitem">  
 <p>  
 To configure fontconfig, add the following line to your  
 local.conf.  This file is generally found in  
 <code class="filename">/etc/fonts/local.conf</code>.  
 If you installed the fonts/fontconfig package, you will  
 <span class="bold"><strong>also</strong></span> need to add the line to  
 <code class="filename">/usr/pkg/etc/fonts/local.conf</code>  
 (or replace one with a symbolic link to another):  
   </p>  
 <pre class="programlisting">  
   &lt;dir&gt;/usr/pkg/lib/X11/fonts/TTF&lt;/dir&gt;  
   </pre>  
 <p>  
 </p>  
   
 <p>  
 The <code class="filename">local.conf</code> file may look like this:  
   </p>  
 <pre class="programlisting">  
   &lt;?xml version="1.0"?&gt;  
   &lt;!DOCTYPE fontconfig SYSTEM "fonts.dtd"&gt;  
   &lt;fontconfig&gt;  
   &lt;dir&gt;/usr/pkg/lib/X11/fonts/TTF&lt;/dir&gt;  
   &lt;/fontconfig&gt;  
   </pre>  
 <p>  
 </p>  
   
 <p>  
 You can also add other directories containing fonts to the  
 <code class="filename">local.conf</code> file. The following lines are  
 for using teTeX-3.0 and ghostscript fonts:  
   </p>  
 <pre class="programlisting">  
   &lt;dir&gt;/usr/pkg/share/texmf-dist/fonts/&lt;/dir&gt;  
   &lt;dir&gt;/usr/pkg/share/ghostscript/fonts&lt;/dir&gt;  
   </pre>  
 <p>  
  </p>  
   
 </li>  
 <li class="listitem">  
 <p>  
   Rebuild the font cache for applications that use fontconfig  
   </p>  
 <pre class="programlisting">  
   # fc-cache -v  
   </pre>  
 <p>  
 Depending on your hardware this may take a long time.  
 </p>  
 </li>  
 <li class="listitem">  
 <p>  
 Run the following commands:  
   </p>  
 <pre class="programlisting">  
   # mkfontscale /usr/pkg/lib/X11/fonts/TTF  
   # mkfontdir /usr/pkg/lib/X11/fonts/TTF  
   </pre>  
 <p>  
 There should now be the files <code class="filename">fonts.dir</code> and  
  <code class="filename">fonts.scale</code> in the TTF font directory.  
 </p>  
 </li>  </li>
 <li class="listitem">  
 <p>Configure the X server:  
   </p>  
 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">  
 <li class="listitem">  
   <p> In the <span class="quote">&#8220;<span class="quote">Module</span>&#8221;</span> section, make sure that the following exists:  
   </p>  
 <pre class="programlisting">  
   Load "type1"  
   Load "freetype"  
   </pre>  
 <p>  
   </p>  
   </li>  
 <li class="listitem">  
   <p>  
   In the <span class="quote">&#8220;<span class="quote">Files</span>&#8221;</span> section, verify the order of  
   the font paths. Verify that the TTF and Type1  
   font paths are before the rest:  
     </p>  
 <pre class="programlisting">  
     FontPath   "/usr/X11R6/lib/X11/fonts/local/"  
     FontPath   "/usr/pkg/lib/X11/fonts/TTF"  
     FontPath   "/usr/X11R6/lib/X11/fonts/Type1/"  
     FontPath   "/usr/X11R6/lib/X11/fonts/misc/"  
     FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"  
     FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"  
     FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/"  
     FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/"</pre>  
 <p>  
   </p>  
   
   <p>  
   To apply the changes to the current X session, instead of  
   restarting X, run the following command  
     </p>  
 <pre class="programlisting">  
     # xset fp rehash  
     </pre>  
 <p>  
     This will examine newly added font paths for changes.  
   </p>  
   
   <p>  
   Instead of adding <span class="quote">&#8220;<span class="quote">FontPath</span>&#8221;</span> directives to the X configuration file,  
   you can run the following commands from  
   <code class="filename">~/.xinitrc</code>  
   (or <code class="filename">~/.xsession</code>) file:  
     </p>  
 <pre class="programlisting">  
     xset +fp /usr/X11R6/lib/X11/fonts/Type1  
     xset +fp /usr/pkg/lib/X11/fonts/TTF  
     xset +fp /usr/X11R6/lib/X11/fonts/local  
     </pre>  
 <p>  
   </p>  
   
   </li>  
 </ul></div>  </ul></div>
 <p>  <p>
 </p>  
 </li>  
 <li class="listitem">  
 <p>That's it! Run the following commands to test the configuration.  
   </p>  
 <pre class="programlisting">  
   $ xterm -ls -fg gray -bg black -ls -fa 'Courier New:bold' -fs 10  
   </pre>  
 <p>  
 </p>  
   
 <p>  
 Run the command <strong class="userinput"><code>fc-list</code></strong> it should list  
 the fonts available, and shouldn't dump core!  
 </p>  
   
 <p>  
 While the xterm command from above only tests the fontconfig part, the following  
 command will test the XLFD-style access:  
   </p>  
 <pre class="programlisting">  
   $ xterm -fn '-monotype-Courier New-medium-r-normal--0-0-0-0-m-0-iso8859-1'  
 </pre>  
 <p>  
 </p>  
   
 <p>  
 Another test is that the following should show multiple fonts:  
   </p>  
 <pre class="programlisting">  
   $ xlsfonts | grep -i 'courier new'  
   </pre>  
 <p>  
 </p>  
   
 </li>  
 <li class="listitem">  
 <p>  
   You can find other TTF font packages under pkgsrc/fonts.  
   For example <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/fonts/vera-ttf/index.html" target="_top"><code class="filename">fonts/vera-ttf</code></a>  
 </p>  
 </li>  
 </ol></div>  
   
             Then, view <code class="filename">~/x.log</code>.</p>
         <h4 class="title">  
 <a name="fc-cache"></a>Xft using applications eat CPU cycles, but don't appear  
         to do anything!</h4>  
   
         <p>It is possible that the application in question is  
           computing the font information that should have been  
           prepared by fc-cache - re-run '<code class="code">fc-cache -v</code>' to  
           make sure the information in the cache is up-to-date.</p>  
   
         <h4 class="title">  
 <a name="font-error"></a>'No fonts found' - what does this mean?</h4>  
   
         <pre class="programlisting">No fonts found; this probably means that the fontconfig  
 library is not correctly configured. You may need to  
 edit the fonts.conf configuration file. More information  
 about fontconfig can be found in the <a href="//man.NetBSD.org/NetBSD-9.1/i386/fontconfig.3">fontconfig(3)</a> manual  
 page and on <a class="ulink" href="http://fontconfig.org" target="_top">http://fontconfig.org</a></pre>  
   
         <p>You haven't run '<code class="code">fc-cache -v</code>' like the  
           <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/fonts/fontconfig/index.html" target="_top"><code class="filename">fonts/fontconfig</code></a>  
           <a class="ulink" href="ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/fonts/fontconfig/MESSAGE" target="_top">MESSAGE</a>  
           suggests during installation. For details, see  
           '<code class="code">pkg_info -D fontconfig</code>' and <a class="ulink" href="#anti_aliased" target="_top">above</a>.</p>  
   
         <h4 class="title">          <h4 class="title">
 <a name="x_wm"></a>How do I change the default window manager?</h4>  <a name="x_wm"></a>How do I change the default window manager?</h4>
Line 539  page and on <a class="ulink" href="http:
Line 229  page and on <a class="ulink" href="http:
       <hr>        <hr>
 <h3 class="title">Compiling programs</h3>  <h3 class="title">Compiling programs</h3>
         <h4 class="title">          <h4 class="title">
 <a name="compile_fails_xm"></a>Compile fails - 'unable to locate libXm'</h4>  <a name="compile_basic"></a>Program fails to link: cannot find -lX11</h4>
   
         <p>Xm does not come with the standard X11 environment. It is  
           part of <a class="ulink" href="http://www.opengroup.org/desktop/motif/" target="_top">Motif</a>,  
           which is a commercial graphical user interface.</p>  
   
         <p>A freeware implementation of Motif called <a class="ulink" href="http://www.lesstif.org/" target="_top">Lesstif</a> is also available.  
           It is available as part of the <a class="ulink" href="../software/packages.html" target="_top">NetBSD packages collection</a>,  
           under <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/x11/lesstif/index.html" target="_top"><code class="filename">x11/lesstif</code></a>.</p>  
   
         <h4 class="title">  
 <a name="compile_fails_xpm"></a>Compile fails - 'unable to locate xpm.h', or '-lXpm: no match'</h4>  
   
         <p><code class="filename">xpm.h</code> is part of the X PixMap  
           library, used by many programs to allow more multi (than  
           two) colour icons.  
           It is available as part of the <a class="ulink" href="../software/packages.html" target="_top">NetBSD packages collection</a>,  
           under <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/graphics/xpm/index.html" target="_top"><code class="filename">graphics/xpm</code></a></p>  
   
         <h4 class="title">  
 <a name="compile_basic"></a>Compile fails to link: Undefined symbol '_XOpenDisplay'</h4>  
   
         <p>If it is a third party item of software, you should          <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>.            check if a version is available via the <a class="ulink" href="../software/packages.html" target="_top">NetBSD packages collection</a>.
           If you are writing you own code you need to ensure you link            Otherwise, you need to ensure the linker flags (or
           against the necessary X libraries. In this case, add            <code class="varname">LDFLAGS</code>) contain
           <code class="code">-L/usr/X11R6 -lX11</code> to the end of your link            <code class="code">-L/usr/X11R7/lib, -Wl,-R/usr/X11R7/lib</code>.</p>
           line.</p>  
       <hr>Back to em><a href="../">NetBSD Documentation</a></em>        <hr>Back to em><a href="../">NetBSD Documentation</a></em>
 </div></div></div>  </div></div></div>
 <div class="navfoot"></div>  <div class="navfoot"></div>

Legend:
Removed from v.1.72  
changed lines
  Added in v.1.73

CVSweb <webmaster@jp.NetBSD.org>