2019-01-07 21:38:30 +01:00
|
|
|
{{ ansible_managed | comment }}
|
2019-02-22 00:12:02 +01:00
|
|
|
{% set primary_output = xorg.primary.connector|replace("-", "") %}
|
|
|
|
{% if xorg.secondary is defined %}
|
|
|
|
{% set secondary_output = xorg.secondary.connector|replace("-", "") %}
|
|
|
|
{% endif %}
|
2019-01-07 21:38:30 +01:00
|
|
|
|
|
|
|
Section "Device"
|
|
|
|
Identifier "Device0"
|
|
|
|
Driver "intel"
|
|
|
|
Option "TearFree" "true"
|
2019-02-22 00:12:02 +01:00
|
|
|
{% if xorg.secondary is defined %}
|
|
|
|
Option "ZaphodHeads" "{{ primary_output }}"
|
|
|
|
Screen 0
|
|
|
|
{% endif %}
|
|
|
|
EndSection
|
|
|
|
|
|
|
|
{% if xorg.secondary is defined %}
|
|
|
|
Section "Device"
|
|
|
|
Identifier "Device1"
|
|
|
|
Driver "intel"
|
|
|
|
Option "TearFree" "true"
|
|
|
|
Option "ZaphodHeads" "{{ secondary_output }}"
|
|
|
|
Screen 1
|
|
|
|
EndSection
|
|
|
|
|
|
|
|
Section "ServerLayout"
|
|
|
|
Identifier "Layout0"
|
|
|
|
Screen 0 "Screen0" 0 0
|
|
|
|
Screen 1 "Screen1" RightOf "Screen0"
|
2019-01-07 21:38:30 +01:00
|
|
|
EndSection
|
2019-02-22 00:12:02 +01:00
|
|
|
{% endif %}
|
|
|
|
|
2019-01-07 21:38:30 +01:00
|
|
|
Section "Screen"
|
|
|
|
Identifier "Screen0"
|
|
|
|
Device "Device0"
|
2019-02-22 00:12:02 +01:00
|
|
|
Monitor "{{ primary_output }}"
|
2019-01-07 21:38:30 +01:00
|
|
|
DefaultDepth 24
|
|
|
|
SubSection "Display"
|
|
|
|
Depth 24
|
|
|
|
{% if xorg.primary.mode %}
|
2019-01-07 21:56:48 +01:00
|
|
|
Modes "{{ xorg.primary.mode }}"
|
2019-01-07 21:38:30 +01:00
|
|
|
{% else %}
|
|
|
|
Modes "1920x1080_50" "1920x1080_60" "1920x1080_24"
|
|
|
|
{% endif %}
|
|
|
|
EndSubSection
|
|
|
|
EndSection
|
2019-02-22 00:12:02 +01:00
|
|
|
|
|
|
|
{% if xorg.secondary is defined %}
|
|
|
|
Section "Screen"
|
|
|
|
Identifier "Screen1"
|
|
|
|
Device "Device1"
|
|
|
|
Monitor "{{ secondary_output }}"
|
|
|
|
DefaultDepth 24
|
|
|
|
SubSection "Display"
|
|
|
|
Depth 24
|
|
|
|
{% if xorg.secondary.mode %}
|
|
|
|
Modes "{{ xorg.secondary.mode }}"
|
|
|
|
{% else %}
|
|
|
|
Modes "1920x1080_50" "1920x1080_60" "1920x1080_24"
|
|
|
|
{% endif %}
|
|
|
|
EndSubSection
|
|
|
|
EndSection
|
|
|
|
|
|
|
|
{% endif %}
|
2019-01-07 21:38:30 +01:00
|
|
|
Section "Monitor"
|
2019-02-22 00:12:02 +01:00
|
|
|
Identifier "{{ primary_output }}"
|
2019-01-07 21:56:48 +01:00
|
|
|
{% if xorg.primary.modelines %}
|
|
|
|
{% for modeline in xorg.primary.modelines %}
|
2019-01-07 21:38:30 +01:00
|
|
|
{{ modeline }}
|
2019-01-07 21:56:48 +01:00
|
|
|
{% endfor %}
|
|
|
|
{% else %}
|
2019-01-07 21:38:30 +01:00
|
|
|
Modeline "1920x1080_24" 74.230 1920 2560 2604 2752 1080 1084 1089 1125 +hsync +vsync
|
|
|
|
Modeline "1920x1080_50" 148.500 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync
|
|
|
|
Modeline "1920x1080_60" 148.500 1920 2008 2056 2200 1080 1084 1089 1125 +hsync +vsync
|
2019-01-07 21:56:48 +01:00
|
|
|
{% endif %}
|
2019-01-07 21:38:30 +01:00
|
|
|
EndSection
|
|
|
|
|
2019-02-22 00:12:02 +01:00
|
|
|
{% if xorg.secondary is defined %}
|
|
|
|
Section "Monitor"
|
|
|
|
Identifier "{{ secondary_output }}"
|
|
|
|
{% if xorg.secondary.modelines %}
|
|
|
|
{% for modeline in xorg.secondary.modelines %}
|
|
|
|
{{ modeline }}
|
|
|
|
{% endfor %}
|
|
|
|
{% else %}
|
|
|
|
Modeline "1920x1080_24" 74.230 1920 2560 2604 2752 1080 1084 1089 1125 +hsync +vsync
|
|
|
|
Modeline "1920x1080_50" 148.500 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync
|
|
|
|
Modeline "1920x1080_60" 148.500 1920 2008 2056 2200 1080 1084 1089 1125 +hsync +vsync
|
|
|
|
{% endif %}
|
|
|
|
EndSection
|
|
|
|
|
|
|
|
{% endif %}
|
2019-01-07 21:38:30 +01:00
|
|
|
{% for connector, data in xrandr["Screen 0:"].iteritems() %}
|
2019-02-22 00:12:02 +01:00
|
|
|
{% if not data.is_connected or connector != xorg.primary.connector or (xorg.secondary is defined and connector != xorg.secondary.connector) %}
|
2019-01-07 21:38:30 +01:00
|
|
|
Section "Monitor"
|
|
|
|
Identifier "{{ connector|replace("-","") }}"
|
|
|
|
Option "Ignore" "true"
|
|
|
|
EndSection
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% endfor %}
|