Sunday 11 January, 2015 [長年日記]
_ [BSD][Mac] MacBookにFreeBSDを (12) - X11の設定 -
もう一つハードウェアに依存する話があった。X WINDOW SYSTEM (X11) の設定である。 もっとも最近のXorgのX11は自動的に設定される部分が増えてとりあえず全部入れてstartxすると起動してしまうのであまり気にすることはないことも確かである。
ただ今回のMacBookの場合はDiskの容量が限られているのでわずかとはいえ余計なものは入れたくない。
最近になってportsにx11/xorg-minimalというものができているのに気付いたので、
とりあえずこれとx11/xterm、x11-wm/twmと最低限のものを入れることにした。
haldとdbusを使うので/etc/rc.confに
hald_enable="YES"
dbus_enable="YES"
を追加する。と書いたところで確認してみたらports/UPDATINGに
20141219: AFFECTS: users of x11/xorg and all xorg ports AUTHOR: dumbbell@FreeBSD.org The X.Org server (x11-servers/xorg-server) is updated to 1.14. All ports which provide X.Org drivers must be updated simultaneously, i.e. x11-drivers/xf86-*, emulators/virtualbox-ose-additions, net/tigervnc, etc. The input device autodetection backend is switched from HAL to devd. If you configure your keyboard layout through HAL .fdi files, you need to migrate this configuration to plain X.Org configuration files. Up-to-date instructions and a description of the changes brought by this update are detailed in a blog post: http://blogs.freebsdish.org/graphics/2014/11/19/xserver-1-14-update-ready/とあり、HALを使わないような変更が行われたようである。ということで
/etc/rc.confには
dbus_enable="YES"
だけでいいのかな。
keyboard layoutの変更などはHALの設定で行われることになっていたが、もういちど確認が必要かな。X11の設定についてはrootで
# X -configure
とすると自動的に設定されたxorg.conf.newができる。今回の場合は
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "Files"
ModulePath "/usr/local/lib/xorg/modules"
FontPath "/usr/local/lib/X11/fonts/misc/"
FontPath "/usr/local/lib/X11/fonts/TTF/"
FontPath "/usr/local/lib/X11/fonts/OTF/"
FontPath "/usr/local/lib/X11/fonts/Type1/"
FontPath "/usr/local/lib/X11/fonts/100dpi/"
FontPath "/usr/local/lib/X11/fonts/75dpi/"
EndSection
Section "Module"
Load "glx"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/sysmouse"
Option "ZAxisMapping" "4 5 6 7"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "Monitor Model"
EndSection
Section "Device"
### Available Driver options are:-
### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
### <percent>: "<f>%"
### [arg]: arg optional
#Option "ShadowFB" # [<bool>]
#Option "DefaultRefresh" # [<bool>]
#Option "ModeSetClearScreen" # [<bool>]
Identifier "Card0"
Driver "vesa"
BusID "PCI:0:2:0"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Viewport 0 0
Depth 1
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 4
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 8
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 15
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 16
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection
となった。これでX11は起動するがせっかくVideoがIntelだと分かっているので(ほとんど効果はないが)
x11-drivers/xf86-video-intelをinstallして
"vesa"の代わりに"intel"としたものを/etc/X11/xorg.confとした。一般ユーザーでも$HOMEにX11の設定がない場合にstartxすると
/usr/local/etc/X11/xinit/xinitrcの
内容に従って起動する。この中ではtwm、xclock、xtermを起動させている。
とりあえずこれを$HOME/.xinitrcとしてcopyして編集して使うのが楽である。
もっとも後ほど述べるlogin managerを導入する際には$HOME/.xsessionが必要になるので
私の場合は$HOME/.xsessionとしておいて.xinitrcはsymbolic linkとしている。
$ ln -sf .xsession .xinitrc
その他の設定についてはこのサイトが参考になる。
(12/05/2015 追記) この項については内容が変わっているので後の日記を参照のこと。
[ツッコミを入れる]







