The X Window User HOWTO <author>by Ray Brigleb, <tt/ray@aracnet.com/ <date>v2.0, 1 September 1999 <trans>The Linux Japanese FAQ Project <tdate>v2.0j, 13 September 1999 <!-- <abstract>This document contains information on configuring the X Window environment for the Linux user, as well as for the beginning system administrator attempting to sort through the many configuration options and details of X Window. A basic knowledge of software configuration and installation is assumed, as is the presence of X on the users system.</abstract> --> <abstract>本ドキュメントは、X ウィンドウ環境の設定についての情報の解説 で、X ウィンドウの数多くの設定オプションや詳細事項を整理しようとしてい るシステム管理初心者と Linux ユーザを対象にしています。本ドキュメント では、読者がソフトウェアの設定とインストールの基礎知識を持っていること と、ユーザのシステムに X が入っていることを想定しています。</abstract> <toc> <!-- 担当: 藤原 --> <!-- <sect>Introduction --> <sect>はじめに <!-- <p>The <em>X Window System</em> is an advanced, network transparent, windowing, graphical environment, developed at the <em>Massachusetts Institute of Technology</em>, and first released in 1984. This document assumes that you have installed X and it is functional. We intend to learn how to use X productively, not so much how to compile the programs; most Linux distributions come with X as an option during installation, compiled and ready to go. --> <p><em>X ウィンドウシステム</em>は、先進的かつネットワーク透過で、ウィ ンドウを利用できるグラフィカル環境です。これは <em>マサチューセッツ工 科大学(Massachusetts Institute of Technology)</em>で開発され、1984 年 に初めてリリースされました。このドキュメントでは、X は既にインストール され、ちゃんと動作しているものと想定します。本ドキュメントの目的は、プ ログラムのコンパイルの方法ではなく、X の生産的な使い方を身につけること だからです。Linux ディストリビューションのほとんどには X が付属してお り、インストール時にオプションとして選ぶことができます。これは既にコン パイル済みで、すぐに実行できます。 <!-- <sect1>Other Sources Of Information --> <sect1>他の情報源 <!-- <p>If you are just starting out, you may find the <em>XFree86 HOWTO</em> and <em>XFree86 Video Timings HOWTO</em>s to be more helpful, and you should be able to find that in the same place you found this. At the end of the document you will also find a Bibliography And Resources section, to find even more information. Oh, and don't forget to read the <bf>man pages</bf>. --> <p>まるっきり最初から始める場合には、<em>XFree86 HOWTO</em> と <em>XFree86 Video Timings HOWTO</em> の方が役に立つかもしれません。こ れらはこのドキュメントと同じ場所にあるはずです。このドキュメントの最後 には、もっと詳しい情報を探すための「関連図書とその他の情報源」セクショ ンがあります。おっと、それから<bf>オンラインマニュアル</bf>を読むのも 忘れないでくださいね。 <!-- <sect1>Versions Of This Document --> <sect1>このドキュメントのバージョン <!-- <p>New versions of this HOWTO may be periodically posted to <url url="news:comp.os.linux.help" name="comp.os.linux.help"> They will also be uploaded to various Linux WWW and FTP sites, including <url url="http://metalab.unc.edu/LDP" name="Linux Documentation Project"> web site. The latest version can usually be found at <url url="http://www.croftj.net/~ray/howto">, but the Metalab repository is the canonical distribution point. --> <p>この HOWTO の最新版は定期的に<url url="news:comp.os.linux.help" name="comp.os.linux.help"> に投稿されま す。これは Linux 関係のさまざまな WWW サイトや FTP サイトにもアップロー ドされます。その中には <url url="http://metalab.unc.edu/LDP" name="Linux Documentation Project"> のウェブサイトも含まれます。最新版は普通、<url url="http://www.croftj.net/~ray/howto"> にありますが、公式の配布場所は Metalab のリポジトリです。 <!-- Changes in version 1.1 include more coverage of <bf>rxvt</bf>, expanded coverage of X Resources, more trivial history of X, corrected references to SunSite to point to MetaLab, and instructions on using Type 1 fonts with X. --> バージョン 1.1 における変更点は、<bf>rxvt</bf> の説明の追加、X リソー スの説明の追加、X のちょっとした歴史の追加、SunSite への参照を MetaLab への参照に修正したこと、X で Type 1 フォントを使う手順の説明です。 <!-- Changes in version 1.2 include much-requested coverage of using TrueType fonts in X, more details about setting up <tt>xdm</tt>, and a few more added resources. There is also a correction to my discussion of screen blanking features (thanks to Heinrich Langos for the correction!). --> バージョン 1.2 における変更点は、要望の多かった、X で TrueType フォン トを使う方法の説明、<tt>xdm</tt> の設定に関するより詳しい説明の追加、 リソースいくつかの追加です。画面ブランク機能に関する説明への修正も行 いました(訂正してくださった Heinrich Langos さんに感謝します)。 <!-- Changes in version 1.3 include some fixes, info for corrupted font paths in some recent distributions, and lots more info about basic X security. I've also added some tips about KDE and an e-mail address update. --> バージョン 1.3 における変更点は、修正いくつか、最近のディストリビュー ションの一部におけるフォントパスの不具合に関する情報、X の基本的なセキュ リティに関する多くの情報の追加です。KDE に関する小技いくつかの追加や、 電子メールアドレスの更新も行いました。 <!-- Changes in version 1.4 include corrections and additions from Anthony J., and some very good security tips from Tomasz Motylewski. --> バージョン 1.4 における変更点は、Anthony J. さんによる追加・訂正と、 Tomasz Motylewski からのとても素晴らしいセキュリティに関する情報です。 <!-- Changes in this version (2.0) includes corrections from Guus Bosch, Brian J. Miller, and myself, as well as lots of new updates and info, and a plea for a new maintainer! --> このバージョン(2.0)における変更点は、Guus Bosch さん、Brian J. Miller さん、筆者自身による訂正と、たくさんの新しい更新と情報、それから新しい メンテナ募集のお願いです! <!-- <sect1>Feedback And Corrections --> <sect1>フィードバックと訂正 <!-- <p>If you have questions or comments about this document, please feel free to email Ray Brigleb at my current (<tt>ray@aracnet.com</tt>) or ``permanent'' (<tt>rayola@mindless.com</tt>) address. I readily welcome any suggestions or criticisms. If you find any mistakes with this document, please let me know so I can correct them in the next revision. If you have information you would like to see in future revisions, or you would like to contribute to a future revision, drop me a line. I'm also looking for more resources to add to the sections and bibliography. While we're at it, I'm also looking for someone interested in taking over maintenance of this document, please let me know if you're interested. I think another maintainer might be able to breathe life into this project that I have not had as of late, and judging from the feedback I receive this is still a very viable and useful text. --> <p>このドキュメントに関する質問やコメントがあれば、 Ray Brigleb 宛(現在のアドレスである <tt>ray@aracnet.com</tt> またはずっ と使えるアドレスである <tt>rayola@mindless.com</tt>) に気軽にメールを送ってください。筆者はどんな提案や批判も歓迎します。こ のドキュメントの誤りを見つけた場合には、次の版で修正できるように筆者 にお知らせください。将来の版で見たい情報がある場合や、将来の版に貢献し ていただける場合には、筆者までご連絡ください。 また、筆者は本文や参考文献に追加できる、より多くの情報を探しています。 それはそれとして、筆者はこのドキュメントの管理を引き継いでくれる方を探 しています。もし興味をお持ちでしたら、筆者にお知らせください。 筆者が最新の状態を追えていないこのプロジェクトに、別の管理者の方が息を 吹き込むことができるかもしれないと筆者は考えています。筆者が受け取る フィードバックから判断すると、この文書はまだ使えてしかも役に立ちます。 <!-- <sect1>Acknowledgments --> <sect1>謝辞 <!-- <p>A special thanks to the HOWTO coordinator Tim Bynum for help and suggestions, and the XFree86 Group for the man pages and help files that come with XFree86. I really need to thank all of those who have written documentation and descriptions of their offerings in the past, I have just gleaned a selection of the most relevant items from their material for this document. Also, thanks are due to Matt Chapman, author of the Window Managers Guide website, and Scott Scriven, for the FVWM2 Themes tips and tricks I stole from some of his hacks. Thanks are also due to Joe Croft for the Internet service, invaluable to the ongoing development of this HOWTO, and Claire Galper, for moral support and miscellaneous tips. Last but not least, thanks to the whole GNU/Linux community, for everything, and Mr. Stallman, for this text editor (and philosophy). --> <p>援助や意見をしてくださった、HOWTO 世話役の Tim Bynum さんに深く感謝 します。また、XFree86 付属のオンラインマニュアルやヘルプファイルを作成 した XFree86 グループの皆さんに深く感謝します。過去に作成したものに付 属ドキュメントや説明を書いてくださった全ての方々にも本当に感謝しなけれ ばなりません。筆者はこのドキュメントを作成するに当たって、これらの材料 から関係ありそうな項目を集めただけなのですから。またウェブサイト 「Window Managers Guide」の作者である Matt Chapman さん、FVWM2 用テー マに関する小技やテクニックを借用させていただいた Scott Scriven さんに 感謝します。進行中であるこの HOWTO の執筆に対して大変貴重なインターネッ トサービスを提供してくださった Joe Croft さん、励ましてくれたり様々な 小技を教えてくださった Claire Galper さんにも感謝します。最後に――で すが決して軽んじているわけではありません――全てにおいて GNU/Linux コ ミュニティ全体に感謝し、このテキストエディタ(と思想)を与えてくださった Stallman 氏に感謝します。 <!-- <sect1>Copyright --> <sect1>著作権表示 <p>Copyright (c) 1998, 1999 by Ray Brigleb. Unless otherwise stated, Linux HOWTO documents are copyrighted by their respective authors. Linux HOWTO documents may be reproduced and distributed in whole or in part, in any medium physical or electronic, as long as this copyright notice is retained on all copies. Commercial redistribution is allowed and encouraged; however, the author would like to be notified of any such distributions. All translations, derivative works, or aggregate works incorporating any Linux HOWTO documents must be covered under this copyright notice. That is, you may not produce a derivative work from a HOWTO and impose additional restrictions on its distribution. Exceptions to these rules may be granted under certain conditions; please contact the Linux HOWTO coordinator for more information. In short, we wish to promote dissemination of this information through as many channels as possible. However, we do wish to retain copyright on the HOWTO documents, and would very much like to be notified of any plans to redistribute the HOWTOs, this one in particular! Many of the terms mentioned in this document are trade names. Unless otherwise stated, all trademarks are property of their respective owners. <bf/訳注/: 著作権表示の日本語訳も参考までに挙げておきますが、これはあ くまで参考です。正式には上記英文の内容に従ってください。 <p>特に断り書きをしない限り、Linux HOWTO ドキュメントはそれぞれの作者 の著作物です。Linux HOWTO ドキュメントは、この著作権表示が全ての複製物 に残されている限り、全体または一部を、任意の物理的または電子的メディア に複製および配布することができます。商業的な配布は許可していますし、推 奨しています。ただし、このような配布の場合には筆者にお知らせくださると 幸いです。 全ての翻訳物、派生物、Linux HOWTO ドキュメントを集めた編集物は、この著 作権表示に従わなければなりません。つまり、HOWTO を元に派生物を作成し、 その配布に当たって追加的な制限を加えることはできません。特定の条件の下 では、この規則には例外が認められます。詳しくは Linux HOWTO 世話役まで 御連絡ください。 簡単に言うと、我々はできるだけ多くの経路を通してこの情報の普及を進めた いと考えています。しかし、HOWTO ドキュメントの著作権は保持したいと考え ていますし、できれば HOWTO 再配布の計画について知っておきたいと考えて います。このドキュメントについては特にそう考えています! このドキュメントに現われる用語の多くは登録商標です。特に断らない限り、 全ての登録商標はそれぞれの権利者の所有物です。 <sect1>日本語訳について <p>日本語訳は Linux JF プロジェクトが行いました。 翻訳に関する訂正・ご意見などは当プロジェクト(<JF@linux.or.jp>) までお知らせください。 また、翻訳に関する権利は当プロジェクトにあるものとし、配布について は原文のライセンスに従うものとします。 作業を行ったメンバー(50音順)を以下に示します:<p> 東洋昌 <azuma@po.sphere.ne.jp> (10章), 遠藤明 <akendo@t3.rim.or.jp> (5章), 大西圭一 <ohnishik@mbox.kyoto-inet.or.jp> (3章), 川島浩 <kei@arch.sony.co.jp> (6章), 小松弘幸 <komatsu@tahoo.org> (校正), 佐藤亮一 <rsato@ipf.de>(校正), 武井伸光 <takei@cc.kochi-u.ac.jp>(校正), 田中雄一郎 <yuitanak@oracle.co.jp> (4章), 中谷千絵 <jeanne@mbox.kyoto-inet.or.jp>(2章), 奈古屋広昭 <nagoya@cc.hit-u.ac.jp>(9章), 長谷川靖 <yaz-hase@qb3.so-net.ne.jp>(校正), 服部慎 <mituzi@he.mirai.ne.jp>(訳注), 早川仁 <uv9h-hykw@asahi-net.or.jp>(校正), 藤原輝嘉 <fujiwara@linux.or.jp>(1, 8章), 松浦方昭 <masa386@yk.rim.or.jp> (7章) <!-- 担当: 中谷 --> <!-- <sect>Getting Started --> <sect>はじめてみよう <p> <!--<sect1>The X Window System: History and Architecture --> <sect1>X ウィンドウシステム:その歴史と構造様式 <!-- <p>The <em>X Window System</em> was developed in the Laboratory for Computer Science at the <em>Massachusetts Institute of Technology</em>, as part of project Athena in cooperation with DEC, and first released in 1984. The project lead of the main development was Robert Scheifler, and the origins of X owe much debt to the <em>``W''</em> Windowing package, developed by Paul Asente at <em>Stanford</em>. In September of 1987, MIT issued the first release of the X11 that we know and use today. As of X11R2, control passed from MIT to the <em>X Consortium</em>, formed in January of 1988. --> <p> <em> X ウィンドウシステム</em> は<em> 、DEC との共同研究で、Athena プ ロジェクトの一環として MIT(マサチューセッツ工科大学</em>のコンピュータ サイエンス研究所で開発され、 1984 年に初めて発表されました。開発の先頭 にたったのは Robert Scheifler で、最初の X は スタンフォードの Paul Asente によって開発された "W" というウィンドウパッケージに負うところが 大きいものでした。1987 年 9 月、MIT は今日われわれが知っていて使用して いる X11 の最初の版を発表しました。X11R2 以降、管理は MIT から1988年1 月に発足した X コンソーシアムに移行しています。 <!-- Many of the ideas that went into X Window also came from research at Xerox Corporation's <em>Palo Alto Research Center</em> (PARC), where they were working on computers like the Parc and the Star in the late seventies. None of these computers made it to market, but when Xerox demonstrated a window system custom built to run <em>Smalltalk 80</em>, people were hooked. These series of three computers demonstrated the WIMP (Windows, Icons, Menus, Pointer) interface so well that it spawned a revolution in computing almost overnight. Within a few years many computer users got a taste of a windowing system of some kind, and you might say they never looked back. --> X ウィンドウに盛り込まれたたくさんのアイディアもまた、70 年代後半の PARC の予言者たちのように、コンピュータに関わる仕事をしていた Xerox 社の <em>パロアルトリサーチセンター(Palo Alto Research Center,PARC)</em>の 研究に由来するものでした。これらのコンピュータは売りものになるものはほ とんどありませんでしたが、Xerox が Smalltalk 80 を動かすために構築した ウィンドウシステムを実演した時、人々はすっかりとりこになってしまいまし た。WIMP (複数のウィンドウ、アイコン、メニュー、ポインタ)インターフェー スを実演した 3 種類のコンピュータのシリーズは大変すばらしいものだったの で、ほとんど一夜にして革命を引き起こしてしまいました。数年のうちに多く のコンピュータユーザはウィンドウ操作システムの味をしめ、もはやあと戻り はできないと言うようになったのです。 <!-- X Window is currently developed and distributed by the X Consortium, however, a liberal license permits the existence of free and low-cost implementations. The version of X used on Linux is XFree86. XFree86 is a collection of X servers for UNIX-like OSs on Intel x86 platforms. The work is derived from X386, and much of it is contributed back into X11R6 thereafter. We can think of XFree86, for all intents and purposes, to be X Window for Linux, unless you have purchased another X server. --> 現在では X コンソーシアムが X ウィンドウの開発・配布を行っていますが、 自由なライセンス制度があるのでフリーのものや低価格のものがあります。 Linux で使われている X のバージョンは、XFree86 で、XFree86 は イン テル x86 プラットホーム上での UNIX 類似の OS 類のための X サーバコレク ションです。この仕事は、x386 の時代に由来しており、そのほとんどは、 X11R6 以降に戻って配布されました。事実上、別の X サーバを使わないなら、 XFree86 は Linux の X ウィンドウになるべきものだと考えて良いでしょう。 <!-- X Window is built upon a great many toolkits, or libraries. It is built upon the X Toolkit Intrinsics and the Athena Widgets. Many programs use XView or Motif tools. More still are part of a newer, unified windowing and communication system, like GNOME or KDE. If you find many of your programs not compiling, or are getting strange and inexplicable errors, you may wish to make sure that you have installed X correctly, because most of these libraries (with the exception of Motif) are free and most likely preinstalled with X on your system. And remember, it's called X Window, <em>not</em> X Windows! --> X ウィンドウは多くのツールキットとライブラリ群からなりたっています。そ れは、X Toolkit Intrinsics と Athena Widgets からなるものです。多くの プログラムは XView と Motif ツールを使用しています。さらにウィンドウ操 作やコミュニケーションシステムを統合した GNOME や KDE のような新しいも のもあります。お使いの多くのプログラムがコンパイルしなくてもよい、ある いは不思議で不可解なエラーを出すなら、正しく X をインストールしたかど うかを確かめたと思うかもしれません。なぜなら、これらほとんどのライブラ リ( Motif を除いて)はフリーのもので、お使いのシステム上で X とともにプ レインストールされるからです。 覚えておいてください。X Window であって、X Windows では<em>ありません。</em> (校正者註: X Consortium が要求する名称は man X の出力にある通り「 X, X Window System, X Version 11, X Window System, Version 11, X11 」のい ずれかなのですが、原文の表記を尊重し X の呼称については変更しません) <!-- <sect1>Anatomy of Your Desktop --> <sect1> デスクトップの解剖 <!-- <p>There are a few basic principles and terms you should familiarize yourself with to make using X much more straightforward. These terms will appear over and over again in the manual pages and help files, which it is suggested that you consult whenever necessary. --> <p> X をもっとわかりやすく使うために、知っておいたほうがよい基本的な原則 と用語がいくつかあります。これらの用語は必要なときにはいつでも使えるマ ニュアルページやヘルプファイルのなかに繰り返しでてきます。 <!-- The <bf>screen</bf> is your whole ``desktop'', and the words may be used interchangeably. Technically it means the primary video display you view X with, and you can have more than one screen, in fact you can have more than one computer running off a single X server. This is beyond the scope of this humble document, but you should be aware of the distinction. --> <bf>スクリーン(screen)</bf> は、お使いの "デスクトップ(desktop)" 全体の ことですが、その言葉は 2 つのものをどちらも指すように使われているかもし れません。技術的に言うと、まずはあなたが X を見ているビデオディスプレ イのことを指し、あなたはひとつ以上のスクリーンを見ることができます。実 際、ひとつの X サーバも走らせていない 1 台のコンピュータよりももっと多 くを見ることができます。これはこの文書で書く範囲を超えたことですが、違 いはわかるはずです。 <!-- The <bf>root window</bf> is the background of your screen. It is referred to a window in name alone, it does not behave like any other window, but rather you run your applications on the root window, or put a picture on it, or just a solid color. --> <bf>ルートウィンドウ</bf>はお使いのスクリーンの背景のことです。名前だ けウィンドウと呼ばれていますが、他のウィンドウのように働くわけではあり ません。ルートウィンドウでアプリケーションを動かしたり、あるいはその上 に絵を貼り付けたり、あるいは単にある色で塗りつぶすこともあります。 <!-- The <bf>window manager</bf> is the main interface between the X Window system and the user. Without the window manager, the system would be rather difficult to use, and would certainly not be a very productive tool. The window manager provides such functionality as window borders, menus, icons, virtual desktops, button bars, tool bars, and allows the user to customize it at will, often adding to its functionality in the process. --> <bf>ウィンドウマネージャー</bf>は X ウィンドウシステムとユーザ間でのメイ ンインターフェースです。ウィンドウマネージャーがないと、システムを使うの はより難しくなり、たぶん生産的なツールにはならないでしょう。ウィンドウ マネージャーはウィンドウ枠、メニュー、アイコン、さまざまなデスクトップ、 ボタンバー、ツールバーなどをユーザがカスタマイズできるようにし、場合に よっては作業中にその機能を追加して、より機能的なものを提供します。 <!-- The <bf>pointer</bf> is the arrow or indicator of any given shape which represents the location your mouse (or other pointing device) corresponds to on the screen. The pointer often changes to give you contextual feedback as to what will happen when you use the mouse at that point on the screen. --> <bf>ポインター</bf>とは矢印のことですが、スクリーン上で対応するマウス (あるいは別のポインティングデバイス)の位置を表す何かきまった形の印です。 ポインターはしばしばスクリーン上のその位置で、マウスを使えば引き起こさ れるさまざまなことに関してあなたの注意をうながすために形を変えます。 <!-- The <bf>window</bf> is a frame in which any given application resides which is ``managed'' by the window manager. This includes pretty much anything except the so-called root window. Even windows which do not appear to have frames, titles, or normal borders of any kind are being managed by your window manger. The <bf>active window</bf> is the window you are currently using, the window that will receive text when you type, and is traditionally denoted by the fact that your mouse cursor is pointing at it, though this is not always the case. The active window is said to have ``focus,'' the rest of the windows on your display being ``unfocused.'' --> <bf>ウィンドウ</bf>は、ウィンドウマネージャーによって "管理されている" さ まざまなアプリケーションに与えられている窓わくのことです。これにはいわ ゆるルートウィンドウ以外のこまごましたものを含んでいます。フレームやタ イトル、あるいは通常の枠を持たないウィンドウ類でさえ、ウィンドウマネージャー によって管理されています。<bf>アクティブウィンドウ</bf>というのは、現 在使用しているウィンドウのことです。入力したテキストを受け取るウィン ドウであり、これはいつもそうであるとは限らないのですが、伝統的にマウス カーソルがそこにあるということでわかります。アクティブウィンドウは "フォー カス"になっていると呼ばれ、使ってないウィンドウは"アンフォーカス"であ ると言います。 <!-- <bf>Menus</bf> and <bf>icons</bf> behave in X similar to the way they behave in other windowing systems, and the same general principles apply. Windows with text only are called <bf>terminal emulators</bf>, an example would be xterm, and these basically emulate a console text-only display, but let you multiplex and use more than one at a time, and have many other advantages available due to their being used in X. We shall discuss many of these later on. --> <bf>メニュー</bf>と<bf>アイコン</bf>は、別のウィンドウシステムでの動 きと同様に X でも動き、同様の一般的な原則が適用されます。テキストのみ のウィンドウは<bf>ターミナルエミュレータ</bf>と言われ (たとえば xterm がそうです) 、これらは基本的にテキストのみをディスプレイにエミュ レートしますが、複数の仕事をこなし、同時に 1 つ以上を使用します。さら に X で利用できる多くの利点を持っています。 この件についてはあとの章 で述べます。 <!-- <sect1>Invoking X Window --> <sect1> X ウィンドウを起動する <!-- <p>Starting X can be done in several ways. On your system it may be set up to start automatically, and you will not need to read this section. Most Linux systems, however, presently start at the command line upon login, and you have to decipher this for yourself. --> <p> X を起動するにはいくつかの方法があります。お使いのシステムで自動的に起 動するように設定できるなら、このセクションを読まなくても良いでしょう。 しかし、ほとんどの Linux システムは、いまのところは、ログインしたらコ マンドラインで起動しますから、あなたは自分でこれを解読しなければなりま せん。 <!-- The most basic way to start X is with <bf>xinit</bf>. This will put you at a blank desktop, by default, and with no window manager loaded. If no client program is specified on the command line, <bf>xinit</bf> will look for the <em>.xinitrc</em> file to run as a shell script, to start up client programs. If this file does not exist, <bf>xinit</bf> will use the following command as a default: <tscreen><verb> xterm -geometry +1+1 -n login -display :0 </verb></tscreen> --> X を起動するもっとも基本的な方法は <bf>xinit</bf> です。これは、 ウィンドウマネージャーを持っておらず、デフォルトではデスクトップの空いた 場所に開きます。クライアントプログラムがコマンドラインで特定されていな ければ、<bf>xinit</bf> は、シェルスクリプトとして実行してクライアン トプログラムを起動させるために .xinitrc ファイルを探します。このファ イルがなければ、<bf>xinit</bf> はデフォルトで次のようなコマンドを使い ます。 <tscreen><verb> xterm -geometry +1+1 -n login -display :0 </verb></tscreen> <!-- As you see, this is not very helpful. The most common way to start X is with the command <bf>startx</bf>. This is the most civilized fashion to start the windowing system, but requires that you log in from a text shell, and start the windowing system yourself. For many Linux users this is the most common way to start X, it is also the most flexible. You can issue commands such as the following: <tscreen><verb> startx -- -bpp 8 #start x in 256 color mode startx -- -bpp 32 #start x in true color mode </verb></tscreen> --> ごらんのように、これはあまり親切なものではありません。X を起動するもっ とも普通の方法は、<bf>startx</bf>というコマンドで行います。これはウィ ンドウシステムを起動するもっとも一般的な形ですが、テキストシェルから入っ て、自分でウィンドウシステムを起動します。多くの Linux ユーザにとって これが X を起動するもっとも普通の方法で、それがもっとも自在な方法なの です。次のようなコマンドを使うことができます。 <tscreen><verb> startx -- -bpp 8 #start x in 256 color mode startx -- -bpp 32 #start x in true color mode </verb></tscreen> <!-- The double dashes pass arguments directly to xinit, and this way you can start up X in the resolution your work will require, and still have it use the configuration files we will cover later in this document. --> 2 つ続くダッシュ(--) はxinit に直接に数値を渡し、これであなたが求める 解像度で X を起動できます。さらに設定ファイルを使う方法についてはこの 文書の最後で述べます。 <!--<sect1>The X Display Manager --> <sect1> X ディスプレイマネージャー <!-- <p>The program <bf>xdm</bf> provides similar services to <bf>getty</bf> and <bf>login</bf>, which allow users to log into a system and start their basic shell. If you start X with <bf>xdm</bf>, however, users need only to type in their username and password at a friendly prompt, and they are dropped directly into the graphical environment. This is simple and easy to use, and is seen frequently in college campuses, cyber cafes, business environments, anywhere you have users not necessarily familiar with Unix to any great extent. --> <p> <bf>xdm</bf>というプログラムはユーザをシステムにログインさせ、基本シェ ルを起動する <bf>getty</bf> と <bf>login</bf> と同様の働きをします。 <bf>xdm</bf> で X を起動すると、見慣れたプロンプトでユーザはユーザネー ム(username)とパスワード(password) だけを入力します。そうすればユーザ は直接的にグラフィック環境に入ります。このようなやり方はシンプルで簡単 にできますから、大学やサイバーカフェやビジネスの分野、あるいはある広い 範囲で Unix を知る必要のないユーザがいるところでときどき見かけます。 <!-- <bf>xdm</bf> can be configured with configuration files located in <em>/usr/X11R6/lib/X11/xdm</em> on your Linux system. The file <tt>xdm-config</tt> is for configuring how the login screen appears to users, and <tt>Xsetup_0</tt> is used to tell xdm what programs should be launched when X is started. Some of the configuration a normal user would put in their <tt>.xinitrc</tt> file should go in here, if xdm is to be normally used. --> <bf>xdm</bf> はお使いの Linux システム上の <em>/usr/X11R6/lib/X11/xdm</em>にある設定ファイルで設定することができ ます。<tt>xdm-config</tt> というファイルはログインスクリーンがどのよう にユーザに現れるかについての設定をします。そして、<tt>Xsetup_0</tt>は、 X が起動するときにどのようなプログラムを配置したら良いかを xdm に知ら せるために使います。 xdm が標準として使われるなら、 一般のユーザについ てについての設定は<tt>.xinitrc</tt>ファイルに書くのも良いでしょう。 <!-- Here is a sample <tt>Xsetup_0</tt> file to look at, which might help to configure your system. The <tt>xfstt</tt> program is the TrueType font server, and is discussed later in this document. Also, notice that we're using a shell script here, and it's trying to call <bf>xv</bf> to set the background to a nice picture (instead of the boring black and white background pattern), and if that call fails, <bf>xsetroot</bf> is called, to at least try to set the background to a nice blue color. <tscreen><verb> #!/bin/sh xconsole -geometry 480x100-0-0 -daemon -notify -verbose -fn \ '-schumacher-clean-medium-r-*-*-10-*-*-*-*-*-*-*' -exitOnFail /usr/X11R6/bin/xfstt & /usr/X11R6/bin/xv -quit -root \ /usr/local/share/WindowMaker/Backgrounds/InDreams.jpg \ || xsetroot -solid darkblue xset fp+ unix/:7100 </verb></tscreen> --> 以下のものはお使いのシステムの設定の参考になるかもしれない <tt>Xsetup_0</tt> ファイルの例です。<tt>xfstt</tt> というプログラムは、 TrueType フォントサーバで、この文書のあとの章で述べられています。また、 ここでシェルスクリプトを使っていることに注意してください。ちょっと素敵 な画像(モノクロの背景のかわりに)をバックグラウンドに設定するために <bf>xv</bf> を呼び出します。もしうまくいかないなら、 <bf>xsetroot</bf> が呼びだされ、少なくとも背景を素敵なブルーに設定するようにします。 <tscreen><verb> #!/bin/sh xconsole -geometry 480x100-0-0 -daemon -notify -verbose -fn \ '-schumacher-clean-medium-r-*-*-10-*-*-*-*-*-*-*' -exitOnFail /usr/X11R6/bin/xfstt & /usr/X11R6/bin/xv -quit -root \ /usr/local/share/WindowMaker/Backgrounds/InDreams.jpg \ || xsetroot -solid darkblue xset fp+ unix/:7100 </verb></tscreen> <!-- Many distributions of Linux include this facility automatically. If you are able to look at the run levels for your Linux system, you can probably see that run level 3 is the normal startup (look under <tt>/etc/rc.d</tt>) unless you're booting into something like <em>xdm</em>. If you are, you're going to be starting in run level 5. This is something of a standard on Linux (and similar) systems. Programs such as <em>linuxconf</em> and its functional equivalents should be able to adjust this. --> 多くの Linux ディストリビューションはこの処理を自動的に行います。もし お使いの Linux システムのランレベルを見ることができる場合、起動してそ のまま <em>xdm</em> などが立ち上がらなければ、ランレベル 3 が通常の起 動であることが分かるでしょう(<tt>/etc/rc.d</tt> 以下を参照)。 <em>xdm</em> が立ち上がる場合には、ランレベル 5 で起動しています。 これは Linux (および類似の)システムの標準のようなものです。 <em>linuxconf</em> やこれと同じ機能を持つプログラムは、この設定を行え るはずです。 <!-- Also on many newer Linux systems are facilities such as <em>gdm</em> and <em>kdm</em>, which are GNOME and KDE aware equivalents of this program. Primarily, this just changes the look and feel to suit your desktop preferance, but often these other versions contain more features, such as remembering which desktop environment you last logged in to, the ability to shutdown and reboot from the console, and so forth. --> 新しい Linux システムの多くは、<em>gdm</em> や <em>kdm</em> といったプ ログラムがあります。これは <em>xdm</em> に対応する GNOME や KDE のプロ グラムです。基本的には、これはデスクトップのルック & フィールをユー ザの好みに合わせて変えるだけですが、このような別バージョンのプログラム はもっと多くの機能を持つこともしばしばあります。例えば、最後にログイン した時のデスクトップ環境を記憶することや、コンソールからシャットダウン や再起動を行う機能などです。 <!-- 担当: 大西 --> <!-- <sect>Choosing a Window Manager <p>This is a discussion of the window managers available to the X Window user, with a comparison of some finer ones to choose from. In order to prevent this document from becoming overwhelmingly large (and proportionally difficult to maintain, as well) I am limiting the discussion to the more popular and well known window managers out there. I believe these are most representative for our purposes, and once you grasp the basic concepts of a few, you more or less will have the hang of them all. --> <sect>ウィンドウマネージャーの選択 <p>ここでは X ウィンドウのユーザーが利用できるウィンドウマネージャー について議論します。優れたものをいくつか列挙し、それらを比較します。 この文書が巨大になるのを防ぐために(それに比例して維持するのが難しくも なりますしね)、人気があり有名なウィンドウマネージャーだけについて議論 します。選んだものはこの文書の目的に相応しいものだと思っていますし、一 度いくつかのウィンドウマネージャーで基本的な概念を理解してしまえば、他 のものにもだいたい通用するでしょう。 <!-- Your choice of window manager can dramatically influence how pleasant your computing experience will be. You spend much of your time dealing with windows when you're in X, and you don't want something that's too obtrusive, one that will get in your way. Some window managers are extremely customizable, to the point that you can pretty much feel like it's a new operating system. If you don't like icons, get rid of them! If you miss that toolbar, you can build a better one, and it can be a pretty painless and rewarding process besides. --> ウィンドウマネージャーの選択は、あなたのコンピュータ生活が楽しいものに なるかどうかに非常に強く影響を及ぼします。X を使っている時、ウィンドウ を扱うのに費やす時間が多いので、押しつけがましいもの、邪魔になるような ものを使いたくはないでしょう。いくつかのウィンドウマネージャーは、全く 新しいオペレーティングシステムを使っているかのような感覚になれるほど、 極度にカスタマイズ可能です。アイコンが嫌いなら、取り除いちゃえばいい! ツールバーが懐かしくなったら、もっといいものを作ることができますし、そ の上それはとても簡単でやりがいがあります。 <!-- <sect1>FVWM And Its Ancestors <p>The most common window managers nowadays have their roots in Robert Nation's FVWM window manager. These include FVWM, FVWM2, FVWM95, and many more. FVWM itself is derived partly from TWM, which comes with an X Window installation, but which we will not cover here. The syntax and usage of TWM is similar to FVWM, but it actually uses more memory, and feels clumsy and awkward to most users. --> <sect1>FVWM とその祖先 <p>今日よく使われているウィンドウマネージャーのほとんどは、Robert Nation による FVWM ウィンドウマネージャーをルーツにしています。これに は、FVWM, FVWM2, FVWM95 やその他諸々が含まれます。FVWM 自身は、部分的 に TWM に由来しています。TWM は X Window をインストールすると付いてく るものですが、ここでは扱わないことにします。TWM の構文や使い方は FVWM に似ていますが、より多くのメモリを使いますし、扱いにくく不格好だと感じ ている人が多いからです。 <!-- FVWM is the original and old standby favorite Linux window manager. Now that the 2.0 of versions of FVWM have become stable and in more general usage, this newer version is preferred, for the syntax is much more direct and simplified, and much more flexible as well. However, many people still have the original FVWM on their systems, as it has been a long time favorite and standard, and most of the examples in this text are equally applicable to this older version. And if the older one is working fine for you, there may be no need to upgrade, since it may break your configuration files to some degree, for some of the syntax has indeed changed, and is not altogether backward compatible. Such is the nature of progress. --> FVWM は Linux の初期から頼りにされ愛されたウィンドウマネージャーです。 現在は FVWM のバージョンが 2.0 になり、安定に動作し、より一般的な使い 方ができるため、新しいバージョンの方が好まれます。構文がより直接的に簡 略化され、柔軟にもなったからです。しかし、FVWM は長い間愛され、標準で あったために、多くの人が未だにオリジナルの FVWM を自分のシステムに持っ ています。この文書の用例のほとんどは、古いバージョンにも同様に適用でき ます。もしあなたにとって古いバージョンが満足のゆくものなら、アップグレー ドの必要はないでしょう。あなたの設定ファイルをいくらか壊してしまうかも しれませんし、構文のいくつかは実際に変わり、全体として後方互換性がない からです。これは進歩の性質ですね。 <!-- Nobody seems quite sure what F in FVWM stands for (not even the author, from what I can tell!), but the VWM would seem to (correctly) indicate Virtual Window Manager, and indeed the FVWM series are virtual window managers, and that is one of their strengths. You can bind keys to any function, including the switching between the virtual desktops, and do this with ease. --> FVWM の F が何を表しているか断言できる人はいないようです。(作者にさえ わからないのに、私がいえることではないですよね!) しかし、VWM が仮想ウィ ンドウマネージャー(Virtual Window Manager)を(正確に)表しているようです。 実際 FVWM シリーズは仮想ウィンドウマネージャーですし、それが特長のひと つです。仮想デスクトップ間の移動のような任意の機能を、キーに割り当てて 簡単に利用することができます。 <!-- <bf>FVWM2</bf> is the new standard, including many improvements and features not found in the previous version. Unlike many newer window managers, it works just fine on 8-bit, 256 color displays, which I am using at the moment, and still can be improved with little icons and gradients, to look as much like the Win98 interface as you may or may not want. This version is also much more extensible in general, and allows the use of themes and dynamic menus. Technically, FVWM2 is still in beta, but it works just great, and I have not yet had a single problem with it. --> <bf>FVWM2</bf> は、前のバージョンに見られなかった多くの改良点、機能を もつ新しい標準です。より新しいウィンドウマネージャーと違って、8 ビット、 256 色のディスプレイで快適に動きます。現在私が使っているものです。あな たが望むか望まないかは分かりませんが、小さなアイコンを使って Win98 の インターフェースに似せるという目標があるので改良のテンポはゆっくりとし たものです。FVWM2 は FVWM より比べて機能をより拡張できるようになってい て、テーマやダイナミックメニューが使用できます。FVWM2 は技術的にはまだ β版ですが、非常によく動作し、私はまだ一つも問題を感じたことはありません。 <!-- <descrip> <tag>Resources:</tag>The official FVWM and FVWM2 site is <url url="http://www.hpc.uh.edu/fvwm/">. The latest version should always be available at <url url="ftp://ftp.hpc.uh.edu/pub/fvwm/">. </descrip> --> <descrip> <tag>リソース:</tag>公式 FVWM ,FVWM2 のサイトは<url url="http://www.hpc.uh.edu/fvwm/">です。最新バージョンは <url url="ftp://ftp.hpc.uh.edu/pub/fvwm/">から入手できます。 </descrip> <!-- <sect1>The Wide World of Window Systems <p>For users more familiar with other window environments on other operating systems, there are plenty of window managers to emulate the desktop you're accustomed to. --> <sect1>ウィンドウシステムの広い世界 <p>他のオペレーティングシステムで他のウィンドウ環境に親しんだユーザー のために、使い慣れたデスクトップをエミュレートするウィンドウマネージャー はたくさんあります。 <!-- The <url url="http://berta.fri.uni-lj.si/~markom/icewm" name="icewm"> window manager is aimed at a more consistent look and feel, and can emulate many other windowing system standards, hot key bindings, and such. The OS/2 emulations are particularly nice. <url url="http://www.lysator.liu.se/~marcus/amiwm.html" name="AmiWM"> is an Amiga Workbench type window manager, <url url="http://www.bioele.nuee.nagoya-u.ac.jp/member/tak/mlvwm.html" name="mlvwm"> is a MacOS emulator. A nice addition to these window managers is <url url="http://www-c.informatik.uni-hannover.de/~kaiser/dfm/dfm.html" name="dfm">, a desktop and file manager that pleasantly resembles the OS/2 Workplace Shell. --> <url url="http://berta.fri.uni-lj.si/~markom/icewm" name="icewm"> ウィ ンドウマネージャーは統一のとれたルック & フィールを持つことを目指して います。そして、多くの他のウィンドウシステムの標準、ホットキーのバイン ディングなどをエミュレートできます。OS/2 のエミュレートは特によくでき ています。<url url="http://www.lysator.liu.se/~marcus/amiwm.html" name="AmiWM">は、Amiga Workbench 型のウィンドウマネージャーで、<url url="http://www.bioele.nuee.nagoya-u.ac.jp/member/tak/mlvwm.html" name="mlvwm"> は、MacOS のエミュレータです。これらのウィンドウマネー ジャに、<url url="http://www-c.informatik.uni-hannover.de/~kaiser/dfm/dfm.html" name="dfm">という OS/2 Workplace シェルに嬉しいくらいそっくりなデスク トップとファイルのマネージャーを付け加えるといいでしょう。 <!-- <descrip> <tag>Resources:</tag>The Window Managers website can be found at <url url="http://www.PLiG.org/xwinman/">, and is a consistently good resource for finding out about the variety of window managers available, particularly for finding good window managers to emulate other windowing environments. Many more still are listed at <url url="http://www.PLiG.org/xwinman/others.html">, provided by the same author as the previous link, and this is quite a formidable and complete list indeed. You can download Linux versions of most popular window managers at the <url url="ftp://metalab.unc.edu/pub/Linux/X11/window-managers" name="metalab"> archive. </descrip> --> <descrip> <tag>リソース:</tag>The Window Managers のウェブサイトは <url url="http://www.PLiG.org/xwinman/">にあります。ここは、利用可 能ないろんなウィンドウマネージャーを発見するための統一感のあるリソー スで、特に他のウィンドウ環境をうまくエミュレートするウィンドウマネー ジャーを見つけるには絶好のサイトです。前述のリンクと同じ作者による <url url="http://www.PLiG.org/xwinman/others.html"> で、より多くが列挙され ています。ここには、実に膨大で完全なリストがあります。Linux で使用で きる人気のあるウィンドウマネージャーは、<url url="ftp://metalab.unc.edu/pub/Linux/X11/window-managers" name="metalab"> アーカイブからダウンロードできます。 </descrip> <!-- <sect1>The X Graphical Interfaces <p>Open Look and Motif were early attempts to standardize X Window, and make it usable in more mainstream environments, around a greater variety of workstations. Both were somewhat successful at those attempts (in look and feel, if not politically) and can be used under a modern Linux system. Both require specific libraries, which can be used to compile a variety of applications specifically designed for one or the other environment, to give all programs a similar look and feel. --> <sect1>X のグラフィカルインターフェース <p>Open Look や Motif は X Window を標準化するために、早い時期から始まっ た試みで、非常に多くのワークステーションで主流となっている環境で X Window を使えるようにしました。この二つの試みはある程度の成功を(公式の 標準となったわけではないですが、ルック & フィールの点で)収めていて、 最近の Linux システムでも使うことができます。OpenLook、Motif にはそれ ぞれ専用のライブラリが必要です。各専用ライブラリは OpenLook あるいは Motif 用に設計されたアプリケーションをコンパイルするためのもので、それ ぞれ用のプログラムがどれも類似したルック & フィールをしているのも専 用ライブラリを使用しているからです。 <!-- Starting with X11 Release 5, Sun Microsystem's <bf>OpenWindows</bf> graphical interface was available to X users. This includes two versions of the Open Look Window Manager, <em>olwm</em> and <em>olvwm</em> (with a virtual desktop). This was developed by Sun in hopes of making a standard windowing environment, and indeed it was standard with Solaris for many years. If your distribution of Linux did not come with this windowing system installed, you must remember to install the <em>XView</em> libraries to get it to work, and you will also have to put the <em>/usr/openwin/...</em> directories in your search path. --> X11 のリリース 5 から、Sun Microsystem の <bf>OpenWindows</bf>グラフィ カルインターフェースを X のユーザーが利用できるようになりました。これ には<em>olwm</em>と<em>olvwm</em>(仮想デスクトップつき)という OpenLook を用いたウィンドウマネージャーの二つのバージョンがついています。Sun が 標準のウィンドウ環境とするべく開発し、実際に Solaris においては何年も の間標準でした。もしお使いの Linux のディストリビューションにこのウィ ンドウシステムがインストールされていないのなら、それを動作させるために は<em>XView</em> ライブラリをインストールし、<em>/usr/openwin/...</em> ディレクトリをあなたのサーチパスに加えなければいけないことを覚えておき ましょう。 <!-- If you want the actual <bf>OSF/Motif Toolkit</bf> for Linux, you'll have to pay, the programs and toolkit are not free. However, the <em>Hungry Programmers</em> have written <bf>LessTif</bf>, which allows you to compile Motif programs more or less as if you owned to toolkit. LessTif is a clone of the Motif toolkit. Currently LessTif is partially implemented with most of the API in place. Many programs already work under this free version of the toolkit, and it even comes with a window manager, derived from FVWM code, which you'd swear was the Motif Window Manager. --> あなたが本物の Linux 用の <bf>OSF/Motif Toolkit</bf> を欲しいのなら、 プログラムやツールキットは無料ではないので、お金を払わなければいけませ ん。しかし、<em>Hungry Programmers</em> は、ツールキットを持っているか のように Motif のプログラムを大体コンパイルできる、 <bf>LessTif</bf> を書きました。LessTif は Motif ツールキットのクローンです。今のところ LessTif はほとんどの API が、部分的ではありますが適切に実装されていま す。ツールキットのフリーなバージョンの下で、すでに多くのプログラムが動 作します。FVWM のコードから派生したものですが、Motif ウィンドウマネー ジャと言い切れるようなウィンドウマネージャーさえ付いてきます。 <!-- The most useful feature of this toolkit, however, is compiling programs dependent on having a Motif library on your system. The window manager is nothing spectacular, and mostly useful if you're migrating from the original Motif, and want to keep your configuration file. For all intents and purposes, you will find FVWM much more feature-filled and useful, and it looks and behaves almost identically, even recognizing the window hints supplied by programs built with the Motif toolkit. --> しかしながら、このツールキットの最も便利な特徴は、システムに Motif ラ イブラリを持っていないとコンパイルできないプログラムがコンパイルできる ことです。ウィンドウマネージャーは目をみはるようなものではないので、主 に有用なのは、オリジナルの Motif から移ってきて、設定ファイルをそのま ま使いたい時くらいなものです。どの点からみても、FVWM の方が機能が揃っ ていて便利であることに気がつくでしょう。FVWM はほとんど同じような見栄 え、振る舞いをしますし、Motif ツールキットで作られたプログラムが提供する ウィンドウヒントですら理解します。 <!-- <descrip> <tag>Resources:</tag>The Hungry Programmers LessTif can be found at <url url="http://www.lesstif.org/">. </descrip> --> <descrip> <tag>リソース:</tag>Hungry Programmers LessTif は、<url url="http://www.lesstif.org/"> にあります。 </descrip> <!-- <sect1>The X Desktop Environments <p>The second generation of Linux window managers was brought about by KDE, and soon joined by GNOME. There are some striking similarities, and some great differences, between these two, and I will attempt to cover them here. The most important thing to remember at this point is that neither of them is in any way a complete product. Both are at the start of a long development cycle, and not completely stable yet, and as such are not suited to mission-critical work at this time. --> <sect1>X のデスクトップ環境 <p>第二世代の Linux のウィンドウマネージャーは KDE によってもたらされ、 その後すぐ GNOME が加わりました。両者は、よく似ている部分もいくつかあ りますが、全く異なっている部分もあります。ここではそれらをカバーするつ もりです。現時点で記憶しておくべき最も重要なことは、両者ともいかなる意 味においても、完全な製品だとは言えないことです。両者は長い開発サイクル の入口に立ったばかりで、まだ完全には安定していないので、現時点ではミッ ションクリティカルな仕事には向きません。 <!-- <bf>The KDE Desktop Environment</bf> (A quote from the home page:) <em>``KDE is a completely new desktop, incorporating a large suite of applications for Unix workstations. While KDE includes a window manager, file manager, panel, control center and many other components that one would expect to be part of a contemporary desktop environment, the true strength of this exceptional environment lies in the interoperability of its components.''</em> --> <bf>The KDE Desktop Environment</bf> (ホームページからの引用:) <em>``KDE は、多くの Unix ワークステーション 用のアプリケーションをふんだんに組み込んだ、全く新しいデスクトップです。 KDE はウィンドウマネージャー、ファイルマネージャー、パネル、コントロー ルセンター、そして現代のデスクトップ環境の一部として期待されるほかの構 成要素の多くを含んでいますが、この類を見ない環境の真の長所は、構成要素 の相互運用性にあります。''</em> <!-- The KDE Desktop Environment is an attempt to make a desktop environment, not just a window manager. The tools of KDE work together so well, for instance, one might be fooled into thinking KDE was an entire operating system. All the tools to work in a windowing system are included, and many more have been ported to the KDE environment. KDE has achieved a surprising level of maturity already, but many are reluctant to install it on their desktop, because of the licensing stipulations of the QT toolkit, upon which KDE is based. This has changed a little lately, and the licence now qualifies as Open Source by definition, but is not the same as that of GNU software. --> The KDE Desktop Environment は、ウィンドウマネージャーだけでなく、デス クトップ環境を作成する試みです。KDE のツールが協調してとてもうまく動く ので、KDE は完全なオペレーティングシステムじゃないのかとだまされてしま うかもしれません。ウィンドウシステムで作業するための全てのツールは含ま れていますし、KDE の環境にはさらに多くのツールが移植されています。KDE は既に驚くべきレベルまで成熟していますが、多くの人が KDE がベースとし ている Qt ツールキットのライセンス規約のために、自分のデスクトップにイ ンストールするのに乗り気ではありません。これは最近変更があり、現在のラ イセンスは定義上はオープンソースと認められますが、GNU ソフトウェアのも のと同一ではありません。 <!-- For those just looking to get down to business, KDE is often the way to go. This project has been around for some time now, and has let go of some flashiness for the ability to get lots done. In many ways you can become fooled into thinking you're using a product strikingly similar to the good parts of Windows. Which can be a good thing. But it can also be somewhat frustrating, and one longs after a while for something a little different from the paradigm upon which KDE is firmly based. --> 本気で取り組むことを探している人には、KDE はしばしば良い題材です。この プロジェクトは今まで活発でしたし、能力のある人を活躍させてきました。 KDE は色々な点で、Windows の良い部分に極めてよく似た製品を使っていると 錯覚することがあります。これは良いことです。しかし、これはいくぶん失望 することでもあります。そのためしばらくすると KDE がしっかりと基づいて いるパラダイムから少し離れた何かを求めることになります。 <!-- <bf>GNOME: The GNU Object Model Environment</bf> (A quote from the home page:) <em>``GNOME stands for GNU Network Object Model Environment. The GNOME project intends to build a complete, user-friendly desktop based entirely on free software. GNOME is part of the GNU project, and GNOME is part of the OpenSource(tm) movement. The desktop will consist of small utilities and larger applications which share a consistent look and feel. GNOME uses GTK+ as the GUI toolkit for all GNOME-compliant applications.''</em> --> <bf>GNOME: The GNU Object Model Environment</bf> <!-- :ohnishi ホームページからの引用でいっているように GNOME: The GNU Network Object Model Environment なんですよね(Web Page で確認済み)。原著者に報告でしょうか? --> (ホームページからの引用:) <em>``GNOME とは "G"NU "N"etwork "O"bject "M"odel "E"nvironment(GNU ネットワークオブジェクトモデル環境)のことで す。GNOME プロジェクトは完全でユーザーフレンドリーなデスクトップを全く のフリーソフトウェアとして実現しようとしています。GNOME は GNU プロジェ クトの一部で、OpenSource(tm) 運動の一部でもあります。デスクトップは小 さいユーティリティと統一のとれたルック & フィールを共有したより大き いアプリケーションから構成されます。GNOME はそのアプリケーションの GUI ツールキットとして GTK+ を使用します。''</em> <!-- The GNOME project is an attempt to do much of the same work as KDE, but even a little more than that. GNOME is less tied to one window manager, for instance, and it is interoperable not just between applications, but computers and platforms, as it uses the Common Object Resource Broker Architecture (CORBA). Also, and to many most importantly, GNOME is based on the GTk+ toolkit, which is free and open source, unlike the underlying toolkit of KDE, thereby following in the philosophy of Linux itself. --> GNOME プロジェクトは、多くの部分で KDE と同じものを目指していますが、 ほんの少しだけ上を狙っています。例えば、GNOME は特定のウィンドウマネー ジャーにあまり依存していないこともあって、アプリケーション間だけでなく、 コンピュータ間、プラットフォーム間で相互運用が可能です。これは、CORBA (Common Object Resource Broker Architecture)を使っているからです。また、 多くの人にとってより重要なのは、GNOME は、KDE の基礎となっているツール キットとは違って、フリーでオープンソースである GTk+ ツールキットをベー スとしているので、Linux そのものの哲学に沿っています。 <!-- <descrip> <tag>Resources:</tag>The official KDE website is <url url="http://www.kde.org/">. The official GNOME website is <url url="http://www.gnome.org/">. More detailed information regarding the issues surrounding GNOME can be found at <url url="http://www.gnome.org/gnomefaq/FAQ.txt">. The home page of CORBA is located at <url url="http://www.corba.org/"> , and the GTk+ toolkit home is <url url="http://www.gtk.org/"> . </descrip> --> <descrip> <tag>リソース:</tag>KDE の公式ウェブサイトは <url url="http://www.kde.org/"> です。GNOME の公式ウェブサイトは <url url="http://www.gnome.org/"> です。GNOME を取り巻く問題に関するより詳 細な情報は <url url="http://www.gnome.org/gnomefaq/FAQ.txt"> で見つか るでしょう。CORBA のホームページは <url url="http://www.corba.org/"> にあり、GTk+ ツールキットのホームページは <url url="http://www.gtk.org/"> です。 </descrip> <!-- <sect1>The Flashy Window Managers <p>The latest generation of window manger is very very pretty indeed. Sporting every convenience you could think of, and emulating the most beautiful operating systems ever used on the most gorgeous workstations in the world, these are the window managers to run if you've got the memory and CPU cycles to burn. --> <sect1>かっこいいウィンドウマネージャー <p>最新世代のウィンドウマネージャーは、マジでめちゃめちゃかっこいいで す。思いつく限りの便利な使いかたをみせびらかしたり、かつて世の中で最も 豪華なワークステーションで使われた最も美しいオペレーティングシステムを エミュレートできたりするので、充分なメモリーがあり、CPU が火を吹いても 構わないくらい回せるのならば、使ってみたいウィンドウマネージャーです。 <!-- <bf>Window Maker</bf> (A quote from the home page:) <em>``Window Maker is an X11 window manager designed to give additional integration support for GNUstep applications. It tries to emulate the elegant look and feel of the NEXTSTEP(tm) GUI. It is relatively fast, feature rich, and easy to configure and use.''</em> --> <bf>Window Maker</bf> (ホームページからの引用:) <em>``Window Maker は GNUstep のアプリケーショ ンも使えるように設計された X11 のウィンドウマネージャーです。これは、 NEXTSTEP(tm) の GUI の上品なルック & フィールをエミュレートします。 比較的軽く、機能が豊富で、簡単に自分用の設定を行なうことができます。'' </em> <!-- A big strength of this window manager is that it supports the GNU desktop, meaning that it makes a great and very pretty front-end to GNOME. This is also one of the most easily configurable window managers, and can be configured from a graphical interface, and supports the OffiX drag and drop protocol, easy switching of desktop themes, and it's now available within the popular Red Hat distribution, so it's easy and painless to switch from FVWM when the mood finally strikes. As of the 0.50 release, Window Maker supports KDE compliance as well. --> このウィンドウマネージャーの大きな利点は、GNU のデスクトップをサポート しているということです。これの意味するところは、GNOME の素晴らしくかっ こいいフロントエンドであるということです。さらに最も設定し易いウィンド ウマネージャーのひとつでもあり、グラフィカルなインターフェースから設定 ができます。ドラッグ & ドロップのための OffiX プロトコルをサポートし ていますし、デスクトップテーマを簡単に変更できます。さらに、今では普及 している Red Hat ディストリビューションに含まれていますので、最終的に 雰囲気が気に入らなくても FVWM に簡単に乗り換えられます。0.50 リリース から、Window Maker は KDE の下でも動作します。 <!-- <bf>AfterStep</bf> (A quote from the home page:) <em>``AfterStep is a Window Manager for X which started by emulating the NEXTSTEP look and feel, but which has been significantly altered according to the requests of various users. Many adepts will tell you that NEXTSTEP is not only the most visually pleasant interface, but also one of the most functional and intuitive out there. AfterStep aims to incorporate the advantages of the NEXTSTEP interface, and add additional useful features. The developers of AfterStep have also worked very hard to ensure stability and a small program footprint.''</em> --> <bf>AfterStep</bf> (ホームページからの引用:) <em>``AfterStep は当初 NEXTSTEP のルック & フィールをエミュレートすることを目的に作り始めた X のウィンドウマ ネージャーですが、様々なユーザーの要求によって全く変わったものになって います。達人たちは NEXTSTEP は見た目の奇麗なインターフェースを持つだけ でなく、機能的で直観的だといいます。AfterStep は NEXTSTEP インターフェー スのいいところを取り込み、さらに便利な特徴を付け加えることを狙っていま す。AfterStep の開発者は、安定性とプログラムの足跡を小さくすることにも 努力しています。</em> <!-- <bf>Enlightenment</bf> Enlightenment is more than just a window manager, it is an extreme, detailed, and configurable environment, and is particularly attractive in that it allows irregular and completely customizable window shapes. It is open in design, and instead of dictating a policy it allows the user to define their own policy right down to the minute and infinitesimal details; from its functionality right on through to its looks. --> Enlightenment は単なるウィンドウマネージャーであるだけでなく、非常に細 かく設定できる環境であり、特にどんな変な形にでも完全にカスタマイズでき るウィンドウが使えるのが魅力的です。デザインはオープンなので、ポリシー で縛り付けるのではなく、ユーザーが自分自身のポリシーに従って機能の定義 から見栄えに至るまでを細かい部分まで決めることができるようになっていま す。 <!-- If you are using GNOME, you will find that Enlightenment is the default window manager, and in fact, it must be installed for GNOME to function. It is also basically the de facto implementation of the GNOME features for integration, making it the most practical choice for a desktop in that situation. Many other window managers will work alright with GNOME, but you will find that Enlightement excels. Unfortunately, it is still in development, and runs slowly and imperfectly from time to time. --> GNOME をお使いであれば、Enlightenment がデフォルトのウィンドウマネージャー であることに気づくと思いますが、これを GNOME を機能させるためにインス トールしなければなりません。これは基本的に、統合のための GNOME の機能 の実装の事実上の標準であり、そのためこの状況ではデスクトップの選択とし てもっとも現実的なものになっています。他の多くのウィンドウマネージャー も GNOME 上で正しく動作しますが、その中でも Enlightement が秀でている ことが分かるでしょう。残念ながら Enlightement はまだ開発中であり、動作 は遅い上、不完全な動作をすることも時々あります。 <!-- <descrip> <tag>Resources:</tag>The official Window Maker website is <url url="http://www.windowmaker.org/">. The official AfterStep website is <url url="http://www.afterstep.org/">. Enlightenment can be found, somewhat predictably, at <url url="http://www.enlightenment.org/">. </descrip> --> <descrip> <tag>リソース:</tag>Window Maker の公式ウェブサイトは <url url="http://www.windowmaker.org/"> です。AfterStep の公式ウェブサイト は、<url url="http://www.afterstep.org/"> です。Enlightenment は、名 前からある程度予想できるように、 <url url="http://www.enlightenment.org/"> にあります。 </descrip> <!-- 担当: 田中 --> <!-- 4. Working In X --> <sect>X 上での作業 <!-- In this section we will become familiar with running clients in X Window and the basic procedures involved in using the system. X is not an intuitive interface on its own, and without any window manager, it is easiest to use as a display for programs started from the command line. One of the most common uses for X is just to have several xterm windows open at the same time. Not exactly maxing out the graphics capabilities of the computer, but it's a nice feature to start with. --> <p> この章では X Window 上で動作しているクライアントとシステムにかかわる 基礎的な手続きについて親しんでいきたいと思います。 X はそれ自体が直感的なインターフェースではないので、ウィンドウマネージャーが なければ、コマンドラインから 起動されるプログラムのための ディスプレイとして最もよく使用されています。 最も共通ともいえる X の使用例は、単純に同時に複数の xterm のウィンドウ を開くことです。コンピューターの描画能力を向上させているわけではあり ませんが、まずは素晴らしい特徴であるといえるでしょう。 <!-- max out ってどんな意味だ? --> <!-- The flexibility and usefulness of the command line is so great, in fact, that you don't really need a window manager. It's nice, and you will want it very quickly, but the fact is that you can get by without one, just the command line and the mouse. If you give it a shot, you'll be surprised as to the exact distinctions between the clients and the window manager. If you start toying around with this, however, remember that the key combination Ctrl-Alt-Backspace gets you out of X Window in a pinch. --> <p> コマンドラインの柔軟さと簡便さはとても素晴らしく、実際、ウィンドウ マネージャーが必要とは思わないかもしれません。その素晴らしさ故に、とにかく 速く操作したいと思うでしょう。しかし実際は、コマンドラインかマウスの どちらかだけで、うまくやっていけるのです。 少し動かしてみれば、クライアントとウィンドウマネージャーの間に存在する 厳密な相違点について驚くことでしょう。しかしながら、そういったことを持て 余しそうなら、困ったときには Ctrl-Alt-Backspace というキーの組み合わせ で X Window から脱出できることを覚えておいてください。 <!-- 4.1. Command Line Options --> <sect1>コマンドラインオプション <!-- Most X programs try to use the same basic names for command line options. All applications written using the MIT X Toolkit Intrinsics automatically accept the following options: --> <p> ほとんどの X プログラムはコマンドラインオプション用に同一の基本的な 名称を使おうとします。MIT X Toolkit Intrinsics を使用して書かれた全ての アプリケーションは、自動的に以下のオプションを受け付けます: <!-- -display display This option specifies the X server to use. See the section on Display Names for details. --> <descrip> <tag>-display ディスプレイ</tag> このオプションは使用する X サーバーを指定します。詳細はディスプレイ 名の章(訳者注:4.2章)を参照のこと。 <!-- -geometry geometry The initial size and location of the window, in a format such as widthxheight+hoffset+voffset or +hoffset-voffset. Note that if you put in a negative horizontal or vertical offset, the window will be placed counting backward from the right or the bottom of the screen, respectively. --> <tag>-geometry サイズと場所</tag> 幅x高さ+水平オフセット+垂直オフセット、もしくは +水平オフセット-垂直オフセット、のような形式で書かれるウィンドゥ の初期サイズと場所のことです。マイナスの水平もしくは垂直オフセットを 入力した場合には、ウィンドウがそれぞれ画面の右もしくは下から遡って 計算されて配置されることに注意してください。 <!-- -font font The font to use for displaying the text in your window. --> <tag>-font フォント</tag> ウィンドウの中でテキストを表示するために使用するフォント。 <!-- -bg color The color to use for the window background. --> <tag>-bg 色</tag> ウィンドウの背景に使用する色。 <!-- -fg color The color to use for the window foreground. --> <tag>-fg 色</tag> ウィンドウの前景に使用する色。 <!-- -name resource-name Useful for specifying the name under which the resources for this application will be found. This is useful to distinguish between invocations of the same application, for example, two xterms can be named differently so that they may inherit different resources based upon those names in the resource database. --> <tag>-name リソース名</tag> アプリケーションのためのリソースを見つけられない状況下において その名前を特定することに役立ちます。これは同一アプリケーションを 呼び出した際に両者を見分けるために役立ちます。例えば 2つの xterm は、 リソースデータベースの中でリソース名に基づいた異なるリソースを 受け継ぐために、異なる名前をつけられるのです。 <!-- -title string This is the title to be used for the window on your display, generally used by the window manager to put a descriptive title at the top of the window. Not to be confused with the -name option. --> <tag>-title 文字列</tag> これはディスプレイ上のウィンドウ用に使われるタイトルです。 一般的には、ウィンドウの一番上に説明的なタイトルをつけるために ウィンドウマネージャーによって使用されます。-name オプションと混同 しないようにしてください。 <!-- -iconic Invoke window as an icon. --> <tag>-iconic</tag> ウィンドウをアイコンとして起動します。 <!-- -xrm resource-string This option specifies a resource name and value to override any defaults that may already be set. Also useful for setting X resources that do not have explicit command line options. For instance, the command line xterm -xrm "xterm*background: blue" is functionally identical to typing xterm -bg blue. --> <tag>-xrm リソース文字列</tag> このオプションは既に設定されているであろう、あらゆる初期設定をも 上書きしてしまうようなリソース名と値を特定します。はっきりとした コマンドラインオプションを持たない X リソースを設定する際にも 有用です。例えば、コマンドライン <tt>xterm -xrm "xterm*background: blue"</tt> は機能上 <tt>xterm -bg blue</tt> のように入力することと同一です。 </descrip> <!-- 4.2. Display Names --> <sect1>ディスプレイ名 <!-- Every X Server has a display name of the form: hostname:displaynumber.screennumber --> <p> 全ての X サーバーは以下の形式でディスプレイ名を保持しています。 ホスト名:ディスプレイ番号.スクリーン番号 <!-- The hostname specifies the name of the machine to which the display is actually, physically connected. The hostname can be omitted, and if so, the server on the same machine will be chosen. In fact, if you are the only one using X on your computer, you will want to just leave this off of your display specifications. The displaynumber should probably be zero, this is used if the X Server is controlling more than one keyboard and monitor unit, for instance, a network of X terminals. The screennumber specifies which monitor in a multiple monitor setup should be used. Following this specification, you would open an xterm window on your local machine with the option -display :0.0. You can see that we have omitted the hostname from the option, so the current machine is assumed. --> ホスト名はディスプレイが実際に物理的に接続されているマシンの名前を 特定しています。ホスト名は省略可能であり、もし省略されるなら、同じマシン上の サーバーが選ばれるでしょう。実際、もしもマシン上で X を使っているのが あなた1人だけなら、ディスプレイの特定の必要はないと思うことでしょう。 ディスプレイ番号はおそらくゼロとされるでしょう。これは X サーバーが 複数のキーボードとモニターのユニット、例えば X ターミナルのネットワーク を制御している際に使われます。スクリーン番号は、セットアップされた 複数のモニターの中からどのモニターが使われるべきかを特定します。この 特定に基づけば、-display :0.0 というオプションを用いた際、ローカルマシン上 に <bf>xterm</bf> のウィンドウが開くでしょう。これはオプションからホスト名を 省略したために、現在使用中のマシンが引き受けたということです。 <!-- On Linux systems, your DISPLAY variable holds your display name, which on my system is :0.0. This is usually set by xterm, or one of the scripts that starts X Window for you, although you can set it yourself, or as discussed above, use the -display command line option when invoking your application. --> Linux システムにおいて、<em>DISPLAY</em> 変数は自分自身のディスプレイ名を <bf>:0.0</bf>であるとして保持します。これは通常 <bf>xterm</bf> もしくは X ウィンドウを開始するスクリプトのうちのどれか一つによって設定されます。 がしかし、それを自分で設定することもできますし、これまでにお話ししてきた ように、アプリケーションを呼び出す際に <bf>-display</bf> のコマンドライン オプションを使うこともできます。 <!-- If you have opened an xterm or rxvt window, and then opted to do super-user work via the su command, you will find that if you try to launch an X application you will have no display to launch it on. Silly it seems, because you are sitting right in front of your display, but the trick to getting this to work is to pass an option on the command line to the program such as -display :0.0, and it will work fine. --> もしも <bf>xterm</bf> あるいは <bf>rxvt</bf> ウィンドウを開いていて、 <tt>su</tt> コマンドを経由してスーパーユーザーとしての作業をしているので あれば、X アプリケーションを起動させようとする際に、それを起動する ディスプレイが 存在しないことが気づくでしょう。それは変だと思うかもしれ ません。 だって、あなたは自分のディスプレイ上で作業をしているわけですから。 しかしこのことを動作させている仕掛けがプログラムへ <tt>-display :0.0</tt> のようなコマンドラインのオプションを引き渡すのです。そしてそれは 正常に動作することでしょう。 <!-- 4.3. XTerm Versus Rxvt, or, Know Thy Terminal Emulator --> <sect1>XTerm 対 Rxvt、もしくは、あなたのターミナルエミュレーター <!-- Your choice of terminal emulator can affect your experience in X almost as much as your window manager, so a little discussion of your best options is due here. A terminal emulator is a program such as xterm, discussed above, which lets you emulate the simple console of Linux in X. You will rely heavily on the program you choose, so it pays to choose it wisely to begin with. --> <p> ターミナルエミュレーターの選択は、ウィンドウマネージャーとほとんど同様 に あなたの X 体験に影響する問題です。ですから、最良のオプションについ て少々のお話をしてみましょう。 <bf>xterm</bf> のようなターミナルエミュ レーターは、すでにお話してきたように X 上で Linux の単純なコンソール をエミュレートさせるプログラムです。選ぶにあたって、このプログラムには 多くを頼ることになります。だからこそ最初は、賢明な選択が求められます。 <!-- If you have a slow video card, the first thing you should consider doing is switching to rxvt. Using xterm is a good starting point, mainly because it comes standard with all X distributions, but it's not always the best choice. It contains a lot of legacy code, and is quite bloated for a simple terminal emulator. This is partly due to the fact that it's not just a plain text terminal emulator, but also emulates graphics modes that you simply will never use. Because of this, you may wish to switch to rxvt, and also because xterm can be extremely slow. I'm not sure why it's so slow, but if you have a slow video card you'll know what I mean, and you'll be amazed at the difference when you dump xterm. --> もしもお持ちのビデオカードが低速のものなら、考慮すべき第一のことは <bf>rxvt</bf> に移行することでしょう。<bf>xterm</bf> を使うことは出発 点としてはよい選択でしょう。主な理由としては、全ての X ディストリビュー ションにおいて標準になっているからです。しかし <bf>xterm</bf> は常に最 善の選択とはいえません。<bf>xterm</bf> は伝統的なコードを大量に含んで いて、単なるターミナルエミュレーターにしてはかなり肥大化しています。こ れは部分的には、ただのプレーンテキスト用のターミナルエミュレーターでは なく、まず使うことはないと思われるグラフィックモードをもエミュレートし ている、という事実によるものです。このことが原因で <bf>rxvt</bf> に移 行したいと思うかもしれませんし、<bf>xterm</bf> が極度に遅いことが原因 になるかもしれません。なぜ <bf>xterm</bf> がとても遅いのかについての確 信はありませんが、お持ちのビデオカードが遅くて、この文章が意味すること を理解してくださるなら、<bf>xterm</bf> の使用をやめたときに、その違い に驚愕することでしょう。 <!-- Some other perks of rxvt include pixmap backgrounds, and a much nicer scrollbar. If you specify the -pixmap option on the command line (and have support compiled in to your version!) you will get any .xpm-type picture in the background. A very cool feature, and it surprisingly doesn't slow down your output at all, it still redraws faster than your xterm window. Give it a shot, I haven't seen it around lately but I think it can be found on metalab. --> <bf>rxvt</bf> のその他の利点としては、背景に画像を貼りつけたり、より優れ たスクロールバーといったものを含んでいます。<tt>-pixmap</tt> オプショ ンをコマンドラインで指定するなら(使用するバージョンでサポートするよう にコンパイルされている必要があるけどね!)、背景にどんな .xpm 形式の画 像でも使うことができるでしょう。非常に素晴らしい特徴としては、出力が遅 くなることは驚くほどにはありませんし、<bf>xterm</bf> のウィンドウよりも 高速に再描画してくれます。考えてみれば、最近まで <bf>rxvt</bf> を周り では見かけることはありませんでしたけど、 metalab でも見かけられるよう になっています。 <!-- 担当 遠藤 明 --> <sect><!--X Startup-->X の起動 <p><!--We will presume for the following examples that we have picked a fairly stable window manager, such as <bf>FVWM2</bf>, to try out some sample configurations. I would suggest giving that a shot for the purpose of learning these topics, as most of what you will learn here and in the following sections will apply to any window manager out there, but the topics seem most easily picked up using FVWM2.--> これから示す例では、<bf>FVWM2</bf> のような比較的安定したウィンドウ マネージャーを使って設定例を示すものとします。この章以降で習うことは どんなマネージャーにもあてはまりますが、FVWM2 を使って示すのがもっとも 易しそうですので、試してみてください。 <sect1><!--A Sample Starting Configuration-->最初の設定例 <p><!--Our first step is to write ourselves an initialization file for X itself. This file can be either a system-wide file, in which case it would likely be placed in <em>/var/X11R6/lib/xinit/xinitrc</em>, or it can be overridden on a per-user basis by placing the file <tt>.xinitrc</tt> in your home directory. Generally, it is expected that there will be a basic, default file in the system-wide location, possibly enforced if necessary for security reasons, but otherwise users will probably wish to configure the file themselves.--> まず最初にやることは、X 自身の初期化ファイルを自分で書くことです。 このファイルは、システム全体で使うものなら <em>/var/X11R6/lib/xinit/xinitrc</em> のような場所に置かれますし、 ユーザー毎に変えようと思うなら、ホームディレクトリに <tt>.xinitrc</tt> と して置かれます。一般的に基本的なデフォルトのファイルがシステム全体で 使われる場所に置かれ、セキュリティのためにそれを使用することが強制される こともありますが、たいていはユーザーがそのファイルを自分用に設定したく なるでしょう。 <!-- First let's create a file in your home directory called <tt>.xinitrc</tt>. Open up your "favorite" text editor, and paste the following, or something like it, in that file: --> まず、あなたのホームディレクトリに <tt>.xinitrc</tt> という名前の ファイルを作りましょう。あなたの「好きな」テキスト・エディタで、 <tt>.xinitrc</tt> に次の例を貼り付けるか、あるいは似たようなものを 書いてください。 <!-- <tscreen><verb> #!/bin/sh # if your backspace and delete are reversed, try this: xmodmap -e "keysym BackSpace=Delete" -e "keysym Delete-BackSpace" xsetroot -solid darkslateblue # start some basic applications xclock -geometry 96x96+2+2 -bg grey40 -fg black -hl white & xload -geometry 120x96+2+147 -bg grey40 -fg white -hl darkred -update 4 & xterm -sb -ls -geom 80x25-2+2 -title "shell" & xterm -sb -ls -geom 80x25-2-2 & # start the window manager /usr/X11R6/bin/fvwm2 --> <tscreen><verb> #!/bin/sh # バックスペースとデリートキーが逆になっているなら、 次のようにしてください。 xmodmap -e "keysym BackSpace=Delete" -e "keysym Delete-BackSpace" xsetroot -solid darkslateblue # 基本的なアプリケーションを起動します。 xclock -geometry 96x96+2+2 -bg grey40 -fg black -hl white & xload -geometry 120x96+2+147 -bg grey40 -fg white -hl darkred -update 4 & xterm -sb -ls -geom 80x25-2+2 -title "shell" & xterm -sb -ls -geom 80x25-2-2 & # ウィンドウマネージャーを起動します。 /usr/X11R6/bin/fvwm2 </verb></tscreen> <!-- There are plenty of things to learn from this example. First of all, this file will be a shell script, as indicated by the first line. The <bf>xsetroot</bf> command on the second line turns the background of our desktop to a pleasant blue color, not a bad idea if we're going to be staring at that color predominantly all day. --> この例から多くのことを学ぶことができます。まず、このファイルは最初の 1 行が示すようにシェル・スクリプトです。次に <bf>xsetroot</bf> コマンド で、デスクトップの背景色を明るい青色にします。ほとんど 1 日中この色を 見なければいけませんので、悪くないアイディアです。 <!-- The third and fourth lines are some programs that I like to leave running while I'm fast at work. You'll notice that some of the options make for a nicer setup, for example, specifying the colors and geometry (location on screen). I'll give you some tips for figuring this stuff out in a bit. The fifth and sixth lines follow similarly, opening up two handy <bf>xterm</bf> windows for us, which we will no doubt be needing soon. --> 次の 2 行は、仕事に熱中している間走らせておくのが好きなプログラムです。 オプションによって色やスクリーン上の位置などを指定しているのに気づく でしょう。これについて理解するためのヒントを後で述べます。その次の 2 行は、後で間違いなく必要になる 2 つの手軽な <bf>xterm</bf> ウィンドウを 開きます。 <!-- The last line is very important--it is this line that starts up your window manager! Notice that the only commands we did not run as <em>background processes</em> (by putting the <bf>&</bf> at the end) were <bf>xsetroot</bf>, <bf>xmodmap</bf>, <bf>fvwm2</bf>. With these first two it doesn't matter, as the programs exit immediately. But all the rest of the programs have to be in the background, otherwise when you closed one, it would kill your X Window session. That would not be very pleasant, nor very expected. As shown above, when you close <bf>fvwm2</bf>, you exit X. --> 最後の行は非常に重要です。この行によってあなたのウィンドウマネージャー が起動します。<bf>&</bf> を後ろに置くと<em>バックグラウンド・ プロセス</em>になりますが、<bf>xsetroot</bf>、<bf>xmodmap</bf>、 <bf>fvwm2</bf> の 3 つはフォアグラウンドになっていることに注意して ください。このうち、最初の 2 つはすぐ終了しますので、バックグラウンド でもフォアグラウンドでも関係ありません。これ以外のプログラムは、 バックグラウンドにしないと、終了させた時に X ウィンドウ・セッションも 同時に終了してしまいます。それは困ったことですし、意図していることでも ありません。上に示したように、<bf>fvwm2</bf> を終了させると X も 終了します。 <sect1><!--A More Intelligent Startup-->もっと賢い起動方法 <p><!--We can add lots to our primitive example of a startup file. For instance, this is a good way to warn yourself when you may have carelessly stared X as the root user. Red Hat users seem to do this often, for many of the configuration programs which must be run as root, must also be run in X. You can avoid this by issuing an <bf>su</bf> command to become root during your normal X user session, and then calling the program you need to run as root with the option <bf>-display :0.0</bf> discussed above. --> 私たちの原始的な起動ファイルに多くのものを付け加えることが可能です。 たとえば、X を不注意に root 権限で起動した時に注意を喚起するのはよい ことです。Red Hat を使っている人がよくそうしているのは、root 権限で 動かさなければならない各種の設定プログラムが X 上で動くようになって いるからです。これを避けるには、普通のユーザーで X を起動し、<bf>su</bf> コマンドで root になり、root で起動する必要のあるプログラムを、すでに 述べた <bf>-display :0.0</bf> オプション付きで実行します。 <!-- <tscreen><verb> # change background color for root if [ "$USER" = "root" ]; then xsetroot -solid darkred else xsetroot -solid darkslateblue fi </verb></tscreen> --> <tscreen><verb> # root の背景色を変える。 if [ "$USER" = "root" ]; then xsetroot -solid darkred else xsetroot -solid darkslateblue fi </verb></tscreen> <!-- This will check to see if you are the user named root, and if you are, it will set the background to a harsh red, rather than the usual friendly blue, to warn you. This next bit of code, also intended for your <tt>.xinitrc</tt> file, will merge in your user-specific and system-wide resources, first checking to be sure the files exist. --> こうすると、ユーザー名が root かどうかチェックし、もしそうなら 背景を通常の親しみやすい青ではなく、どぎつい赤にして警告して くれます。次に示すコードも、あなたの <tt>.xinitrc</tt> ファイルに 入れることを念頭に書いたもので、まずファイルが存在するかどうか 確認してから、ユーザー定義のリソースとシステム全体のリソースを 読み込みます。 <!-- <tscreen><verb> userresources=$HOME/.Xresources usermodmap=$HOME/.Xmodmap sysresources=/usr/X11R6/lib/X11/xinit/.Xresources sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap # Merge in defaults and keymaps if [ -f $sysresources ]; then xrdb -merge $sysresources; fi if [ -f $sysmodmap ]; then xmodmap $sysmodmap; fi if [ -f $userresources ]; then xrdb -merge $userresources; fi if [ -f $usermodmap ]; then xmodmap $usermodmap; fi </verb></tscreen> --> <tscreen><verb> userresources=$HOME/.Xresources usermodmap=$HOME/.Xmodmap sysresources=/usr/X11R6/lib/X11/xinit/.Xresources sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap # デフォルトのリソースとキーマップを読み込む。 if [ -f $sysresources ]; then xrdb -merge $sysresources; fi if [ -f $sysmodmap ]; then xmodmap $sysmodmap; fi if [ -f $userresources ]; then xrdb -merge $userresources; fi if [ -f $usermodmap ]; then xmodmap $usermodmap; fi </verb></tscreen> <sect1><!--Getting The Windows Where You Want Them--> ウィンドウをあなたの好きな場所に置く <p><!--Placing everything on your screen by guesswork with the <em>-geometry</em> option can get very tedious indeed. Particularly when you consider that you can specify the <em>-geometry</em> option to pretty much any program you can run in X. This allows a great precision in tuning the interface, but that's a heck of a lot of options to set, indeed. --> スクリーン上のすべてのものを <em>-geometry</em> オプションで置くのは、 頭の中でそらんじてやるには難しい仕事です。特にあなたが X 上で動かす ほとんどすべてのプログラムに <em>-geometry</em> オプションをつけようと しているならやっかいです。このオプションで正確に場所を指定できますが、 そのためには多くのオプションを設定しなければなりません。 <!-- This brings up one very nice feature of the FVWM window managers. By default, when you move a window around the screen, you see the geometry specification appear on the screen. Go ahead, try moving a window around with the left button. Now try resizing it. As you can see, you can get some primitive specifications this way. However, even this method can be a little difficult, and it would be nice to have all the details about your window in one concise list. --> そこで、FVWM ウィンドウマネージャーには素敵な機能がつけられました。 デフォルト状態のままスクリーン上でウィンドウを動かすと、位置情報が 現れます。左ボタンでウィンドウを動かしてみてください。次にサイズを 変えてみましょう。そうすればサイズ情報が得られます。しかし、この方法も 少し面倒ですので、ウィンドウの詳細情報を一度に得られるといいと思う でしょう。 <!-- It is at this point that we will introduce the program <bf>xwininfo</bf>. To use this program, go to an <bf>xterm</bf> window and type in that program name. It will ask you to click on another window that you want information about, and after you click it will dump out useful information that it knows about that window. This is useful for plugging information about windows once you have them set up how you want them on your screen - run this program, then click on the window, then put in those parameters in your startup file, and your window system will henceforth be frozen in a pristine state of immaculate precision. --> そこで、<bf>xwininfo</bf> というプログラムを導入しましょう。このプログラム を使うには、<bf>xterm</bf> ウィンドウでこのプログラムの名前をタイプします。 そうすると、情報の欲しいウィンドウをクリックするよう要求されます。 クリックするとそのウィンドウに関する情報がみんな表示されます。 スクリーン上に必要なウィンドウを配置した上で、このプログラムを動かし、 ウィンドウ上でクリックし、そこで得られた情報を起動ファイルに書けば、 それ以降変わらぬ正確さで同じ状態のウィンドウが得られるようになります。 <!-- 担当: 川島 --> <!-- <sect>Configuring the Window Manager <p>Now we take a look at the files to configure your window manager. These vary from manager to manager, but for our examples we will focus on the per-user files, and we are looking at FVWM2 in this example, so you will modify the file <em>.fvwm2rc</em> in your home directory. - --> <sect>ウィンドウマネージャーの設定 <p>さて、ウィンドウマネージャーの設定ファイルに関して見ていきましょう。 設定ファイルはウィンドウマネージャーごとに異なりますが、ここでは ユーザごとの設定ファイルについて述べます。FVWM2 を例としていますので、 設定ファイル名はユーザのホームディレクトリの<em>.fvwm2rc</em>です。 <!-- <sect1>Basic FVWM2 Configuration <p>Configuring your window manager resource file in earlier versions of FVWM was a rather arduous process, because the order of the items in the file needed to be very particular, but that has relaxed quite a bit in this version. To my knowledge, the only crucial part of the ordering is the bindings for the menus, but we'll cover that a bit later. Your FVWM2 installation should have come with an example resource file, and you should be able to find that in <em>/var/X11R6/lib/fvwm2/system.fvwm2rc</em>. This is the default system-wide configuration file. A good idea would be to copy that file into your home directory and call it <em>.fvwm2rc</em>. From that point on, when FVWM2 starts up it will read the file in your home directory, and ignore the system-wide configuration file. - --> <sect1>FVWM2 の基本的な設定 <p>初期のバージョンの FVWM のウィンドウマネージャーリソースファイルを 設定するのはかなり骨の折れる仕事でした。というのも、ファイル中に記述 する項目の順序に厳しいルールがあったからです。でも大丈夫。 現在のバージョン(訳注: FVWM2 を指す)では、かなり緩やかになっていますから。 私の知る限りでは、順序に関して厳しい部分はメニューの関連付けのところ だけです。これについては後ほど触れます。 FVWM2 には、例としてリソースファイルが付属しているはずです。 このファイルは、<em>/var/X11R6/lib/fvwm2/system.fvwm2rc</em>にあるでしょう。 これは、デフォルトではシステム全体に対して有効な設定ファイルです。 これをあなたのホームディレクトリに、<em>.fvwm2rc</em>という名前で コピーするのがいいと思います。 コピーした後は、先ほどのシステム全体の設定ファイルは無効になり、 FVWM2 は、あなたのホームディレクトリのこのファイルを読んで立ち上がります。 <!-- Now that you've got a working, personalized copy of the window manager resource file in your home directory, open it in your favorite text editor, and take a look at it. If you're in X at the moment, you can see the correlation between the file and what you see on your desktop. Very helpful indeed. Let's try changing something and see if we can make it look a little better. Probably the first entry in your file (that is not followed by the <tt>#</tt> comment character) is the <tt>WindowFont</tt> entry, followed by a very bizarre font name. If you want to figure out how to set up the fonts and colors to their fullest, skip ahead to the next section on X Fonts and Colors. - --> さて、以上の操作で、ちゃんと動作する個人設定ファイルを用意できました。 このファイル(訳注: ~/.fvwm2rc)をお好みのエディタで開いて眺めてみましょう。 もし X が起動されていれば、設定ファイルの中身と、今あなたがデスクトップ上 に見ているものとの関連を見ることができますね。これはとても参考になります。 (設定ファイルの)内容を書き換えて、それがどんな風に影響を与えるかを見ること ができますから。 恐らく、ファイルの中で、コメント行(<tt>#</tt>で始まる行)を除いた最初の 行は、とっても奇々怪々なフォント名を記述した、<tt>WindowFont</tt>の設定行 だと思います。 もしこれらのフォントや色の設定をしたい場合には、次の章の「X のフォントと色」 を読んでください。 <!-- <sect1>Advanced FVWM2 Configuration <p>Configuring FVWM2 can get incredibly subtle and complex. Take this code snippet from the <bf>fvwm2gnome</bf> setup for the <em>.fvwm2rc</em> file: <tscreen><verb> # import config files Echo -Styles- Read .fvwm2gnome/config/styles/app.styles Read .fvwm2gnome/config/styles/window.styles Echo -Buttons & Keys- Read .fvwm2gnome/config/buttons.config </verb></tscreen> - --> <sect1>FVWM2 のより高度な設定 <p>FVWM2 の設定は、非常に複雑で難解なものになることもあります。 以下のコードは、<bf>fvwm2gnome</bf> というセットアップコマンドから とってきたものです: <tscreen><verb> # 設定ファイルを読み込む Echo -Styles- Read .fvwm2gnome/config/styles/app.styles Read .fvwm2gnome/config/styles/window.styles Echo -Buttons & Keys- Read .fvwm2gnome/config/buttons.config </verb></tscreen> <!-- This is an example of a way to read in other configurations. In this fashion you can modularize your <em>.fvwm2rc</em> -- not a bad idea, considering how jumbled one huge configuration file can become. This can make it easier to change and to debug, and it also makes it easier to configure so-called <em>themes</em>, which we will cover in a moment. --> これは、他の設定を読み込む方法のひとつの例です。 このようなやり方で、<em>.fvwm2rc</em> をモジュール化することができます。 ひとつの巨大なごちゃごちゃした設定ファイルを書くことを考えると、 これは悪いアイデアではありませんね。デバッグや変更が楽になりますから。 また、このやり方によって<em>テーマ</em> と呼ばれる設定をするのも 楽になります。<em>テーマ</em>については、すぐ後に触れます。 <!-- <sect1>FVWM2 Configuration Shortcuts <p>A really neat way to configure your script for FVWM2 (and FVWM, and <bf>bash</bf>, and a whole lot of other programs besides!) is to use the <bf>Dotfile Generator</bf>, by Jesper K. Pedersen, available from <url url="http://www.imada.ou.dk/˜blackie/dotfile/">. You will need to have a recent version of <bf>Tcl/Tk</bf> installed (available with most Linux distributions). This program starts with a configuration preset, or takes the one you presently have, and allows you to tweak it via many structured menus of options. --> <sect1>FVWM2 設定の近道 <p>FVWM2 用のスクリプトを設定する (そして、 FVWM や、 <bf>bash</bf> や、 そのほかたくさんのプログラムの! ) 楽な方法は、 <bf>Dotfile Generator</bf> というものを使うことでしょう。 これは、Jesper K. Pedersen によって書かれ、次の URL でアクセス できるはずです <url url="http://www.imada.ou.dk/˜blackie/dotfile/">。 これを使うには、最近のバージョンの <bf>Tcl/Tk</bf> が必要です (ほとんどの Linux ディストリビューションにあるはずです)。 このプログラムは、すでにあなたが設定済みの設定はそれを使い、そうでない 部分はあらかじめ用意された設定を初期値として設定を開始し、 たくさんの構造化されたオプションをメニューから変更することができます。 <!-- Be warned, however, for I advise learning how to set up your configuration file yourself! Not only is this the <em>Unix Way</em> (for what that's worth) but it's much easier to make small and incremental changes to your <tt>.fvwm2rc</tt> file that way, and get things exactly how you like them. Also, being a <bf>Tcl/Tk</bf> program, it's a little slow. Nevertheless, if you want a painless way to start with a decent configuration, this is definitely worth a shot. - --> でも私は注意しておきますけれど、設定ファイルを自分自身で記述する ほうがいいと思います! それが<em>Unix 流</em>だ、というだけではなく、その方がはるかに設定 ファイルを小さくできますし、少しづつ <tt>.fvwm2rc</tt> ファイルを 変更していくことで、正確にあなたの好みを設定に反映させていくことが できるからです。そして、<bf>Tcl/Tk</bf> プログラムなので、ちょっと ばかり遅いですしね。 それでもやはりあなたが、そこそこの設定を楽にしたいのならばこれは 確かに試してみる価値があります。 <!-- <sect1>FVWM2 Themes <p>Among the many new possibilities of FVWM2 are something commonly called <em>themes</em>. This basically means that you can switch between a basic look for all of your windows on your desktop, on the fly. Note that if you've made the distinction between the functions of the window manager and the functions of the applications themselves, you will realize that a window manager theme is not going to affect the look and feel of the applications themselves. Integrated toolkits such as KDE and GNOME do have this capability, however, and the two might be used together very effectively. - --> <sect1>FVWM2 のテーマ <p>FVWM2 のたくさんの新しい可能性の中で特筆すべきは、一般に <em>テーマ</em>と呼ばれているものでしょう。 これは、基本的にはウィンドウやデスクトップの基本的な「見た目」を 「その場」で変更するという機能です。 ここでちょっとご注意。 あなたがウィンドウマネージャーの機能とアプリケーションの機能を 区別できているなら、ウィンドウマネージャーのテーマは、アプリケーション それ自身のルック & フィールには影響を与えないことはご承知のとおり です。 KDE や GNOME などの統合化されたツールキットは、まさにこの (テーマという) 機能を持っています。とはいえ、これら 2 つは一緒に使うととても効果的です よね。 <!-- In order to generate a theme, you must roll up your sleeves and modify your <em>.fvwm2rc</em> file a little bit. Here's something I added near the beginning of my file, try putting it right after your <tt>Style</tt> definitions: <tscreen><verb> # Blue Theme DestroyDecor Blue AddToDecor Blue + WindowFont -b&h-lucida-bold-r-*-*-*-140-*-*-*-*-*-* + TitleStyle ActiveDown (Solid DarkSteelBlue)\ ActiveUp (Solid SteelBlue) Inactive (Solid Grey) + HilightColor white blue + ButtonStyle 1 -- UseBorderStyle Style Blue UseDecor Blue, BorderWidth 5, HandleWidth 5,\ MWMborder, MWMbuttons # Function to change all windows to a new style. DestroyFunc ChangeStyle AddToFunc ChangeStyle + "I" Style $0 $1 + "I" Recapture </verb></tscreen> - --> <p>新しいテーマを作るには...まず腕まくりしましょう。 そして、ホームディレクトリの <em>.fvwm2rc</em> を少しばかり変更します。 以下に示すのは私の設定ファイルの最初の方に付け加えた例です。 あなたの設定ファイルの<tt>Style</tt> 定義のすぐ後ろに付け加えて ください。 <tscreen><verb> # Blue Theme DestroyDecor Blue AddToDecor Blue + WindowFont -b&h-lucida-bold-r-*-*-*-140-*-*-*-*-*-* + TitleStyle ActiveDown (Solid DarkSteelBlue)\ ActiveUp (Solid SteelBlue) Inactive (Solid Grey) + HilightColor white blue + ButtonStyle 1 -- UseBorderStyle Style Blue UseDecor Blue, BorderWidth 5, HandleWidth 5,\ MWMborder, MWMbuttons # Function to change all windows to a new style. DestroyFunc ChangeStyle AddToFunc ChangeStyle + "I" Style $0 $1 + "I" Recapture </verb></tscreen> <!-- That's a lot to swallow, I know. Basically we're first defining a theme called ``<tt>Blue</tt>,'' and you can use that first half as a model to design other themes. Themes can describe many more features than that, in fact, and can be quite remarkably different from one another. Then we're defining a function to change all the windows to a new style. Notice in both sections above that we destroy the object before creating it. This is a good idea since you may well be restarting FVWM2 a lot to try out your different styles, and this makes it work a bit more smoothly. - --> わかってます。一息で理解するにはちょっと多すぎますね。 基本的には、まず最初に、``<tt>Blue</tt>,''というテーマを定義しています。 半分より前の部分は、あなたが他のテーマを作るときにひな型として役立つ と思います。テーマは、ここで記述しているのよりもはるかに多くの機能を 持っており、それぞれお互いに非常に異なっています。 後半は、全てのウィンドウが新しいスタイルに変わるように、ファンクション を定義しています。上にあげた例の両方の部分で、オブジェクトを新しく作る前に 削除 (destroy) していることに注意してください。 恐らくいろいろなスタイルを試すために、何度も FVWM2 を再起動することに なると思いますので、こうすることでよりスムーズに新しい設定を 試すことができると思います。(訳注: 古い設定を完全に消去することで、 予期しない古い設定をひきずるのを防ぐことができるという意味ですね) <!-- The function call is needed as a generic interface to call the definitions of the styles we have defined. Now we will make the menu items to call them. <tscreen><verb> DestroyMenu "Themes" AddToMenu "Themes" + "Choose a theme..." Title + "" Nop + "Blue" ChangeStyle "*" "UseStyle Blue" + "Mwm" ChangeStyle "*" "UseStyle Mwm" + "Flat" ChangeStyle "*" "UseStyle Flat" </verb></tscreen> - --> さて、以上で定義したスタイル定義を呼び出すためのインターフェースが 必要ですね。これは以下のように、メニューからファンクションを呼び出すこと で実現できます: <tscreen><verb> DestroyMenu "Themes" AddToMenu "Themes" + "Choose a theme..." Title + "" Nop + "Blue" ChangeStyle "*" "UseStyle Blue" + "Mwm" ChangeStyle "*" "UseStyle Mwm" + "Flat" ChangeStyle "*" "UseStyle Flat" </verb></tscreen> <!-- We're being a little terse with the menu definition here, but there should be a lot more in the sample file on your system. What we're doing is calling the <tt>ChangeStyle</tt> function that we defined above to change the style for all the windows on the screen to one of the presets we defined above that. Notice, again, our good practice in destroying the menu before creating it. Now if you restart FVWM2 (you should also have a menu option for that, hopefully!) you will see a new <tt>Themes</tt> menu selection, and you should be able to try out the different themes. For more examples of FVWM2 Themes, visit <url url="http://www.vis.colostate.edu/˜scriven/Linux/fvwm/index.html">. - --> ここでは少々簡単なメニュー定義を示すにとどめましたが、実際にはもっとたくさん あるでしょうね。この例でやっていることは、<tt>ChangeStyle</tt> 関数から、 私たちが定義したスタイルを呼び出して、(そのスタイルで)定義した設定に従うように しているわけです。 新しくメニューを作る前に削除(destroy)していることにもう一度注意してくださいね。 さて、FVWM2 を再起動すれば(おそらくメニューに再起動するための項目が あると思いますが!)、新しい<tt>テーマ</tt>選択メニューが表示され、 別のテーマに切り替えることができるはずです。 もっといろいろな FVWM2 用テーマの例は、 <url url="http://www.vis.colostate.edu/˜scriven/Linux/fvwm/index.html"> をアクセスしてみてください。 <!-- 担当: 松浦 --> <!-- <sect>Fonts and Colors --> <sect>フォントと色について <!-- <p>There are a lot of tricks to the fonts and colors used in X. They are not quite as simple as in some other systems, for instance, the font is not just a one-word name. You specify these resources quite explicitly, and it seems rather complex at first, but with a little explanation you'll be a whiz in no time. --> <p>X 上でフォントと色を使うにあたっては、たくさんの、そしてちょっと込 み入ったやり方があります。多くのシステムのように簡単にはいきません。例 えば、フォントは長い文字列で指定しなければなりません。フォントのリソー スを完全な形で指定しなければならず、最初は少々複雑に感じることでしょう。 でもちょっと解説を読むだけで、あなたもすぐにエキスパートになれるはずで す。 <!-- <sect1>Fonts Demystified --> <sect1>フォント指定の怪 <!-- <p>The <em>X Logical Font Description</em> (``XLFD'') is the full name for a font. It consists of the following fields: --> <p><em>X 論理フォント記述</em>(XLFD: X Logical Font Description)はフォ ントの完全な名前です。これは以下に示す項目で構成されます。 <itemize> <!-- <item><tt>fndry</tt> - font foundry, the company or individual which made the font --> <item><tt>fndry</tt> - フォント作成者。フォントを作成した企業もしくは個人 <!-- <item><tt>fmly</tt> - font family, the popular nickname of the font --> <item><tt>fmly</tt> - フォントファミリー。フォントの一般的な呼称 <!-- <item><tt>wght</tt> - font weight (bold, medium, etc.) --> <item><tt>wght</tt> - 太さ。bold(太字)、medium(中肉)、regular(普通) など <!-- <item><tt>slant</tt> - font slant (italics, oblique, roman (normal), etc.) --> <item><tt>slant</tt> - 傾き。イタリック体、斜体、ローマン体など <!-- <item><tt>sWdth</tt> - font width (normal, condensed, extended, etc.) --> <item><tt>sWdth</tt> - 単位あたりの幅。normal(普通)、condensed(狭い) extended(広い)など <!-- <item><tt>adstyl</tt> - additional style (sans serif, serif, etc.) --> <item><tt>adstyl</tt> - スタイルに関する付加情報。sans serif(ひげ無)、serif(ひげ有)など <!-- <item><tt>pxlsz</tt> - pixel size, the number of pixels vertically in a character --> <item><tt>pxlsz</tt> - 文字の大きさ。文字の縦方向のピクセルサイズ <!-- <item><tt>ptSz</tt> - approximate point size of the text (similar to pxlsz) --> <item><tt>ptSz</tt> - テキストのおおよそのポイントサイズ(pxlsz と同様) <!-- <item><tt>resx</tt> - horizontal resolution, in dpi --> <item><tt>resx</tt> - 水平方向の解像度。dpi で指定 <!-- <item><tt>resy</tt> - vertical resolution, in dpi --> <item><tt>resy</tt> - 垂直方向の解像度。dpi で指定 <!-- <item><tt>spc</tt> - spacing, only useful, apparently, in the Schumacher fonts --> <item><tt>spc</tt> - 文字間隔。シューマッハフォントでのみ有効らしい <!-- <item><tt>avgWidth</tt> - average character width of the font --> <item><tt>avgWidth</tt> - 全文字の幅の平均(scalable フォントでは 0) <!-- <item><tt>rgstry</tt> - the recognized registry that lists the font --> <item><tt>rgstry</tt> - 登録した組織もしくは標準名 <!-- <item><tt>encdng</tt> - nationality encoding --> <item><tt>encdng</tt> - 文字セットのエンコーディング </itemize> <!-- In light of this chaos, the program <bf>xfontsel</bf> (the default X Window font selection program) will come in enormously useful to you. Try launching it right now. You will see a strange nothing helpful in the main window, but try holding the left button down on the <tt>fndry</tt> button. If all your fonts are in order, you will see a menu of selections such as <tt>adobe</tt> and <tt>b&h</tt> and <tt>bitstream</tt> and so forth. Select one such as <tt>b&h</tt> and you will notice that the font in the lower window changes to something intelligible. This is generally the way you will select fonts with this program, starting from the left, which is the most general selection, and moving toward the right, to the more specific options. Selecting an option toward the rightmost end will not make much sense before the foundry, for instance, is selected, because the options are generally ordered by their dependence on each other. --> これでは混乱してしまうので、<bf>xfontsel</bf> プログラム (X ウィンドウ のフォント選択プログラムとして通常使われます) が用意されています (実に便 利)。試しに今すぐ起動してみましょう。メインウィンドウに訳のわからない ものが現れてきます。しかし、そこで <tt>fndry</tt> ボタンの上でマウスの 左ボタンを押しっぱなしにしてみましょう。もしフォントが正しくインストー ルされていれば、メニューに <tt>adobe</tt> やら <tt>b&h</tt>, <tt>bitstream</tt> が出てくると思います。<tt>b&h</tt> でも何でも一 つだけ選択し、下部のウィンドウに見慣れたものが出てくることに注目してく ださい。普通 <bf>xfontsel</bf> は一番左の項目から始めて、だんだん右 へ指定しながら絞っていきます。fndry オプションを選択する前にその右の 項目を選択してもかまいません。各々のオプションは互いの依存関係により普 通は勝手に選択されてしまうからです。 <!-- When you go to select from the <tt>fmly</tt> selection, you will see most of the options greyed out, and only three remaining. That means that these three are the only families of font made by this foundry. Some families appear under more than one foundry, for instance, both <em>Adobe</em> and <em>Bitstream</em> make a variation of the Courier font. Now you can select the <tt>wght</tt>, and so forth. After you get far enough you will have narrowed it down to the font that you want. You don't necessarily have to fill in all the options to choose a single font, there's not <em>that</em> many fonts on your system! The options that you do not select will be represented by a <tt>*</tt> indicating that any option will do in that spot. --> <tt>fmly</tt> の項目まで来たときには、ほとんどのオプションがグレーになっ ていて、3 項目だけが残されているのがお分かりいただけると思います。これ は指定されたフォント作成者に対応するフォントファミリーは 3 つしかあり ませんよということです。いくつかのフォントファミリーは別のフォント作成 者の下にも現れます。例えば、 <em>Adobe</em> も <em>Bitstream</em> も <em>Courier</em> フォントを作っています。次は <tt>wght</tt> へ進みましょ う。長い道程を経て望みのフォントに近づいてきました。必ずしも一つのフォ ントを指定するためにすべての項目を埋めなければならないわけではありませ ん。あなたのシステムに<em>そんなに</em>たくさんのフォントはありません から! 選択しない代わりに <tt>*</tt> 印がついているオプションはそれらの うちのどれでも良いことを表します。 <!-- When you are happy with your font selection, you can hit the select button, and your selection will be placed in the X clipboard, ready to be pasted into your document or whatever you are working on. For instance, go to your <bf>xterm</bf> window and type in something like <tt>xterm -font </tt> followed by an opening quotation mark. Then point to that spot on your screen, and click your middle mouse button (or click both the left and right, if you're middle-button impaired). This will paste the selection from the clipboard, which should be the font you just selected. Then enter the closing quote, and hit <tt>Enter</tt>. For instance, a nice big <bf>xterm</bf> with a Courier font specified would look like this: <tt>xterm -font "-adobe-courier-medium-r-*-*-14-*-*-*-*-*-*-*"</tt> A fresh <bf>xterm</bf> should the pop up using the font that you selected. --> フォント選択で一番うれしい機能が select ボタンでしょう。select ボタン を押すと選択されたフォント名が X のクリップボードにコピーされ、書いて いるドキュメントの中や作業中の何かにペーストすることができます。例えば、 <bf>xterm</bf> ウィンドウで <tt>xterm - font</tt> の後にフォント名を " の後に打ち込みたいと思ったとします。そこでマウスの真ん中ボタン (または、 真ん中ボタンが無ければ右ボタンと左ボタンを同時に押します) を押してくだ さい。そうするとクリップボードから選択されたフォント名がペーストされる ことでしょう。あとは " を入力して括弧を閉じ、Enter を押すだけです。 具体的には、 Courier フォントを使った大きくて格好良い <bf>xterm</bf> を開くには以下のように指定すれば良いでしょう。 <tt>xterm -font "-adobe-courier-medium-r-*-*-14-*-*-*-*-*-*-*"</tt> 選択したフォントを使った新しい <bf>xterm</bf> が開いたはずです。 <!-- The utility <bf>xfd</bf> is very helpful for examining a font. If you launch it with a command line such as <tt>xfd -fn fixed</tt>, it will show you the character set for the font, much like the keycaps utility on a Macintosh. Note that you can also limit the number of fonts that you want <bf>xfontsel</bf> to display with the command line option <em>-pattern</em>, followed by a quoted font specification, as discussed above. --> <bf>xfd</bf> はフォントを調べるのにとても役に立つユーティリティです。 コマンドラインで <tt>xfd -fn fixed</tt> のように起動すると、そのフォン トに対する文字集合を表示します。さしずめ Macintosh の keycaps ユーティ リティのような感じです。 コマンドラインオプションの <em>-pattern</em> を使って <bf>xfontsel</bf> で表示するためにフォントの数を制限すること もできます。続けて上で述べたようにフォント指定を引用符で囲って指定しま す。 <!-- <sect1>Font Aliases and Configuration --> <sect1>フォントの別名と設定 <!-- <p>Sometimes it gets tiresome to remember all of the long font names, and very impractical too. Luckily, it is not necessary to type in a hundred keystrokes or so just to get the font name you want, for X provides something called <em>font aliases</em>. --> <p>時々、あの長いフォントの名前にうんざりし、実用的じゃないよなあと思 うこともあるでしょう。幸運にも、百回もキーを叩いたりする必要はありませ ん。 X は<em>フォントのエイリアス</em> (別名) と呼ばれる機能を提供してい ます。 <!-- If you look in the directory <em>/usr/X11R6/lib/fonts/misc/fonts.alias</em>, you will find shortcut names for many of the fonts. For example, <tt>8x16</tt> is listed as a shortcut for <tt>-sony-fixed-medium-r-normal--16-120-100-100-c-80-iso8859-1</tt>, and anywhere you enter <tt>8x16</tt> as an X font resource or at a command line for a font name, the long version of the font will be substituted. The <em>75dpi</em> and <em>100dpi</em> directories have similar aliases to take advantage of, on most systems the Lucida Sans font has a nice shortcut. --> <em>/usr/X11R6/lib/fonts/misc/fonts.alias</em> ファイルを見れば、 たくさんのフォントのショートカットを見つけることができるでしょう。例え ば <tt>8x16</tt> は <tt>-sony-fixed-medium-r-normal--16-120-100-100-c-80-iso8859-1</tt> へのショートカットです。そして、X フォントリソースやコマンドラインでフォ ント名を指定するところなどのどこでも <tt>8x16</tt> を長い表現のフォント 名の代用として使うことができます。ディレクトリ <em>75dpi</em> と <em>100dpi</em> 内には同様のエイリアスがあり、ほとんどのシステムには Lucida Sans フォントのナイスなショートカットがあります。 <!-- If you add fonts or aliases to your system, you will have to issue a few commands (probably as root). If you add fonts, you will have to issue the following two commands (these are examples, you will have to put in the correct directory, or perhaps leave it off altogether, to have your fonts re-read correctly. --> システムにフォントを追加したりエイリアスを作るときは、(大抵は root で) コマンドをいくつか実行する必要があるでしょう。フォントを追加するときは 以下の二つのコマンドを実行する必要があります (下記はサンプルです。フォ ントを正しく再読み込みさせるには、正しいディレクトリに書き換えるか、ま たは外す必要があるでしょう)。 <tscreen><verb> mkfontdir /usr/lib/X11/fonts/misc xset fp rehash </verb></tscreen> <!-- If you change the alias file for a font, you may only have to issue the last command above, but it may be a good idea to issue them both, to be sure. With the <bf>xset</bf> command you can explicitly issue a font path you wish the server to use, you can delete a specific directory from your font path, see the man page for more information. --> あるフォントのエイリアスを変更したいときは、上の二つ目のコマンドを実行 するだけで良いでしょう。しかし、それが確実に行われるためのもっと良い方 法もあります。<bf>xset</bf> コマンドを使えば、サーバが使いたいフォント のパスを明確に指定したり、フォントパスから特定のディレクトリを削除する ことができます。詳しくはオンラインマニュアルを参照してください。 <!-- Another common problem is that some distributions (notably Red Hat 5.2, at the moment) come with the fonts configured in the wrong order. If you take a look at your <em>/etc/XF86Config</em> (it may be somewhere else in some distributions, unfortunately, and I'm not sure where it is in Red Hat at the moment, so maybe <bf>locate</bf> it...) Take a look at this file if your fonts are ugly in X (as in, very difficult to read even at large sizes). You will see a bunch of entries that look something like this: --> もうひとつの一般的な問題は、いくつかのディストリビューション (特に RedHat 5.2, 現行のバージョン) が間違った順序でフォントを設定しているこ とです。<em>/etc/XF86Config</em> を見てください (他のディストリビューショ ンでは違うところにあるでしょう。不幸なことに、そして私は RedHat におい てそれがどこにあるのか知りません。だから <bf>locate</bf> コマンドを使 うことになるかと…)。X 上のフォントが汚ないと思ったのならなおさらです (サイズが大きいファイルをきちんと読むのは非常に大変でしょう)。下記のよ うな一群の記述が見つかるはずです。 <tscreen><verb> 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/Type1/" FontPath "/usr/X11R6/lib/X11/fonts/Speedo/" </verb></tscreen> <!-- The important thing to note here is that we have the unscaled bitmapped fonts (the directories misc, 75dpi, 100dpi) before the scaled fonts (such as Type1 and Speedo). Bitmapped fonts are preferred for the X Server, because scaled fonts don't look very pretty for common use, they're better for things like The Gimp or Netscape, perhaps. You should also do a sanity check to see that these directories all do, in fact exist, and if you have modified any lately, you might need to (as root) go in and issue an <tt>mkfontdir *</tt> command in the <bf>fonts</bf> directory. --> ここで記しておくべき重要なことは unscaled なビットマップフォント (misc, 75dpi, 100dpi ディレクトリ) が scaled なフォント (Type1 と Speedo のよう な) の前に記述されていることです。ビットマップフォントは X Server 向き です - 普通の使用においては scaled なフォントがあまり奇麗に見えない からです。これら scaled なフォントはおそらく Gimp や Netscape に向いているでしょ う。そしてすべてのディレクトリについてもまた、実際に存在する正しいディ レクトリかどうかのチェックをすべきです。そして後で変更したなら <bf>fonts</bf> ディレクトリの中で (root で) <tt>mkfontdir *</tt> コマン ドを実行する必要があるでしょう。 <!-- Note that if you are running a more recent distribution, such as one based on Red Hat 6.0 or later, you won't have to worry about this, as the <em>xttfs</em> True Type font server is the default, and does not use the path system to find your fonts. --> かなり新しいディストリビューション (RedHat 6.0 以降などに基づくもの) を お使いであれば、これを気にする必要はない点に注意してください。というの も、<em>xttfs</em> TrueType サーバがデフォルトであり、フォントを見つけ るためにパスの機構を使わないからです。 <!-- <sect1>Using Type 1 Fonts in X --> <sect1>X で Type 1 フォントを使う <!-- <p>The font types X generally accepts are of limited use, considering that about the only place you'll find fonts of that kind used are in the X Window System itself, and unfortunately most media junkies and fontaholics work in operating systems that prefer other formats. <bf>Type 1 fonts</bf>, most commonly used in conjunction with PostScript document formats, can be found for free on the internet with considerable ease. Try <url url="ftp://ftp.cdrom.com/pub/os2/fonts/"> for starters. --> <p>X ウィンドウシステムのフォントは、 X 自身でしか使われていないことを 考えると、 X が通常使用するフォント形式はあまり便利とは言えません。更 に不幸なことに、メディアの連中やフォントマニアの多くは、他のフォント形 式に則ったオペレーティングシステムを使用しています。 <bf>Type 1 フォント</bf> (PostScript 文書と共にもっとも一般的に使われています) は、フリーなもの がインターネットにかなりたくさんあります。まず手始めに <url url="ftp://ftp.cdrom.com/pub/os2/fonts/"> を覗いてみましょう。 <!-- To make use of these fonts is not that difficult, and graphics programs like <bf>GIMP</bf> will take advantage of them tremendously, and best of all, the Linux X servers understand Type 1 fonts ``out of the box.'' To use them, first unpack the archive using the appropriate commands, and put the fonts with a <tt>.pfb</tt> extension in <em>/usr/X11R6/lib/X11/fonts/type1/</em> on your system. Then, add mention of those fonts in the <tt>fonts.scale</tt> file in that directory, using the format for the other fonts, already there. Then save the file. --> これらのフォントを利用するのは難しいことではありません。そして <bf>GIMP</bf> のようなグラフィックプログラムにとって非常に有効です。ま た、最善なのは Linux の X サーバが「何もしなくてもそのまま」 Type 1 フォ ントを理解することです。これらのフォントを使うために、最初に適切なコマ ンドを使ってアーカイブを解凍し、拡張子が <tt>.pfb</tt> のフォントをシ ステムの <em>/usr/X11R6/lib/X11/fonts/type1/</em> ディレクトリに置きま す。そして、これらのフォントについて記したファイル <tt>fonts.scale</tt> をそのディレクトリに追加します(もしすでにあるなら 他のフォントのフォーマットを流用します)。 <!-- Now, you should be able to <tt>mkfontdir</tt> to tell the X server about the updates, and then run <tt>xset fp rehash</tt> to re-read the font path. If this doesn't work for you, you might have to restart X to see the changes. --> 更新を X サーバに知らせるために <tt>mkfontdir</tt> を実行しなければな りません。それから、フォントパスを再読み込みさせるために <tt>xset fp rehash</tt> とコマンドを実行します。これで効果がないなら、 変更を確認するために X を再起動する必要があるかもしれません。 <!-- If you find yourself using Type 1 fonts a lot, and for things other than just X (GhostScript, for instance, can handle this font format as well), you'll want to check out the <bf>type1inst</bf> utility by James Macnicol. This program can configure Type 1 fonts for GhostScript and X, and it can also generate sample sheets for your fonts, and does most of the work of configuration for you. This program can usually be found at <url url="ftp://metalab.unc.edu/pub/Linux/X11/xutils/">. --> たくさんの Type 1 フォントを自分が使っていると分かったなら、X 以外でも (例えば GhostScript はこの形式のフォントをうまく扱うことができます) 、 James Macnicol さんが作った <bf>type1inst</bf> ユーティリティを使うとよいで しょう。このプログラムは GhostScript と X で Type 1 フォントを設定でき るようにしたり、フォントのサンプルシートを出力すること等、いろいろな使 い方ができます。これは <url url="ftp://metalab.unc.edu/pub/Linux/X11/xutils/"> を探せば見つけることができるでしょう。 <!-- <sect1>Using TrueType Fonts in X --> <sect1>X で TrueType フォントを使う <!-- <p>If you have been using an operating system such as Windows or the MacOS, you may have lots of fonts sitting on your computer already that are <bf>TrueType</bf> fonts. TrueType fonts are considered best on smaller, low-resolution displays, such as your computer monitor, and attempt to provide nice features like shading and antialiasing, making your display look smoother. It is also really easy to find cheap TrueType fonts in bulk, and CD's featuring upwards of 500 fonts in the TrueType format are common in computer stores. --> <p>Windows や MacOS のようなオペレーティングシステムを使っているなら、 たくさんの <bf>TrueType</bf> フォントがコンピュータに居座っていること でしょう。<bf>TrueType</bf> フォントは、あなたが現に使っているコンピュー タのモニタのような、小さく、解像度の低いディスプレイでも最適化できるよ うに考慮されています。また、影付きやアンチエイリアスのような非常に優れ た技術の提供も試みられています。大量の <bf>TrueType</bf> フォントを安 価で手に入れることもでき、コンピュータストアに行けば 500 以上の <bf>TrueType</bf> フォントが納められた CD を買うことができます。 <!-- X does not understand TrueType fonts, and has no innate capability (at present) to do so, and so it needs a separate program to do the <em>font rendering</em> for it. There is a FreeType library to do this, but if you just want to use them on your computer, all you will need is a program called <bf>xfstt</bf>, the X font server for TrueType. This program should be available at <url url="ftp://metalab.unc.edu/pub/Linux/X11/fonts/">. --> X は TrueType フォントを理解できません。そして理解できるための本質的能力を (今のところ) 持ち合わせていません。ですから、<em>フォントのレンダリング</em> には別のプログラムが必要になります。それをするために FreeType ライブラ リが存在しますが、それを使おうと思うと、<bf>xfstt</bf> と呼ばれる TrueType のための X フォントサーバプログラムが必要になります。このプロ グラムは <url url="ftp://metalab.unc.edu/pub/Linux/X11/fonts/"> にあります。 <!-- Installation is fairly straightforward. Extract the archive, and <tt>make</tt> the file, and then <tt>make install</tt>. You may get a few errors that don't make sense after the second command; ignore them. What you need to do next is create a writable directory called <em>/usr/ttfonts</em> and put some of your <tt>.ttf</tt> fonts there, just to make sure it's going to work. Then synchronize the font server with the command <tt>xfstt --sync</tt>. --> インストールは非常にわかりやすく簡単です。アーカイブを展開し、 <tt>make</tt>, <tt>make install</tt> を実行してください。 2 つ目のコマ ンドの後のエラーは意味がないので無視してください。次にすることは <em>/usr/ttfonts</em> と呼ばれる書き込み可能なディレクトリを作成し、 <tt>.ttf</tt> フォントをそこに置きます。これだけです! その後 <tt>xfstt --sync</tt> コマンドを実行してフォントサーバとの同期を取りま す。 <!-- If you got no errors there, run the font server in the background with the command <tt>xfstt &</tt> and tell your X11 server about the font service with the command <tt>xset fp+ unix/:7100</tt>. If you got no errors, you should be able to run Netscape, the GIMP, even xfontsel, and have those fonts available to you. Your biggest problem may be finding the font you want, but that's not really a bad thing. --> エラーが出なかったら、 <tt>xfstt &</tt> コマンドを実行してフォント サーバーをバックグラウンドで走らせ、 <tt>xset fp+ unix/:7100</tt> コマ ンドで X11 サーバにフォントサービスについて問い合わせます。エラーが返っ てこなければ、Netscape や GIMP, xfontsel などによってフォントが使える かどうか確かめることができるでしょう。最大の問題は欲しいフォントをどう やって見つけるかということですが、これは大したことではありません。 <!-- It has been brought to my attention that more recent versions of xset require a slightly modified version of this command, because of changes in the code of xset. If you are running a distribution based on Red Hat 6.0 or later, or something equivalent, you will first want to try <tt>xset fp+ unix/:7101</tt>. --> ごく最近のバージョンの xset は、このコマンドの少し修正されたバージョン を必要とすることに気づきました。なぜなら xset のコードが変更されたから です。RedHat 6.0 以降に基づくディストリビューション、あるいはこれと同 等のディストリビューションをお使いであれば、最初に <tt>xset fp+ unix/:7101</tt> を実行するとよいでしょう。 <!-- If everything seems to be working fine, at this point you will want to configure your system so that the fonts will be working when you start X. If you are just starting X from the command line, this is easy. All you have to do is add the two commands from the previous paragraph to your <tt>.xinitrc</tt> file, in that order. When you next start X, it should work just fine. If you are starting X via <bf>xdm</bf>, you will need to add <tt>/usr/X11R6/bin/xfstt &</tt> to <tt>/usr/X11R6/lib/X11/xdm/Xsetup_0</tt>. Got that? Then add <tt>xset fp+ unix/:7100</tt> as well. --> 何もかもがうまくいっているようなら、X を起動したときにフォントが使える ようにシステムを設定し直したいと思うでしょう。コマンドラインから X を 起動したのなら簡単です。二つのコマンドを前の段落から <tt>.xinitrc</tt> ファイルにさっきの順番通りに追加するだけです。次に X を起動するときか ら幸せになれるでしょう。もし <bf>xdm</bf> 経由で X を起動しているなら、 <tt>/usr/X11R6/lib/X11/xdm/Xsetup_0</tt> ファイルに <tt>/usr/X11R6/bin/xfstt &</tt> という記述を加える必要があるでしょ う。できましたか? そうしたら <tt>xset fp+ unix/:7100</tt> を追加して お幸せに。 <!-- Bear in mind that the installation of a TrueType font server can be tricky business. Remember that the order that you issue the above commands is important. The font server must be started before X is started, otherwise you will run into problems. Be sure to read the FAQ file that came with the distribution, and the <tt>xfstt</tt> man page too. Many newer Linux versions come with this already working, so see if that's not already the case before worrying too much about it. --> TrueType フォントサーバのインストールは手の込んだ作業となることを心に 留めてください。上記のコマンドを順番通りに発行することが大切であること を覚えておきましょう。フォントサーバは X が起動する前に起動する必要が あります。そうしないなら問題が起きます。ディストリビューションに付いて くる FAQ ファイルを読んで確かめてみましょう。<tt>xfstt</tt> のオンライ ンマニュアルも読みましょう。新しいバージョンのディストリビューションの 多くでは最初から <tt>xfstt</tt> が動作するようになっているので、深く気 にする前にそうでないかどうかを調べましょう。 <!-- <sect1>Colors --> <sect1>色について <!-- <p>Let's go back to our terminal window and try some more things. Try opening an <bf>xterm</bf> with a command line like the following: --> <p>端末ウィンドウに戻ってもうちょっと試してみましょう。コマンドライン で以下のように指定して <bf>xterm</bf> を開いてください。 <tscreen><verb> xterm -fg darkslateblue -bg red3 & </verb></tscreen> <!-- While that window may not be pretty, and you may not do much of your best work in it, it demonstrates one interesting theme of X, the names of the colors. While not very precise, this is a nice way to remember the colors more easily than remembering a series of hexadecimal numbers. Note that color names are never case-sensitive. --> ウィンドウがかわいくない、仕事がはかどらないとお悩みの方、上記の例は X の非常に興味深い分野の一つであるカラーネームについてのデモとなっていま す。あまり厳密ではありませんが、色を 16 進数で覚えるよりはずっと簡単で 良い方法です。カラーネームには大文字・小文字の区別が無いことを覚えてお きましょう。 <!-- If you're interested in the gory details, or want to see the samples, or even want to replace those silly color names with your own for some strange reason, you can find the file listing all the colors with their hexadecimal representation in <em>/usr/X11R6/lib/X11/rgb.txt</em> on your system. There are also some extremely useful utilities with names like <bf>xcolorsel</bf> and such. They can be found in the usual locations, on <url url="http://metalab.unc.edu/pub/Linux/"> and elsewhere. --> もし血みどろの詳細について興味がおありなら、もしくはサンプルを見たい、 はたまたあなた自身のもつ未知のアイデアによりばかげたカラーネームをそっ くり廃止してやる! という方は、システムの <em>/usr/X11R6/lib/X11/rgb.txt</em> に書かれているすべての色のリストと 16 進数についての説明が書かれていますので見てください。 <bf>xcolorsel</bf> といった名前の、実に使えるユーティリティもあります。 これは <url url="http://metalab.unc.edu/pub/Linux/"> や他のおなじみの 場所にあるでしょう。 <!-- A more precise way of specifying colors is through the numerical definition. This consists of a color space name and a set of values in the following syntax: --> 形式ばった色指定の方法は、数字で指定することです。これはカラースペース 名 (color-space-name) と数値を下記の構文に従って指定することからなります。 <!-- <em><colorspace-name>:<value>/.../<value></em> --> <em><colorspace-name>:<数値>/.../<数値></em> <!-- An RGB Device, which you will most likely be using, is specified with the prefix "rgb:" and has the following syntax: --> RGB デバイスにおいては (一番よく使う方法でしょう) 、 "rgb:" を 使って以下の構文で指定します。 <!-- <em>rgb:<red>/<green>/<blue></em> , where <color> is a 1 to 4 digit hexadecimal number. --> <em>rgb:<red>/<green>/<blue></em> ※上記の <color> は 1 桁から 4 桁の 16 進数です。 <!-- As an example, you might represent the color <em>red</em> with <tt>rgb:ffff/0/0</tt>. For backward compatibility, you can also specify red with a syntax such as <tt>#ff0000</tt> or <tt>#ffff00000000</tt>, and you will likely be seeing that (older) syntax a lot. --> 例えば、<em>red</em> (赤) と指定する代わりに <tt>rgb:ffff/0/0</tt> とす ることもできます。後方互換性を保つために、赤を指定するのに <tt>#ff0000</tt> もしくは <tt>#ffff00000000</tt> などおそらくよく 見かけるであろう (古い) 構文を使うこともできます。 <!-- 担当: 藤原 --> <!-- <sect>The X Resources --> <sect>X のリソース <!-- <p>We will at this point consider some finer modifications to your system. Configuring the window manager only gets you so far. The window manager lets you customize everything that happens <em>outside</em> the windows, the frames, the borders, the buttons, the desktop... but what about making the <em>inside</em> of the windows pretty? The only way to do this is by modifying the <em>X Resources</em> for your system. --> <p>ここでは、お使いのシステムを変えて良くすることを少し考えてみましょ う。今のところ説明したのはウィンドウマネージャーの設定だけです。ウィンド ウマネージャを使えば、ウィンドウの<em>外</em>で起こることは何でも (ウィ ンドウ、枠、境界、ボタン、デスクトップ等) カスタマイズできますが、ウィ ンドウの<em>内部</em>を良くすることについてはどうでしょう? これを行う ためには、システムの <em>X リソース</em>を修正するしかありません。 <!-- X Resources provide a mechanism for storing default values for program resources and tailoring your windowing environment to your favored look and feel. Resources are specified as text strings that are read in from various places when an application is run. Program components are named in a hierarchical fashion, with each object in the hierarchy identified by a class as well as an instance name. At the top level of the hierarchy is the class and instance name of the application itself. By convention, the class name of the application is the same as the program name, but with the first letter capitalized (e.g. Bitmap or Emacs) although some programs that begin with the letter ``X'' also capitalize the second letter for historical reasons (e.g. XTerm). --> X リソースは、プログラムのリソースのデフォルト値を格納し、ウィンドウ環 境のルック & フィールをユーザの好みに合わせるための機構です。リソー スはテキスト文字列として指定され、アプリケーションが実行されたときに様々 な場所から読み込まれます。プログラムの要素には、クラス名とインスタンス 名で識別される階層内のオブジェクトを使って、階層的に名前が付けられます。 階層のトップレベルは、アプリケーションそのもののクラス名とインスタンス 名です。慣習的にアプリケーションのクラス名はプログラム名と同じになりま すが、最初の文字だけは大文字になります (例: Bitmap, Emacs) 。ただし、名 前が「 X 」で始まる一部のプログラムは、歴史的経緯により 2 番目の文字も大 文字になります (例: XTerm)。 <!-- <sect1>X Resources: The Basics --> <sect1>X のリソース: 基本編 <!-- <p>Let's try a few examples to ease you into the world of resources. Start by opening an xterm window. Most likely you have one open already, can open one with a menu selection, or may wish to backtrack a bit in this document to get your bearings! Type something like this into the xterm window: --> <p>リソースの世界に楽に入るため、例をいくつか試してみましょう。まずは xterm のウィンドウを開きます。たぶん既に 1 つは開いてあるでしょうし、 メニュー選択で開くこともできます。あるいは、進路を確かめるためにこのド キュメントの少し前に戻ってみてもよいでしょう! xterm のウィンドウへ以下 のようなコマンドを入力してみましょう: <tscreen><verb> xterm -background blue & </verb></tscreen> <!-- This command should have resulted in another xterm window popping up on your screen, but this time with a blue background. ``Wow,'' you say, ``that's amazing!'' Yes, indeed it is. --> このコマンドを実行すると別の xterm が画面上に現われますが、今回の xterm は背景が青いはずです。「あれ、どうして」と思うかもしれません。し かし実際にそうなるのです。 <!-- fujiwara:こういうのって、日本語的な表現じゃないっすよね(^_^; --> <!-- We'll need a little more background for our next example. Type exit in that xterm (which will close that window) and go back to the original window that you typed that command in. Try this: hold the Ctrl key and then hold the left mouse button. Now try that with the middle mouse button. Now the right. All xterm windows give you options to try while they are running. With the right button, for instance, you can change the font of the window. Notice the color of these menus. Now try this example: --> 次の例を試す前には、少し背景となる知識が必要です。さっき開いた xterm で 「 exit 」と入力し (これでウィンドウが閉じます)、コマンドを入力した元 のウィンドウに戻ります。そして次の操作を行います: Ctrl キーを押し、そ のままマウスの左ボタンを押します。次は中ボタンを試してください。それか ら右ボタンも。xterm のウィンドウは全て、実行中にオプションを試すことが できます。例えば右ボタンの場合には、ウィンドウのフォントを変えることが できます。このメニューの色に注意しておいてください。その上で、この例を 試してみましょう: <tscreen><verb> xterm -xrm 'xterm*fontMenu*background: green' & </verb></tscreen> <!-- This time, it just looks like a normal xterm window. But if you try holding Ctrl and the right mouse button in that window, you will see that this menu (the ``fontMenu'' mentioned in the above example) is green. What just happened? If you look at the man page for <bf>xterm</bf>, you will see many command-line options, such as <em>-background</em> or <em>-font</em>, that you can set when you launch any given window in X, listed after the options just for <bf>xterm</bf> windows. These particular options are called <em>X Toolkit Options</em>, and they apply to just about anything in X. --> 今回は、ごく普通の xterm のウィンドウに見えます。しかし、Ctrl キーを押 したままでウィンドウ内部でマウスの右ボタンを押すと、このメニュー (先ほ どの例で「 fontMenu 」と言ったものです) は緑色になります。いったい何が起 こったのでしょうか? <bf>xterm</bf> のオンラインマニュアルを見ると、 <em>-background</em> や <em>-font</em> といったコマンドラインオプショ ンがあると思います。このオプションは X 上でウィンドウを立ち上げるとき に設定できるもので、<bf>xterm</bf> 専用のオプションの後に列挙します。 このような特別なオプションは <em>X ツールキットオプション</em>と呼ばれ、 X のほとんど全てのアプリケーションに適用されます。 <!-- <sect1>Inside The X Resource Database With <em>editres</em> --> <sect1><em>editres</em> で見る X リソースデータベースの内部 <!-- <p>To really get inside the resources of X, we need to run <bf>editres</bf>. Go ahead and launch it (and a sample program to play with) now: --> <p>本当に X のリソースの内部に立ち入るには、<bf>editres</bf> を実行す る必要があります。さあ、前に進んで <bf>editres</bf> (および遊ぶ対象に するサンプルプログラム)を実行しましょう: <tscreen><verb> xclock & editres & </verb></tscreen> <!-- Probably you will see a simple clock, and the rather innocent looking, mostly-blank window of <bf>editres</bf>. The main window is showing us the resource tree of any given window on our desktop, and upon program launch, there is none. So let's give it one. Hold down the left button on the Commands menu, and select Get Tree. In the top of the window will appear <tt>Click the mouse pointer on any toolkit client</tt>. This message is more than it seems, and it is a hint to us that not all X applications are toolkit clients (though most of the basic ones are, and the program will usually tell us if it is not in the manual page). The mouse cursor will turn to a crosshair, and wait for you to click on another window. --> たぶん、表示されるのは何の変哲もない見栄えのシンプルな時計と、ほとんど 何も表示されていない <bf>editres</bf> のウィンドウでしょう。メインウィ ンドウに表示されるのは、デスクトップ上の指定されたウィンドウのリソース ツリーであり、プログラムの起動時には何もありません。したがって、まずは ツリーを与えてみましょう。「 Commands 」メニュー上で左ボタンを押し、 「 Get Tree 」を選択します。すると、ウィンドウの最上部に 「 <tt>Click the mouse pointer on any toolkit client</tt> (任意のツール キットクライアント上でマウスポインタをクリックしてください) 」と表示さ れるはずです。このメッセージには見た目以上の意味があって、X アプリケー ションが全てツールキットクライアントというわけではないことを示していま す (基本的なアプリケーションの大部分はツールキットクライアントですが、 そうでない場合にも普通、オンラインマニュアルには説明はありません) 。マ ウスのカーソルは細い十字形にかわり、他のウィンドウでのクリックを待つ状 態になります。 <!-- For this example, let's first click on the <bf>xclock</bf>. You will see a couple things appear in the <bf>editres</bf> window. These are the configurable branches that the toolkit sees. Click on the bottom right one (clock). It should invert. Now select ``Show Resource Box'' from the ``Commands'' menu. You will see another window pop up, with the heading ".xclock.clock.unknown". Bingo! --> この例では、まずは <bf>xclock</bf> をクリックしてみましょう。 <bf>editres</bf> のウィンドウに 2 つの項目が表示されるはずです。これら はツールキットが認識している設定可能なブランチ (枝) です。右下のブランチ (clock) をクリックしてみましょう。すると反転するはずです。ここで ``Commands'' から ``Show Resource Box'' を選択してください。すると上の 方に ".xclock.clock.unknown" と表示された別のウィンドウが現 われるはずです。どうだい! <!-- fujiwara: 「ビンゴ!」ってのもアタマ悪そう(^_^;; hasegawa: 「踊る大捜査線」(^_^;; 、「どうだい!」ってのは? fujiwara: というわけで、「どうだい!」にしました。 --> <!-- >From here you can toy with the configuration options of the main <bf>xclock</bf> window. First, click on ``Set Save File'' at the bottom, and put in a filename such as <em>/home/yourname/resources</em>, to indicate that you're testing some of the resources here. Now click on ``foreground'' and put in ``blue'' next to the ``Enter Resource Value:'' prompt. Then hit ``Apply'' at the bottom. The minute notches around the clock should turn blue. Go to ``background'' and enter ``navajowhite'' (or whatever color you prefer). Then apply that. As you can see, we can configure the whole window just fine this way. But if you were to try launching another <bf>xclock</bf>, it would appear just as this one appeared before any changes. We need to save these changes. --> <!-- 段落最初の > はたぶん <p> タグの付け忘れ/消し忘れ(著者に連絡) --> <p>これ以降、 <bf>xclock</bf> のメインウィンドウの設定オプションで遊ぶ ことができます。このリソースの一部をテストしていることを示すため、まず は一番下の ``Set Save File'' をクリックし、 <em>/home/yourname/resources</em> のようなファイル名を入力してください。 ここで ``foreground'' をクリックし、その隣の ``Enter Resource Value:'' プロンプトに ``blue'' を入力してください。それから一番下の ``Apply'' をクリックします。時計の回りの細い刻み目が青くなるはずです。 ``background'' に行き、 ``navajowhite'' (あるいは好みの色) を入力してく ださい。これも反映するはずです。ご覧になったように、このようにしてウィ ンドウ全体を格好良く設定することができます。しかし、別の <bf>xclock</bf> を起動した場合、これは変更をする前のただの <bf>xclock</bf> にしか見えないでしょう。このような変更を保存する必要が あるのです。 <!-- Click ``Save'' and then ``Popdown Resource Box'' (a fancy name indeed for the ``Close'' function!). If you view the file you just created (<em>cat /home/yourname/resources</em> perhaps) you will see all those resources spelled out, in correct X Toolkit format, for your convenience. But that does us little good, for if you try launching another <bf>xclock</bf>, it will still look Plain Jane. So here is the last and final step in loading in your resources: --> まず ``Save'' を、その次に ``Popdown Resource Box'' (機能は ``Close'' なので、実際のところ変な名前ですね)をクリックしてください。たった今生 成したファイルを (<em>cat /home/yourname/resources</em> あたりで) 見て みると、便利なことにこれらのリソースが正しい X ツールキットのフォーマッ トで書き出されているのが分かるかと思います。しかし、これだけでは嬉しく ありません。というのも、新しく <bf>xclock</bf> を起動してみればわかり ますが、立ち上がった <bf>xclock </bf> はすっぴん (デフォルト設定) のまま なのです。つまり、リソースをロードするという最後の仕上げが残っているの です: <!-- fujiwara: 「Plain Jane」については JF ML で議論があったので、そちらを 見てくださいませ(^_^; --> <tscreen><verb> xrdb -merge /home/yourname/resources </verb></tscreen> <!-- This command <em>merges</em> the resources we just wrote into the <em>X Resource Database</em> (<bf>xrdb</bf>) for your session of X Window. That means that for all future invocations of the X applications we modified, our changes will take place, and remain binding. So if you run another <bf>xclock</bf>, it will look as nice as you have just now set it up, every time you run it. Mind you, <bf>xrdb</bf> is a complex program, and you may want to have a look at the man page before moving on, or playing around with it some more. If you added the modification to <tt>.xinitrc</tt> listed earlier in this document, to load the resources automatically on X startup, you should only have to worry about the <bf>xrdb</bf> command when you make changes during your X session. --> このコマンドは、たった今書き出したリソースを現在の X セッションの <em>X リソースデータベース</em> (<bf>xrdb</bf>) に<em>マージ</em>します。 すなわち、修正を行った X アプリケーションをこれ以降に呼び出すと、変更 が適用され、結びつけられたままになります。したがって、別の <bf>xclock</bf> を実行すると、いつ実行しても今さっき設定したように格好 良くなります。ただ、<bf>xrdb</bf> は複雑なプログラムなので、次に進んだ り、もう少しこれで遊ぶ前には、オンラインマニュアルを見るとよいでしょう。 本ドキュメントで前に挙げた、 X の起動時に自動的にリソースをロードするた めの変更を <tt>.xinitrc</tt> に行っている場合には、 X セッションの途中 に変更を行ったとき以外には <bf>xrdb</bf> のことを意識する必要はありま せん。 <!-- <sect1>The Anatomy of X Resources --> <sect1>X のリソースの解剖 <!-- <p>As you can see we have stumbled across a plethora of configuration options here. This method of configuring X, as has been stated, offers nearly limitless possibilities, and an equivalent amount of confusion. To get some picture of the scope of the resources in just the X Toolkit Intrinsics alone, run the program <bf>viewres</bf>, and play around with it a bit. This program graphically displays the tree of resources in the <em>Xt Library</em>. --> <p>ご覧のように、ここで設定オプションが多すぎることに気付かれたと思い ます。このような X の設定方法は、既に述べたように、ほとんど無限の可能 性を与えますが、同時に同じだけの混乱をもたらしてしまいます。X ツールキッ トイントリンシクス単独でのリソースの適用範囲のイメージをつかむためには、 <bf>viewres</bf> プログラムを実行し、これで少し遊んでみましょう。この プログラムは <em>Xt ライブラリ</em>のリソースのツリーをグラフィカルに表 示します。 <!-- If you read the manual page for <bf>X</bf>, you will find a rather obscure definition of the exact syntax for defining resources it understands. We can simplify this quite a bit and break it down into this essential syntax definition: --> <bf>X</bf> のオンラインマニュアルを読むと、 X が理解するリソースを定義 するための正確な文法についての定義が比較的不明瞭なことに気付かれるでしょ う。これはかなり簡略化し、本質的な文法定義に分割することができます: <!-- <em><program><binding><widget><binding><widget><...><resource>:<value> </em> --> <em><プログラム><結合子><ウィジェット><結合子><ウィジェット><...><リソース>:<値> </em> <!-- That doesn't really seem that simple, actually. Well, let's define some things about what has just been said, and it will all start to make sense after all. You can peek ahead to the examples in the next section as you read along, if you wish. --> これは本当に簡単なようには見えないかもしれませんが、実は簡単なのです。 さてここで、たった今説明したことに関して何か定義してみましょう。そうす れば、言っていることが結局分かるかと思います。もしそうしたければ、この セクションを読みながら次のセクションの例を眺めてもいいでしょう。 <!-- The <em>program</em> in this definition is the invocation of an application in the resource database. This would be <tt>XTerm</tt> for an invocation of <bf>xterm</bf>, <tt>emacs</tt> for an invocation of the <bf>emacs</bf> text editor, or a user-defined name that was given when the applications was launched with the <bf>-name</bf> command line option. In this way you can define separate resources for <bf>xterm</bf>s which will be used in different ways. Which is pretty cool, really. --> この定義における <em>プログラム</em> はリソースデータベース内でのアプ リケーションの呼び出しです。これは <bf>xterm</bf> の呼び出しの場合は <tt>XTerm</tt> となり、<tt>emacs</tt> テキストエディタの呼び出しの場合 には <tt>emacs</tt> となります。あるいは、アプリケーションが <bf>-name</bf> コマンドラインオプション付きで起動された時に与えられた、 ユーザ定義の名前になることもあります。このようにすると、異なる使われ方 をする複数の <bf>xterm</bf> に対して別々のリソースを定義することができ ます。これは実に素晴らしいことです。 <!-- The <em>binding</em> can be one of two characters to separate the widgets and such. If you use a <tt>.</tt> (period), you get a <em>tight binding</em>, which means that one widget is directly above or below the other in the widget hierarchy. This also has the highest precedence of the specification methods. If you use a <tt>*</tt> (asterisk), you get a so-called <em>loose binding</em>, and you will skip any number of widgets in the hierarchy, and it will attempt to match the next possible widget defined. --> <em>結合子</em> は、ウィジェット等を区切るための 2 種類の文字のどちら かになります。<tt>.</tt> (ピリオド) を使った場合には、<em>強い結合 (tight binding)</em> が得られます。これはあるウィジェットがウィジェット階層内 で他のウィジェットのすぐ上か下になることを意味します。これは指定方法の 中でも最も高い優先度を持っています。 <tt>*</tt> (アスタリスク) を使った場 合には、<em>緩い結合 (loose binding)</em> が得られます。これは階層内で任 意の数のウィジェットを飛ばし、マッチすることができる次の定義されている ウィジェットにマッチしようとします。 <!-- The <em>widget</em> entries are items in the widget tree, in order of most-specific to least-specific, that they appear in the widget tree, visible with <bf>editres</bf>. Any single widget entry can also be replaced with a <tt>?</tt> (question mark) to skip a single widget definition, and match any possible widget item. --> <em>ウィジェット</em> エントリはウィジェットツリー内の要素であり、特定 されているものから、されていないものの順に並んでいます。要素はウィジェッ トツリー内に現われ、 <bf>editres</bf> で見ることができます。任意の単独 のウィジェットエントリは <tt>?</tt> (疑問符) で置換えることができ、 1 つの ウィジェット定義を飛ばしたり、可能な任意のウィジェット要素とマッチさせ ることができます。 <!-- The <em>resource</em> item must be specified, and cannot be replaced with the <tt>?</tt> character. This is the most-specific item in the hierarchy, and usually contains items like the actual color to define, actual font to define, and so forth. In fact, everything else before the resource in this definition can be left out and replaced with a single asterisk, but the actual resource to define must be present. If you just put an asterisk and the most-specific resource name, such as <tt>*background: blue</tt>, X will attempt to define that resource globally, for all its clients, if possible. --> <em>リソース</em> 要素は必ず指定しなければならず、<tt>?</tt> 文字で置 き換えることはできません。これは階層内で最も特定されている要素であり、 定義する実際の色や定義する実際のフォント等のような要素を通常は含んでい ます。実際、この定義中でリソースより前の要素は全て取り除き、アスタリ スク 1 つで置き換えることができますが、定義する実際のリソースはなけれ ばいけません。アスタリスクと最も特定されているリソース名だけを指定した 場合(<tt>*background: blue</tt> 等)、可能であれば X は全てのクライアン トに対してそのリソースをグローバルに定義しようとします。 <!-- Following the colon is the <em>value</em> entry. This entry defines what the resource will be set to, such as a font name or color value. The value can be specified (depending on context) as a boolean, numeric, or text data type. The value entry, also, cannot be omitted in a valid resource definition. --> コロンの後は<em>値</em>エントリです。このエントリにはリソースに設定す るもの (フォント名や色の値など) を定義します。この値は (文脈に従って) 真偽 値や数値、テキストデータ型として指定することができます。正しいリソース 定義においては、この値エントリも省略することはできません。 <!-- <sect1>Making Your Changes Last With <em>.Xdefaults</em> --> <sect1><em>.Xdefaults</em> への変更を反映させたままにする方法 <!-- <p>There is a magic file you can put in your home directory called <em>.Xdefaults</em>. If you copy the lines in the resources file from the last example into the <em>.Xdefaults</em> in your home directory, you will never have to configure <bf>xclock</bf> again! While this might not be the finest example of its utility, it makes its point. This file can be crammed full of every option you prefer for every type of program you run in X, and if you take proper care of it, you can still easily go back and make slight changes when you need to. But making lots of changes, and hunting down lots of subtle resources using <bf>editres</bf> can be an extremely tiring and painstaking procedure. Indeed, sometimes that's too much work, and most of these resources are already waiting for you, neat and orderly, grouped by program, on your system. --> <p><em>.Xdefaults</em> と呼ばれる、ホームディレクトリに置くことができ る魔法のファイルがあります。リソースファイルの行を最後の例から抜き出し てホームディレクトリの <em>.Xdefaults</em> にコピーすると、 <bf>xclock</bf> をもう二度と設定しなくてもよくなります! これはこのユー ティリティのとても良い例ではないかもしれませんが、的を射ているとは思いま す。このファイルには X で実行する全ての種類のプログラムに対して、思い のままのオプションを詰め込むことができ、適切に注意すれば、必要な時に簡 単に元の状態に戻り、少しだけ変更を行うこともできます。しかし、大量の変 更を行うことと、 <bf>editres</bf> を使って細々としたオプションをたくさ ん見つけ出すことは、大変面倒で苦痛を伴う作業です。実際のところ、これは 大変すぎる作業であることが多いです。また、システムに用意されているリソー スの大部分はすぐに使える状態ですし、きちんと整理されており、プログラム ごとにまとめられています。 <!-- In the directory <em>/var/X11R6/lib/app-defaults</em> you will find a great many files, all named after an X Toolkit program. If you examine these files you will find that they contain a great many configuration options for each one, and I do mean a great many! You would not want all of these options from all of these files in your <em>.Xdefaults</em> file, that would be quite tiresome to deal with. These are the defaults, and it is from these that you can decide what you would like to see changed for your particular configuration. --> <em>/var/X11R6/lib/app-defaults</em> ディレクトリには、X ツールキット プログラムにちなんだ名前が付いているファイルがたくさんあります。これら のファイルを調べれば、それぞれに非常にたくさんの設定オプションがあるこ とが分かると思います。非常にたくさん! これらののファイルからオプション の全てを <em>.Xdefaults</em> に入れたいとは思わないでしょう。こ れらを全部扱うのは実に面倒な作業です。これらの値はデフォルト値なので、 これらの値から特定の設定について何を変えたいのか決めることができます。 <!-- The following are some samples from my <em>.Xdefaults</em> file. Notice a few things we have not yet mentioned about the resource definition files. If a line begins with <tt>!</tt> (exclamation point), it is considered a comment, and the rest of the line is ignored. If the line begins with <tt>#include <em>filename</em></tt>, that line is an <em>include directive</em>, and at that point in the resources another file will be merged, when it is loaded. This can help keep your resource files from becoming too bloated. And here are some examples: --> 以下に <em>.Xdefaults</em> ファイルから抜き出した例を示します。リソー ス定義ファイルについてまだ説明していないことがいくつかあるので注意して ください。行が「 <tt>!</tt> 」 (感嘆符) で始まる場合、その行はコメントとし て扱われ、その行の残りの部分は無視されます。行が 「 <tt>#include <em>ファイル名</em></tt>」で始まる場合、その行は <em>インクルードディレクティブ</em>であり、リソースをロードするとき、 リソース中のこの位置に別のファイルがマージされます。これを使って、リソー スファイルが膨れあがるのを防ぐことができます。以下に例をいくつか示しま す: <tscreen><verb> ! Default resources for me@localhost xterms ! start with the generic, move to the specific... *Dialog*Text*font: -b&h-lucida-medium-r-*-*-12-*-*-*-*-*-*-* *dialog*value*background: white *Dialog*Label*font: -adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-*-* *MenuButton*font: -adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-*-* *MenuButton*background: grey80 *MenuButton*foreground: black *Label.font: -adobe-helvetica-medium-r-*-*-10-*-*-*-*-*-*-* *Label*shadowWidth: 1 *SmeBSB.font: -adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-*-* *SimpleMenu*font: -adobe-helvetica-medium-r-*-*-10-*-*-*-*-*-*-* *OptionMenu*font: -adobe-helvetica-medium-r-*-*-10-*-*-*-*-*-*-* *Command.font: -linotype-helvetica-bold-r-narrow-*-12-*-*-*-*-*-*-* *commandBox*font: -b&h-lucida-bold-r-*-*-12-*-*-*-*-*-*-* *Toggle.font: -adobe-helvetica-bold-o-*-*-12-*-*-*-*-*-*-* *Form.background: grey70 *TransientShell*Dialog.background: grey70 *Scrollbar.Foreground: grey80 *Scrollbar.Background: grey50 *Scrollbar*cursorName: top_left_arrow *Scrollbar*width: 16 *shapeStyle: Rectangle *XlwMenu.shadowThickness: 1 *shadowWidth: 1 ! xterm stuff xterm*scrollbar.background: grey40 xterm*foreground: grey90 xterm*background: grey25 xterm*cursorColor: white xterm*visualbell: on ! rxvt stuff (a quicker, better xterm) rxvt*color12: steelblue rxvt*color15: white rxvt*color9: rgb:ff/7f/5f rxvt*foreground: grey90 rxvt*background: grey10 rxvt*cursorColor: white rxvt*font: lucidasanstypewriter-12 rxvt*loginShell: false rxvt*saveLines: 1024 rxvt*title: shell rxvt*geometry: 80x25 ! Make Xman just a little bit more sane xman*topBox: false xman*background: lightsteelblue xman*foreground: black ! xcalc is too bland by default... xcalc*Command.font: -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-* xcalc*customization: -color ! Disallow the <blink> tag in Netscape Netscape*blinkingEnabled: False ! Merge other resources (example) # include $HOME/.otherXresources </verb></tscreen> <!-- One word of warning with regard to X resources, for KDE users. There's a setting in the control panel which will cause all your X Resources to be overwritten in your applications. This can be a really nice feature, but it can also be an annoyance if you have painstakingly configured your resources. Open the control panel and find the ``Fonts etc.'' section. There's an option to ``Apply style to non-KDE apps''. If you turn this on, all your programs will adopt the look and feel configured by KDE (you may need to restart X to notice this). If you leave this option turned off, your resources will remain as you have configured them. --> KDE のユーザに対して、X のリソースに関する注意を一言述べておきます。 コントロールパネルに設定がありますが、これはアプリケーションにおける X のリソース設定を全て上書きします。これは便利な機能でもありますが、リソー スを苦心して設定した人にとってはうっとうしい機能でもあります。コントロー ルパネルを開き、``Fonts etc.'' セクションを探してください。ここに ``Apply style to non-KDE apps'' というオプションがあります。これをオン にすると、KDE が設定したルック & フィールが全てのプログラムに適用さ れます (これを通知するために X を再起動する必要はありません)。この機能 をオフのままにしていれば、リソースは以前に設定した状態のままとなります。 <!-- <sect1>Your Own User Resource Directory --> <sect1>ユーザ専用のリソースディレクトリ <!-- <p>You can also create a directory of resource files, just like the system-wide <em>app-defaults</em> directory mentioned above, with one file per program. Just create the directory (for our example we'll use app-defaults under your home directory,) and then set the environment variable <tt>XAPPLRESDIR</tt> to point to it. A good place to set this variable would be in the beginning of your <tt>.xinitrc</tt> file, for example, put in the line <tt>export XAPPLRESDIR=$HOME/app-defaults</tt> (if your files are going to be in an <em>app-defaults</em> directory under your home directory). --> <p>先に述べたシステム全体用の <em>app-defaults</em> ディレクトリとちょ うど同じように、ユーザもリソースファイルのディレクトリを作成することが できます。プログラムごとにリソースファイルは 1 つです。単にディレクト リを作成し (このドキュメントの例ではホームディレクトリの app-defaults ディレクトリを使います)、環境変数 <tt>XAPPLRESDIR</tt> が このディレクトリを指すように設定します。この変数は <tt>.xinitrc</tt> の先頭部分で設定するのが良いでしょう。設定では、 <tt>export XAPPLRESDIR=$HOME/app-defaults</tt> のような行を追加します (リソースファイルをホームディレクトリ下の <em>app-defaults</em> ディレ クトリに置く場合)。 <!-- Now, whenever you start an X program, this directory will be searched for a file with the same name as the resource name of the program, just like the system-wide directory. This is the <em>client name</em> that you used in <tt>.Xdefaults</tt> files. --> これにより、X のプログラムを起動すると必ず、プログラムのリソース名と同 じ名前を持つファイルが、システム全体用のディレクトリとちょうど同じよう にこのディレクトリから検索されます。この名前は <tt>.Xdefaults</tt> ファ イルで使われている<em>クライアント名</em>です。 <!-- For example, a file called <em>XTerm</em> could contain the line <tt>*background: gold</tt>, and all your <bf>xterm</bf>s would, by default, come up with a gold background. This is a nice alternative to a single <tt>.Xdefaults</tt> file, and makes it more clear when trying to decide which settings to configure later on, and to find the ones for a certain program. There are still uses for the <tt>.Xdefaults</tt>, though. It's useful for setting resources not bound to a single program, like modifications that you would make to turn all of a certain kind of button blue, regardless of the application. --> 例えば、<em>XTerm</em> というファイルに <tt>*background: gold</tt> と いう行があると、全ての <bf>xterm</bf> の起動時の背景色はデフォルトで 金色になります。これは <tt>.Xdefaults</tt> だけを使うのとは別の選択肢で、 どの設定を後で行うか決めようとしている時や、特定のプログラムの 設定を探す時には分かりやすい方法です。しかし、<tt>.Xdefaults</tt> にも まだ使い道はあります。このファイルは 1 つのプログラムに限定されないリ ソースを設定する際に便利です。これは例えば、アプリケーションに関係なく 特定の種類のボタンを全て青色に変える修正をしたい場合です。 <!-- 担当: 奈古屋 --> <sect><!-- Clients and Application Tips --> クライアントとアプリケーションについての Tips <p><!-- We have covered a few clients in X, and this section will cover some more. We will limit our discussion here to the most basic and important core items, those which come with X or you are likely to find yourself using with X. If you have installed an integrated desktop environment such as KDE or GNOME, you will have many others to choose from which likely perform many of the same functions. However, it is important to know about and understand many of the fundamental programs in X, because they can be very useful for working with your environment and such. Also X offers many new options that even your normal console applications can take advantage of. --> すでにいくつかの X のクライアントについて触れましたが、 この節では他のクライアントについても、もうすこし紹介します。ここでの議論 はもっとも基本的で重要なアイテムについてに限ります。それらは X といっしょ に、あるいは X を利用していればすぐに見つけられるものです。 もしあなたが KDE や GNOME のような統合デスクトップ環境を導入しているなら ば、同様の機能を持つクライアントを他にいくらでも選ぶことができます。 とはいえ、X の基本的なプログラムたちについて知って、そして理解することは 重要です。なぜならば、それらはいろいろな環境の上で仕事をするときにとても 役に立ち得るからです。 また X は通常のコンソールアプリケーションでも利用できるたくさんの新しい オプションも提供します。 <sect1><!-- Screen Savers for X --> X のスクリーンセーバ <p><!-- A common feature of many operating systems is the ability to blank the screen after a specified amount of time, and optionally display some sort of nifty graphics demo thing, a screen saver. There are a couple ways to do that in X, too. --> 多くのオペレーティングシステムには指定しておいた時間の経過後に画面をブランク にし、そしてオプションとして気のきいたデモ画像を表示する機能があって、こ れはスクリーンセーバと呼ばれます。もちろん X にもこの機能を使う 2 通りの方 法があります。 <!-- The most basic way to use this feature is by putting a command in your <tt>.xinitrc</tt> startup file such as <tt>xset dpms 2400 3600 4800</tt>. The <bf>xset</bf> program can configure the screen saving features of the X server, not to be confused with the screen blanking that the kernel does when you are at the text console. With the <tt>dpms</tt> option, X can use the power saving features of your monitor as well. The first option configures how many seconds before the screen blanks, the second option is how many seconds before the power saving feature starts, and the third option is for the "off" mode. Turning on an option implicitly enables the feature, setting a feature to zero explicitly disables it. --> この機能を使うもっとも基本的な方法はあなたのスタートアップファイル <tt>.xinitrc</tt> に <tt>xset dpms 2400 3600 4800</tt> のようなコマンドを加えることです。 <bf>xset</bf> コマンドは X サーバのスクリーンセーバ機能を設定します。 テキストコンソールでのカーネルのスクリーンブランク機能とは混同しないでく ださい。 <tt>dpms</tt> オプション により X はモニタのパワーセーブ機能 (power saving feature) も利用できます。 最初のオプションは何秒後に画面をブランクにするかを設定し、 2 番目のオプショ ンはパワーセーブ機能を開始するまでの秒数を設定し、 3 番目のオプションは 「オフ」モード ("off" mode) について設定します。これらのオプショ ンを設定すると暗黙のうちに対応する機能が有効になり、また 0 に設定す るとその機能が無効になります。 <!-- Many Linux distributions come with <bf>xlock</bf> preinstalled, or as an option. This is a pretty basic and fairly nice screen saver. If you run it with the <tt>-nolock</tt> option, you can see some of the modes that it offers, and if you leave that option off, it will ask you for a password when you move the mouse or press a key, as a security feature. Note that this is no real security, for at a Linux console a user could restart the computer or just drop out of X with a combination of keystrokes. The last method can be disabled, however, and if you are using <bf>xdm</bf>, it will offer as much security as your login, so it may be that only rebooting will let someone in. --> たいていの Linux ディストリビューションには <bf>xlock</bf> がはじめから、 あるいはオプションとして入っています。 これはとても基本的な、そしてとてもすてきなスクリーンセーバです。 <tt>-nolock</tt> オプション付きで実行すると、このプログラムが提供している いくつかのモード (デモ画像) を眺めることができます。 またこのオプションなしで実行すると、マウスを動かすかキーを押したときに、 パスワードを尋ねてくるというセキュリティ機能になります。 これは本当のセキュリティにはならないことに注意してください。 Linux のコンソールでユーザがコンピュータを再起動したり コンビネーションキー (Ctrl-Alt-BS) を使って X を終了することができるからです。 とはいえ後者は無効にできます。 またあなたが <bf>xdm</bf> を使っているならば、xdm はログイン時の認証と同程 度のセキュリティを提供するので、たぶん再起動しないと他の人はロックを解除 できないでしょう。 <!-- A newer and better program is <bf>xscreensaver</bf> by Jamie Zawinski. This program offers a great many niceties, for instance, it can run its processes at a nicer priority level, lessening the load to the system while it's running, and it automatically detects when the screen has been powered down by <bf>xset</bf> and doesn't waste processor time. Also, all of the graphics routines it calls are modular demos, and you can add routines without upgrading the whole package, and it can also call other programs, such as <tt>xearth</tt> or <tt>xdaliclock</tt>, as modules. --> より新しくてよりよいプログラムは Jamie Zawinski さんによる <bf>xscreensaver</bf> です。 このプログラムはとてもたくさんのすてきな機能を提供しています。 たとえば、それ自身のプロセスを低い優先順位で実行できますので実行中のシス テムへの負荷を減らせますし、 <bf>xset</bf> により画面がパワーダウンしているかどうかを自動的に検出 するのでプロセッサ時間を浪費しません。 その上、すべてのグラフィックルーチンはモジュール化されたデモとして呼び出 されるのでパッケージ全体を更新することなくルーチンを追加できますし、 <tt>xearth</tt> や <tt>xdaliclock</tt> のような他のプログラムもモジュー ルのように呼び出せます。 <!-- The latest version of <bf>xscreensaver</bf> can be found at <url url="http://www.jwz.org/xscreensaver/">. Once you get it installed and ready to go, here are some nice additions you might wish to add to your <tt>.Xdefaults</tt> file: --> <bf>xscreenserver</bf> の最新版は <url url="http://www.jwz.org/xscreensaver/"> で見つけることができます。いったんインストールして動かす準備ができたなら ば、こんな記述をあなたの <tt>.Xdefaults</tt> ファイルに加えたくなるでしょ う。 <!-- <tscreen><verb> !!! some XScreenSaver sample defaults ! Time out after 3 minutes, cycle mode after each 2 xscreensaver.timeout: 3 xscreensaver.cycle: 2 ! Run very low priority, and fade between modes xscreensaver.nice: 12 xscreensaver.fadeSeconds: 2 </verb></tscreen> --> <tscreen><verb> !!! XScreenSaver のデフォルト設定の例 ! 3分たったらタイムアウトして、2分ごとにデモを切り換える xscreensaver.timeout: 3 xscreensaver.cycle: 2 ! とても低い優先度で走り、モードの切り換えの間にフェードする xscreensaver.nice: 12 xscreensaver.fadeSeconds: 2 </verb></tscreen> <sect1><!-- Emacs and XEmacs -->Emacs と XEmacs <p><!-- If you are a fan of the text editor <bf>EMACS</bf>, or just someone who uses it a lot, you will find your work even easier in X Windows. If you have not tried XEmacs, you may want to get it for use in X. There are features in XEmacs that are nice even if you are not in X, for instance, your text can be colored to match the markup style you are editing automatically. You should give the following modification to your <tt>.emacs</tt> file a shot, and read the info pages for more options. Also look for an option to edit faces in the menus. --> あなたがテキストエディタ <bf>Emacs</bf> のファン、あるいはヘビーユーザ であるならば、 X 上ではより容易に仕事ができることに気づくでしょう。 XEmacs を使っていないならば、 X で使うためにそれを欲しくなるでしょう。 たとえ X を使わないにしても XEmacs にはすてきな機能があります。 たとえば、あなたが編集しているマークアップ言語のスタイルに応じて文章を自 動的に着色することができます。 ためしに以下の修正を <tt>.emacs</tt> ファイルにおこない、 他のオプションについての info ページを読んでみるべきです。 それからメニューからフェースを編集するオプションも探してみてください。 <tscreen><verb> (global-font-lock-mode t) <!-- 訳者: xemacs 20.4 にはないみたい --> (setq font-lock-maximum-decoration t) </verb></tscreen> <sect1><!-- Some Useful Programs and Tricks --> いくつかの役に立つプログラムとトリック <p><descrip> <tag>appres</tag><!-- The appres program prints the resources seen by an application (or sub-hierarchy of an application) with the specified class and instance names. It can be used to determine which resources a particular program will load. Useful for debugging your X defaults and such. --> appres は指定されたクラスとインスタンス名でアプリケーション (あるいは アプリケーションのサブ階層) に参照されるリソースをプリントします。 これは特定のプログラムがどんなリソースをロードするのかを決めるために使う ことができます。X defaults などをデバッグするのに役に立ちます。 <tag>rclock</tag><!-- Many distributions come with this nice replacement for xclock, which saves memory, alerts you when your mail comes, and can pop up reminder messages and launch programs. The <bf>Battery-Powered Mini-HOWTO</bf> contains instructions on patching this utility to show how much battery is left in your laptop, too. --> 多くのディストリビューションでは xlock のよりよい置き換えユーティリティ とされています。メモリを節約し、メイルが届いたときに通知したり、メッセー ジをポップアップウィンドウに表示してプログラムを起動することができます。 <bf>Battery-Powerd Mini-HOWTO</bf> には ラップトップマシンのバッテリー残容量を表示するためのこのユーティリティへ のパッチが含まれています。<!-- 訳者: 未確認 --> <tag>rxvt</tag><!-- A nice replacement for xterm - uses less memory, works faster, lets you put in a background pixmap, and lets you switch fonts with keyboard hotkeys, rather than menus. --> xterm についてのよりよい置き換えアプリケーションです。 より少ないメモリで、速く動作し、バックグラウンドに pixmap を表示できて、 メニューからだけでなくキーボードのホットキーでもフォントを変更できます。 <tag>xcpustate</tag><!-- Displays CPU state (idle, nice, system, kernel) statistics, as well as Ethernet information. --> イーサネット情報と同じように、CPUの状態 (idle,nice,system,kernel) の統計 を表示します。<!-- 訳者: 未確認 --> <tag>xearth</tag><!-- Display the earth on your root window, many options for display available. <bf>Xscreensaver</bf> can use this as a screensaver module, for maximum fun. --> あなたのルートウィンドウに地球を表示します。たくさんのオプションがあります。 <bf>xscreensaver</bf> はこれをスクリーンセーバモジュールとして使うことが できます、冗談として。 <tag>xfig</tag><!-- A vector drawing program, particularly useful for charts and documentation. Quite useful but hard to get the hang of at first. --> ベクトル描画プログラムで、とくに図表や文章の編集に役に立ちます。とても便 利ですが、最初はとっつきにくいです。 <tag>xfontsel</tag><!-- Font selection utility for X Window. Try the command <tt>xterm -fn `xfontsel -print` &</tt> to pick a font and then open the xterm window using that font. --> X のフォント選択ユーティリティです。フォントを選んでそのフォントを使って xterm のウィンドウを開くには <tt>xterm -fn `xfontsel -print` &</tt> を試してください。 <tag>xload</tag><!-- Monitor your memory usage with a moving graph or the lights on your keyboard! If you use Window Maker, look for <bf>wmmon</bf> to do the same, but prettier. --> メモリの使用状況を動くグラフやキーボードのLEDでモニタします。 Window Maker を使っているならば同じ機能でよりちいさな <bf>wmmon</bf> を 捜してみてください。 <tag>xmag</tag><!-- A magnifying glass for X, with a couple other useful features. --> X の拡大鏡で、便利な機能が組み合わせられています。 <tag>xman</tag><!-- Manual page browser for X. If the little box it starts with gets annoying, launch it with the <em>-notopbox</em> option. --> X 上でのマニュアルページブラウザです。 起動時に表示されるちいさいボックスウィンドウがわずらわしいようでしたら <em>-notopbox</em> オプションを付けて立ちあげてください。 <tag>xmodmap</tag><!-- Edit and display the keyboard modifier map and keymap table that are used by client applications to convert event keycodes into keysyms, usually run from user's startup script. An example was given earlier in this document, see the man pages for more info. --> キーボード修飾マップ (keyboard modifier map) とキーマップテーブル (keymap table) を編集・表示します。このマップテーブルはクライアントアプリケーショ ンによってキーコード番号を KeySym 名に変換するために使われます。 たいていはユーザのスタートアップスクリプトから実行されます。ひとつの例が この文章の始めの方にあります。詳細はオンラインマニュアルを参照してください。 <tag>xpaint</tag><!-- Basic bitmap painting program, for any real work you should grab <url url="http://www.gimp.org/" name="GIMP">. --> 簡単なビットマップペイントプログラムです。実用的には <url url="http://www.gimp.org/" name="GIMP"> を使ったほうがよいでしょう。 <tag>xset</tag><!-- User preference utility for X. You can change all sorts of stuff with this. For instance, <tt>xset s 600</tt> sets the screen to blank after ten minutes. --> X のユーザ設定ユーティリティです。これによりすべての設定を変更できます。 たとえば、<tt>xset s 600</tt> は 10 分後に画面をブランクにするよう設定します。 <tag>xsetroot</tag><!-- Change the color of your desktop. If you have a color selector program like <bf>xcolorsel</bf> installed, try a command like <tt>xsetroot -solid `xcolorsel`</tt> to pick a color and set your desktop to that color. --> あなたのデスクトップの色を変更します。もし <bf>xcolersel</bf> のような色 選択プログラムを導入してあるならば、 <tt>xsetroot -solid `xcolorsel`</tt> といったコマンドを実行して、あなたのデスクトップを選択した色に設定してみ ましょう。<!-- 訳注: うまくいかない… --> <tag>xwininfo</tag><!-- You can run this program and click on any window for lots of useful information about it. --> このプログラムを実行して好きなウィンドウ上でクリックすると、そのウィンド ウについての役に立つ情報を得られます。 <!-- <tag>The Intellimouse</tag>You can use the Intellimouse in X with a great many applications. There is an excellent resource page located at <url url="http://www.inria.fr/koala/colas/mouse-wheel-scroll/">. --> <tag>インテリマウス</tag>ほとんどのアプリケーションといっしょに X でインテリマウスを使えます。すばらしいリソースページが <url url="http://www.inria.fr/koala/colas/mouse-wheel-scroll/"> にあります。 </descrip> <!-- <sect>Advanced X Usage --> <sect>進んだ X の使い方 <!-- <p>There's a lot to learn about X, a lot of info buried in the inscrutible land of man pages, a lot of things most folks don't bother reading. Some if it is rather important, and it's easy to make some mistakes, and get completely stuck. It can be much harder to build a program in X, or check the security of X, or many other things, because X and all the things that run on top of it are so vast. This section is an attempt to cover some of the more advanced and confusing situations that may arise. --> <!-- inscrutable の typo かな? --> <p>X について学ぶことはたくさんあり、不可思議なオンラインマニュアルの 大地の下にたくさんの情報が埋まっており、多くの人々はわざわざ読まないこ とがたくさんあります。読んでない情報のどこかに比較的重要であり、間違いやすいものがあ れば、完全にはまってしまうことになります。プログラムを X 上で構築する ことや、 X のセキュリティをチェックすること、その他の多くのことはもっと 難しいかもしれません。なぜなら、 X と X 上で動作するものは非常にたくさ んあるからです。このセクションでは、比較的上級者向けで紛らわしい状況を いくつか押えます。 <sect1><!-- Libraries and Compiling X Applications --> ライブラリと X アプリケーションのコンパイル <p><!-- Sooner or later you will have to deal with compiling applications of your own. Later, if you just installed a nice distribution of linux, and are happy with what you've got, sooner, if you're the kind of person who likes to tinker and install. Remember, this is a privilege, not a right, so have fun with it! --> あなたがよくできた Linux のディストリビューションをインストールしていて、 現状に満足しているのならば、より後に、またいじくりまわしてインストールする のが好きならば、より早くはなりますが、いつかはあなた自身でアプリケーション のコンパイルをしなくてはならなくなる時が来るでしょう。 これは権利ではなく特権だということを忘れないで楽しみましょう! <!-- First, a few pointers on compiling programs with X. Many newer applications, GNU applictions in particular, come with a script in the root directory called <bf>configure</bf>. This assumes of course that you've extracted the file and are in the directory. This program should be run as <tt>./configure</tt>, and will automatically detect many things about your system. Afterwards, simply running <tt>make</tt> and perhaps becoming root and running <tt>make install</tt> will get the program up on your system. --> はじめに、 X といっしょにプログラムをコンパイルするときのポインタをいくつか 述べます。ほとんどの新しいアプリケーション、とくに GNU のものには <bf>configure</bf> というスクリプトがルートディレクトリにあります。もち ろんあなたがソースコードをそこへ展開していたと仮定しています。 このプログラムを <tt>./configure</tt> として実行すると あなたのシステムについてのいろいろな情報を自動検出します。 そのあとで単に <tt>make</tt> を実行してから root になって <tt>make install</tt> すれば、プログラムをあなたのシステム に組み込めます。 <!-- You may have to do a little more tinkering if you do not have a <bf>configure</bf> script available. Many X programs require you to run a program to make the <bf>Makefile</bf>, called <tt>xmkmf</tt>. If you don't see a <bf>Makefile</bf> in your directory, this will sometimes work, and will generate a suitable configuration for you, and you'll be ready to <tt>make</tt> from there. --> <bf>configure</bf> がなかったらもうちょっといじくる必要があります。 たいていの X のプログラムは <bf>Makefile</bf> を生成するために <tt>xmkmf</tt> というプログラムの実行を必要とします。 もし <bf>Makefile</bf> がディレクトリの中に見あたらなかったら、たぶんこ れを実行することで適当な設定を生成して <tt>make</tt> を実行できます。 <!-- Sometimes you will have run the <bf>configure</bf> script, and have been warned that you lack a library that would be helpful or necessary to properly use that application. For instance, I recently installed the <bf>xscreensaver</bf> application, and found that it would support several 3D modes if the <bf>Mesa</bf> library was installed. If you run into this situation and want that library installed, the first thing you should do is check the CD or installation media for your Linux distribution to see if you have the library on there. That may save you lots of trouble trying to compile the library. --> ときには <bf>congigure</bf> スクリプトを実行するとそのアプリケーションの 実行に推奨・必要なライブラリがないと警告を受けることがあります。 たとえばわたしは先日 <bf>xscreensaver</bf> をインストールして、 <bf>Mesa</bf> ライブラリがインストールしてあれば 3D モードがサポートされ ることに気づきました。 このようなときに、そのライブラリをインストールしたければ、 まずあなたの Linux ディストリビューションの CD などのインストールメディ アの中でそのライブラリを探してみましょう。 ライブラリをコンパイルしようとしたときに起きるたくさんのトラブルを避けら れるかもしれません。 <!-- Once you get a library compiled and installed and ready to use, you can go back to the directory you were installing your X program from, remove the <tt>config.cache</tt> file, and run the <bf>configure</bf> script again. Hopefully it will find the library you have installed. Sometimes it does not, and you have to tinker to get it working. This happens occasionally with libraries you download off the net, that do not adequately support the Linux File System Standard (most do, however). --> ライブラリをコンパイル・インストールして利用できるようにしたら X プログラムのインストール元のディレクトリに戻り <tt>config.cache</tt> ファイルを消して、<bf>configure</bf> スクリプトを再び実行することができ ます。うまくいけばあなたがインストールしたライブラリを検出してくれるでしょう。 ときにはうまくいかないときもあり、そのときは動作するようにいじくる必要が あります。このような事態は Linux ファイルシステム標準をきちんとサポート していないライブラリをネットからダウンロードしてきたときにときどき起こり ます (たいていのライブラリはサポートしています)。 <sect1><!-- Basic X Security --> X セキュリティの基礎 <p><!-- It has often been said that X has a very simple security model: All or Nothing. This is not much of an exaggeration at all. X can be configured to use somewhat sophisticated security, via encryption, but that is beyond the scope of this HOWTO (for the present). It is assumed that the user is not using any encryption for this discussion. --> X は All or Nothing という非常に単純なセキュリティモデルにもとづいて いるとしばしばいわれます。そのとおりなのです。 X は暗号化によってある程度洗練されたセキュリティを使うように設定できます が、これはこの HOWTO の範囲外です (いまのところは)。 以降の議論ではユーザはいかなる暗号化も利用していないと仮定します。 <!--First of all, you should try and follow some simple rules when you're compiling programs for X (or for any reason, really). Try not to become root any more than necessary. Configure your programs as a normal user with the <tt>./configure && make</tt> (or just <tt>make</tt> if there's no configure script), and then issue the single command to install it as root by typing <tt>su -c "make install"</tt>, and then typing in the root password at the prompt. That way you won't have to be logged in as root, you can just issue a single command, and you're back to your normal user prompt. This is a smart, safe way to install software. --> まず第一に、 X のプログラムをコンパイルするとき (に限らず他の場合にも) 単純なルールに従うよう努めなければなりません。必要ないかぎり root になら ないようにしてください。 一般ユーザで <tt>./configure && make</tt> (configure スクリプトがなけれ ば <tt>make</tt> だけ) を実行します。そして root 権限でインストールするた めに <tt>su -c "make install"</tt> とタイプしてコマンドを実行し、プロンプトに root のパスワードを入力します。 この方法ならば root でログインする必要はなく、たったひとつのコマンドを root で実行するだけで、通常のユーザプロンプトに戻ります。 これがスマートに、安全にソフトウェアをインストールする方法です。 <!-- The next thing to think about is running X software as root. Realize that X is more or less inherently insecure, and if your primary concern for a particular Linux box is security, you really don't want to install X at all! Having said that, some folks want to run nice fancy configuration programs or package management tools in X. I <bf>do not</bf> recommend starting X as root. It's just not a good idea. There's much, much better ways to do these things! --> 第二に X のソフトウェアを root で実行することについて考えます。 X は本質的にあまりセキュアではありません。ですから特定の Linux ボックス のセキュリティが主要な関心であるならば X は一切インストールするべきでは ありません! そうはいっても、かなりの人々はおしゃれな設定プログラムやパッケージ管理ツー ルを X 上で動かしたがります。 X を root で起動することは<em>勧められません</em><!-- 訳者: 日本語の強調 はどうすればいいの? -->。 それはよくない考えです。もっともっとよい方法があります! <!-- If you want to run an X application as root, just log in under your normal user account, and launch it from there. As I mentioned above, you don't want to be logged in as root any more than absolutely necessary. The root user has the ability to do just about anything on the system, including about a million ways to destroy it completely. Simply go to your <bf>xterm</bf> or such application and type in a command such as <tt>su -c "glint -display :0.0"</tt> to launch the window on your desktop. Now you have a single window running as root, and not the whole desktop. You might also want to consider using the complete pathname to the program you're running as root, for extra security. --> もし X のアプリケーションを root で実行したいのならば、ますあなたの通常 のユーザアカウントでログインして、そこでそのアプリケーションを起動してく ださい。いままでに述べたように、本当に必要でなければ root でログインしよ うとしてはなりません。root ユーザはシステム上で、無数の方法でそのシス テムを完全に破壊することを含め、あらゆることができます。 単にあなたの <bf>xterm</bf> といったアプリケーションの中で <tt>su -c "glint -display :0.0"</tt> のようなコマンドをタイプすればデスクトップ上にウィンドウが開きます。 このときひとつのウィンドウだけが root 権限で動いています。デスクトップ全 体ではありません。 よりセキュリティを高めるために、root で実行するプログラムについては絶対 パス名を使うことも考えてください。 <!-- Tomasz Motylewski also offers the following tip for <bf>ssh</bf> and <bf>ssh-agent</bf> lovers. If you put the following in your <em>/usr/X11R6/lib/xinit/Xclients</em> file: --> <bf>ssh</bf> と <bf>ssh-agent</bf> の愛好者のためのテクニックを Tomasz Motylewski から教えていただきました。以下の行を <em>/usr/X11R6/lib/xinit/Xclients</em> ファイルに追加してください: <tscreen><verb> eval "exec ssh-agent fvwm${FVWMVER} ${FVWMOPTIONS}" > "$HOME"/.FVWM${FVWMVER}-errors 2>& </verb></tscreen> <!-- That is, replace your standard <tt>fvwm${FVWMVER} ${FVWMOPTIONS}</tt> command with the preceeding. That is to start your window manager as a child of <bf>ssh-agent</bf>. Then you should try <tt>ssh-add < /dev/null</tt> from an <bf>xterm</bf> session (if you have your identity RSA key in the file <em>~/.ssh/identity</em>). If this works for you then you should find that you are authenticated in all your X windows. --> <!-- preceding の typo? --> つまり、標準の <tt>fvwm${FVWMVER} ${FVWMOPTIONS}</tt> コマンドを先程の ものと置き換えてください。これはウィンドウマネージャーを <bf>ssh-agent</bf> の子プロセスとして起動するための指定です。それから、 (<em>~/.ssh/identity</em> ファイルに RSA 識別鍵をお持ちであれば) <tt>ssh-add > /dev/null</tt> を <bf>xterm</bf> のセッションから実 行してください。これが動作すれば、全ての X のウィンドウにおいてそのユー ザは認証されているはずです。 <!-- It should be noted that this is a suggestion from the reader, and the author has no experience with <bf>ssh</bf> at the present, so proceed at your own risk! More recent Linux distributions allow for setting up <bf>ssh</bf> automatically, via <tt>setup</tt> or something similar, which means that you may not have to worry too much about setting it up, just understanding how it works. --> これは読者からの提案であり、現時点では筆者は <bf>ssh</bf> を使った経験 はない点に注意してください。したがって、これは読者の皆さんの責任におい て試してください! 最近の Linux ディストリビューションでは <tt>setup</tt> やその類のプログラムで <bf>ssh</bf> の設定を自動的に行 えます。つまり、 <bf>ssh</bf> の設定についてはあまり心配する必要はなく、 どのように動作するのかを理解すればかまいません。 <!-- <sect1>More About X Authority --> <sect1>X の許可に関する詳細 <!-- <p>The mysteries of user authentication in X are a prime example of the security problems many users encounter with X. Tomasz Motylewski relates the following story, which sums up the situation quite well. --> <p>X のユーザ認証における謎の代表例は、多くのユーザが X で出会うセキュ リティの問題でしょう。Tomasz Motylewski さんが以下の説明を説明してくれ ました。これは問題をとてもうまくまとめています。 <!-- ``...in the default XFree86 configuration X session started by ``startx'' accepts commands from everyone connecting from localhost. If you start X as user1 and you have user2 remotely logged in, user2 has full access to your keyboard and desktop (once my friend played a joke on me and put in his cron commands dumping my X desktop image and sending to him every hour). I did not notice it for 2 weeks!'' --> 「…XFree86 のデフォルトの設定では、``startx'' で始まる X セッションは ローカルホストから接続している全てのユーザからのコマンドを受け付けます。 もしあなたがユーザ 1 として X を起動しており、ユーザ 2 としてリモート ログインしていれば、ユーザ 2 はキーボードとデスクトップに完全にアクセ スすることができます (以前、私の友人が冗談で cron コマンドを設定し、1 時間ごとに私の X のデスクトップのダンプを彼に送ったことがありました。 私は 2 週間もそれに気づかないままでした!)」 <!-- Well that's not exactly a good thing, but unfortunately many readers have this exact problem. Tomasz goes on to point out that if you use <bf>xdm</bf> to log in (as detailed earlier in this HOWTO), rather than just running <bf>startx</bf>, this won't be a problem because access is controlled by the <bf>xauth</bf> program. By issuing the <bf>xhost</bf> command, you can see who is allowed access to your X session. Any user from the hosts that are listed in the output of the <bf>xhost</bf> command is authorized full access to your screen and keyboard. --> これはあまりいいことではありませんが、不幸なことにほとんどの読者がまさ にこの問題を抱えています。Tomasz さんは単に <bf>startx</bf> を実行する のではなく、<bf>xdm</bf> を使ってログインしているのならば (この HOWTO の前の部分で詳しく説明しています) これはあまり問題にならないことを指摘 しています。というのも、 <bf>xauth</bf> プログラムがアクセスを制御して いるからです。 <bf>xhost</bf> コマンドを実行することにより、あなたの X セッションに誰がアクセスできるのかを調べることができます。 <bf>xhost</bf> コマンドの出力に含まれるホストの全てのユーザは、あなた のキーボードとスクリーンにフルアクセスすること許可されます。 <!-- If you want to start your X server in a secure fashion from the command line, you will need to make the following modifications to your configuration. First, modify <bf>startx</bf> (probably at <em>/usr/X11R6/bin/startx</em>) by changing the last line <tt>xinit $clientargs -- $serverargs</tt> to read <tt>exec xinit $clientargs -- $serverargs -auth ~/.Xauthority</tt>. --> コマンドラインから X を安全な形で起動したいなら、設定に以下の修正を加 える必要があります。まず <bf>startx</bf> (たぶん <em>/usr/X11R6/bin/startx</em> にあります) を修正し、最後の行の <tt>xinit $clientargs -- $serverargs</tt> を <tt>exec xinit $clientargs -- $serverargs -auth ~/.Xauthority</tt> に変更します。 <!-- Then you will also need to edit your <bf>.xinitrc</bf> or your system-wide <em>/usr/X11R6/lib/xinit/xinitrc</em> (whichever you are actually using, probably the one in your home directory), by adding this at the beginning of the file: --> また、次に <bf>.xinitrc</bf> またはシステム全体用の <em>/usr/X11R6/lib/xinit/xinitrc</em> (このうち実際に使われている方。たぶんホー ムディレクトリにある方でしょう)を編集し、ファイルの最初に以下の 記述を加える必要があります: <tscreen><verb> # if Xserver has been run with "-auth ~/.Xauthority" option this will # prevent other users on your machine to connect to your X server # unless you allow it explicitly using xhost +host or give them # your ~/.Xauthority file. xauth generate $DISPLAY . trusted </verb></tscreen> <!-- Always be sure and run <bf>xhost</bf> to check the security that you have configured, to make sure everything is working correctly. --> 常に気を配り、自分が設定したセキュリティを <bf>xhost</bf> を実行して確 認し、全てが正しく動作していることを確かめてください。 <!-- nagoya@cc.hit-u.ac.jp end --> <!-- 担当: 東 --> <!-- 10-1 <sect>Bibliography and Other Resources --> <!-- 10-1 訳文--> <sect>関連図書とその他の情報源 <!-- 10-2 <p>There is lots of information on X Window to be found, on your computer right now、 on the Internet, and in some excellent books available at your favorite bookseller. Give some of the following resources a try, they have been extremely helpful to the author, and can be extremely helpful to you, too. --> <!-- 10-2 訳文--> <p>X に関しては、豊富な情報が色々なところにあります。あなたが今使っているコン ピュータの中、インターネット、お気に入りの本屋さんに並んでいる優れた書籍など です。 以下に記した情報源をいくつか試してみてください。私が使ってみてとても便利 だったものですから、おそらく皆さんにとっても、大変役に立つと思います。 <itemize> <!-- 10-3<item>Check the <url url="http://metalab.unc.edu/LDP" name="Linux Documentation Project"> website for a lot more documentation on Linux, X, and related items.--> <!-- 10-3 訳文--> <item>Linux や X 、その関連項目についてさらに情報が必要な方は以下のサイ トをあたってみてください。 <url url="http://metalab.unc.edu/LDP" name="Linux Documentation Project"> <!-- 10-4<item><url url="http://www.x11.org/">is sort of a clearinghouse for all things X.--> <!-- 10-4 訳文--> <item><url url="http://www.x11.org/"> は X に関するありとあらゆる情報が集まるところです。 <!-- 10-5<item><url url="http://www.themes.org/">is a headquarters for themes for various window managers.--> <!-- 10-5 訳文--> <item><url url="http://www.themes.org/"> は各種ウィンドウマネージャー用のテーマの総本山です。 <!-- 10-6<item>The X Consortium's web site is <url url="http://www.x.org/">... or perhaps it's moved to <url url="http://www.opengroup.com/">.--> <!-- 10-6 訳文--> <item>X コンソーシアムのサイトは <url url="http://www.x.org/"> ですが、 もしかすると、以下の URL に移動しているかもしれません。 <url url="http://www.opengroup.com/"> <!-- 10-7<item>XFree86 can be found at <url url="http://www.xfree86.org/">.--> <!-- 10-7訳文--> <item>XFree86 は <url url="http://www.xfree86.org/"> にあります。 <!-- 10-8<item>The O'Reilly series on X Window! Visit <url url="http://www.ora.com/">for the definitive books on X.--> <!-- 10-8訳文--> <item>オライリー社の X シリーズ。 X に関する決定的な書籍については以下のサイトを見てください。 <url url="http://www.ora.com/"> <!-- 10-9<item>Much more information on using TrueType with X is at <url url="http://www.freetype.org/">.--> <!-- 10-9訳文--> <item>X 上で TrueType フォントを使うときの情報がさらに必要なときは、 <url url="http://www.freetype.org/"> を見てください。 <!-- 10-10<item>The man pages for <bf>X</bf>, <bf>xterm</bf>, <bf>XFree86</bf>, and for any other clients you find yourself using often, are very useful and quite information-packed, and highly recommended. As the oft-repeated saying goes, RTFM.--> <!-- 10-10訳文--> <item><bf>X</bf>, <bf>xterm</bf>, <bf>XFree86</bf> や、皆さんがいつも 使っているその他のクライアントに関するオンラインマニュアルはとても役 に立つし、たくさんの情報が詰まっているので、強くお勧めします。「人に聞く前 に、マニュアルを読め」とは、よく言われることです。 <!-- 10-11<item>There is a <bf>Remote X Apps</bf> MINI-HOWTO that is very helpful in figuring out how to run local and remote clients with X.--> <!-- 10-11訳文--> <item><bf>Remote X Apps</bf> MINI-HOWTO は、ローカルクライアントやリモートクライアン トの、X 上での実行方法を知るには大変役立ちます。 <!-- <item>Don't forget to visit <url url="http://www.gnome.org/"> and <url url="http://www.kde.org/"> for the latest on unified desktop environments in Linux, which are becoming more and more commonplace all the time. --> <item> Linux での統合デスクトップ環境については <url url="http://www.gnome.org/"> と <url url="http://www.kde.org/"> を忘れ ずに見てください。これらはだんだん一般的になってきています。 </itemize> </article>