2007年10月12日
Xrandrエクステンションを使う
X.Orgの新しいバージョンでは、これまでのようにxorg.confのModesではなく、Xrandr――X Resize, Rotate and Reflectionエクステンションを使ってサイズの認識、リサイズを行うようになったようだ。xorg.confのModesをいくら変更しても解像度は変わらないので注意が必要。i810switchとか915resolutionとかももういらないのかな。
Xrandrのユーザコマンドであるxrandrのオプションはmanによると次のとおり。
xrandr [-help] [-display display] [-q] [-v] [--verbose] [--screen
snum]
RandR version 1.2 options
[--prop] [--fb <width>x<height>] [--fbmm <width>x<height>] [--dpi
<dpi>]
Per-output options
[--output <output>] [--auto] [--mode <mode>] [--preferred] [--pos
<x>x<y>] [--rate <rate>] [--reflect reflection] [--rotate orientation]
[--left-of <output>] [--right-of <output>] [--above <output>] [--below
<output>] [--same-as <output>] [--set <property> <value>] [--off]
[--crtc <crtc>] [--newmode <name> mode] [--rmmode <name>] [--addmode
<output> <name>] [--delmode <output> <name>]
RandR version 1.0 and version 1.1 options
[-o orientation] [-s size] [-x] [-y]
--helpだとこんな感じ。
usage: xrandr [options]
where options are:
-display <display> or -d <display>
-help
-o <normal,inverted,left,right,0,1,2,3>
or --orientation <normal,inverted,left,right,0,1,2,3>
-q or --query
-s <size>/<width>x<height> or --size <size>/<width>x<height>
-r <rate> or --rate <rate> or --refresh <rate>
-v or --version
-x (reflect in x)
-y (reflect in y)
--screen <screen>
--verbose
--dryrun
--prop or --properties
--fb <width>x<height>
--fbmm <width>x<height>
--dpi <dpi>/<output>
--output <output>
--auto
--mode <mode>
--preferred
--pos <x>x<y>
--rate <rate> or --refresh <rate>
--reflect normal,x,y,xy
--rotate normal,inverted,left,right
--left-of <output>
--right-of <output>
--above <output>
--below <output>
--same-as <output>
--set <property> <value>
--off
--crtc <crtc>
--newmode <name> <clock MHz>
<hdisp> <hsync-start> <hsync-end> <htotal>
<vdisp> <vsync-start> <vsync-end> <vtotal>
[+HSync] [-HSync] [+VSync] [-VSync]
--rmmode <name>
--addmode <output> <name>
--delmode <output> <name>
xrandrをオプションなしで実行すると、たとえばY2の場合はこんな感じで出る。
Screen 0: minimum 320 x 200, current 1400 x 1050, maximum 1400 x 1400 VGA disconnected (normal left inverted right x axis y axis) LVDS connected 1400x1050+0+0 (normal left inverted right x axis y axis) 0mm x 0mm 1400x1050 29.5*+ 85.3 74.8 70.0 60.0 1280x1024 85.0 75.0 60.0 1280x960 85.0 60.0 1280x800 60.0 1152x864 85.1 75.0 1280x768 60.0 1152x768 54.8 1024x768 85.0 75.0 70.1 60.0 832x624 74.6 800x600 85.1 72.2 75.0 60.3 56.2 640x480 85.0 72.8 75.0 59.9 720x400 85.0 640x400 85.1 640x350 85.1
ここで「VGA」はY2に付いてる外付けRGB、「LVDS」は液晶側ですね。この後は、この名前で指定することになる。
- 解像度を変える
- xrandr --output "LVDS" --mode 1024x768 のようにする。仮想スクリーンサイズもこれに追従するので、これまでのようにプレゼンのためにXを再起動とかしなくていい。
- 回転する
- xrandr --output "LVDS" --rotate left とか。ドラゴンスピリットを遊ぶくらいしか思いつかない。でも、例えばDELLの画面は90度回せるので、これでPDFの作業をしたいときにはいいかも? normalで戻る。
- 鏡面
- xrandr --output "LVDS" --reflect x のような感じ。気分はダヴィンチ。normalで戻る。
今のところGUIはgrandr(デザインがいまいちかな…)またはGNOMEアプレットで、KDEコントロールセンターではうまく操作できないようだけど、今後Windows並みにさくさくできるようになりそうだ。
![[hatena]](http://d.hatena.ne.jp/images/b_entry_de.gif)
![[RSS]](/d/rss10.png)