web-dev-qa-db-ja.com

xrandrの変更を持続させるにはどうすればよいですか?

このコマンドを実行して、ウィンドウを画面間で移動できるようにします。

xrandr --auto

この魔法のコマンドで画面が修正されます(これを実行する前の2番目のモニターは、マウスを移動できる空のスペースにすぎません)。再起動時にこのコマンドが保持するものをどのように作成できますか?このコマンドを再実行するだけではなく、構成を修正することに興味がありますが、これを実現する方法については無知です。

DFP 5とDFP 6の2つのモニターがあります。xrandrを実行すると、次のようになります。

DFP1 disconnected (normal left inverted right x axis y axis)
DFP2 disconnected (normal left inverted right x axis y axis)
DFP3 disconnected (normal left inverted right x axis y axis)
DFP4 disconnected (normal left inverted right x axis y axis)
DFP5 connected 1680x1050+1680+0 (normal left inverted right x axis y axis) 474mm x 296mm
   1680x1050      60.0*+
   1400x1050      60.0  
   1280x1024      75.0     60.0  
   1440x900       60.0  
   1280x960       75.0     60.0  
   1280x800       75.0     60.0  
   1152x864       60.0     75.0  
   1280x768       75.0     60.0  
   1280x720       75.0     60.0  
   1024x768       75.0     60.0  
   800x600        75.0     60.3  
   640x480        75.0     59.9  
DFP6 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 474mm x 296mm
   1680x1050      60.0*+
   1400x1050      60.0  
   1280x1024      75.0     60.0  
   1440x900       60.0  
   1280x960       75.0     60.0  
   1280x800       75.0     60.0  
   1152x864       60.0     75.0  
   1280x768       75.0     60.0  
   1280x720       75.0     60.0  
   1024x768       75.0     60.0  
   800x600        75.0     60.3  
   640x480        75.0     59.9  
CRT1 disconnected (normal left inverted right x axis y axis)

DebianのDisplaysメニューを使用して、DFP 6をDFP 5の右側に設定しました。これが私のxorg.confファイルです:

Section "ServerLayout"
        Identifier     "aticonfig Layout"
        Screen      0  "aticonfig-Screen[0]-0" 0 0
EndSection

Section "Module"
EndSection

Section "Monitor"
        Identifier   "aticonfig-Monitor[0]-0"
        Option      "VendorName" "ATI Proprietary Driver"
        Option      "ModelName" "Generic Autodetecting Monitor"
        Option      "DPMS" "true"
EndSection

Section "Device"
        Identifier  "aticonfig-Device[0]-0"
        Driver      "fglrx"
        BusID       "PCI:4:0:0"
EndSection

Section "Screen"
        Identifier "aticonfig-Screen[0]-0"
        Device     "aticonfig-Device[0]-0"
        Monitor    "aticonfig-Monitor[0]-0"
        DefaultDepth     24
        SubSection "Display"
                Viewport   0 0
                Depth     24
                virtual 3360 1050
        EndSubSection
EndSection

すべてが1つの画面になるように構成されているようで、xrandr --autoどういうわけかそれを修正します。結果をxorg.confに保存するためにこのコマンドが実行していることをのぞく方法はありますか?通常、結果を持続させるためにxrandrをどのように使用しますか?

これを検索すると、xorg.confファイルを変更するように指示されます(わからないため、方法がわかりませんwhatxrandr --autoは実際には実行中です)、または起動時にxrandrを実行する方法に関する指示です。これは必要ないと思いますが、間違っている可能性があります。

7
quant

次のファイルを作成しました。

/etc/X11/Xsession.d/45custom_xrandr-settingsそして、この行をその中に配置しました:

xrandr --output DFP6 --primary

これにより、正しいモニターがプライマリモニターになり、ログイン時に起動します。

4
quant

これはfglrxドライバーなので、aticonfigコマンドを使用してxorg.confファイルを生成できます。あなたのxrandr出力から、必要なコマンドはこれだと思います:

Sudo aticonfig --initial=dual-head --screen-layout=left

これで適切な結果が得られない場合は、aticonfigが自動的にxorg.confファイル(.fglrx-x拡張子付き)をバックアップするため、元の構成を簡単に復元できます。

aticonfigがうまくいかない場合は、xorg.confを構成するamdcccleというGUIツールがあります(fglrx-controlパッケージにあるはずです)。

3
Graeme
-xrandr --newmode "2560x1080_60.00"  230.00  2560 2720 2992 3424  1080 1083 1093 1120 -hsync +vsync
-xrandr --addmode HDMI1 "2560x1080_60.00"
-xrandr --output HDMI1 --mode 2560x1080_60.00 --rate 50.0
-xrandr --output eDP1 --mode 1920x1080 --rate 60.0

xrandrをチェックして、HDMI番号とeDP1(これは私の内部画面のラップトップです)を確認します。これらの行をSudo gedit/usr/sbin/lightdm-sessionに追加します。

#Guide
#Purge xorg, xserver-* nvidia*
#Install online xorg and xserver-xorg
#Install nvidia-settings and nvidia-prime


#gnome-session-properties
#unity --replace
1
Vitor Nazário

ブートスクリプトで実行します。

パート1:

スクリプト用のディレクトリを作成します...これは何でもどこでもかまいません。逸脱した場合は、その場所を覚えておいてください。

mkdir ~/Scripts

次のパートで使い慣れたテキストエディタを使用できます

gedit ~/Scripts/setoutput.sh

これらをスクリプトに追加します#!/ usr/bin/env sh xrandr --auto

「xrandr -s 1440x900」を使用します。ファイルを保存/閉じます。次のコマンドを実行して終了します。

chmod +x ~/Scripts/setoutput.sh
Sudo ln -s ~/Scripts/setoutput.sh /etc/X11/Xsession.d/45setoutput
reboot

「リブート」は「shutdown -r now」に置き換える必要があるかもしれません

システムが起動すると、設定が実行されているはずです。スクリプトが存在する限り、設定は永続化されます。

2011年11月1日火曜日の午前7時2分 Linuxmint に投稿された「xenopeek」に一部感謝します。コマンドがわずかに変更されても、同じ基本概念/スクリプト。

0
Leptoid