0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CENTOSでデュアルディスプレイのプライマリ設定(恒久的) メモ

0
Posted at

環境

  • centos7

目的

PC再起動後にディスプレイのプライマリ設定を自動で設定したい

準備

xrandr      

実行結果

Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 16384 x 16384
DVI-D-1 disconnected (normal left inverted right x axis y axis)
HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 698mm x 393mm
   1920x1080     60.00*+  59.96    50.00    50.00    59.94    59.93  

   ~~省略~~

   320x180       59.84    59.32  
VGA-1 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 476mm x 268mm
   1920x1080     60.00*+  59.96    59.93  

   ~~省略~~

   320x180       59.84    59.32  

プライマリとして設定したいディスプレイポート(HDMI、VGA等)を確認

設定

sudo vi /etc/gdm/Init/Default
# !/bin/sh
# Stolen from the debian kdm setup, aren't I sneaky
# Plus a lot of fun stuff added
#  -George

PATH="/usr/bin:$PATH"
OLD_IFS=$IFS

/usr/bin/xrandr --output HDMI-1 --auto --primary  # ここに設定したいコマンドを記載(今回はHDMIで設定)

gdmwhich () {
  COMMAND="$1"
  OUTPUT=
  IFS=:
   ~~~省略~~~
}

確認

再起動後、HDMIで接続したディスプレイがプライマリディスプレイとして表示されるか確認

上記方法で行った理由

rc.localで実行させる方法を試したが、上手くいかないため

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?