From 08ed05594ef59e6839d844456afb1e191b840d47 Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Fri, 22 Feb 2019 00:12:02 +0100 Subject: [PATCH] Allow Dual Screen Configurations for intel IGPs improve xrandr_facts.py to match drm and xrandr outputs TODO: use drm.edid_firmware kernel boot parameter to load EDID files on startup --- Manual.html | 1316 +++++++++++-------- Manual.org | 97 +- library/xrandr_facts.py | 71 +- roles/yavdr-xorg/tasks/setup-xorg.yml | 6 + roles/yavdr-xorg/templates/20-intel.conf.j2 | 69 +- 5 files changed, 966 insertions(+), 593 deletions(-) diff --git a/Manual.html b/Manual.html index 8a61d21..02b09e2 100644 --- a/Manual.html +++ b/Manual.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Ansible Playbooks for yaVDR 0.7 @@ -204,7 +204,7 @@ @licstart The following is the entire license notice for the JavaScript code in this tag. -Copyright (C) 2012-2018 Free Software Foundation, Inc. +Copyright (C) 2012-2019 Free Software Foundation, Inc. The JavaScript code in this tag is free software: you can redistribute it and/or modify it under the terms of the GNU @@ -253,275 +253,275 @@ for the JavaScript code in this tag.

Inhaltsverzeichnis

-
-

1 User Stories

+
+

1 User Stories

-
-

1.1 yavdr-full

+
+

1.1 yavdr-full

A User wants to install yaVDR without customization and relies on full automation. @@ -554,24 +554,24 @@ Several roles are used to tie everything together:

-
-

1.1.1 Using vdr, pulseaudio and xorg together

+
+

1.1.1 Using vdr, pulseaudio and xorg together

-
-

2 Introduction

+
+

2 Introduction

One of the major problems we faced with customized Ubuntu ISO files as installation media for prior yaVDR versions has been the limited hardware support and the time consuming process to create and update them. An interesting alternative to this approach is to enable the user to choose the installation medium by himself, so point releases, kernel versions and additional drivers can be chosen deliberately. After the basic setup is complete (and a working internet connection is available), a fully customizable install script completes the yaVDR installation.

-
-

3 Installing and configuring yaVDR with Ansible

+
+

3 Installing and configuring yaVDR with Ansible

This is an experimental feature which allows to set up a yaVDR installation based on a normal Ubuntu Server 16.04.x installation using Ansible. @@ -606,8 +606,8 @@ We use a callback to generate tags for all roles autmatically:

-
-

3.1 Install scripts for local usage

+
+

3.1 Install scripts for local usage

set -e
@@ -652,12 +652,12 @@ ansible-playbook yavdr07-headless.yml -b -i 'localhost_
 
-
-

4 Playbooks

+
+

4 Playbooks

-
-

4.1 yavdr07.yml

+
+

4.1 yavdr07.yml

The yavdr07.yml playbook sets up a fully-featured yaVDR installation: @@ -710,8 +710,8 @@ The yavdr07.yml playbook sets up a fully-featured yaVDR installatio

-
-

4.2 yavdr07-headless.yml

+
+

4.2 yavdr07-headless.yml

For a headless server installation yavdr07-headless.yml is a good choice @@ -749,8 +749,8 @@ For a headless server installation yavdr07-headless.yml is a good c

-
-

5 Hosts

+
+

5 Hosts

This playbook can either be used to run the installation on the localhost or any other PC in the network that can be accessed via ssh. Simply add the host names or IP addresses to the hosts file in the respective section: @@ -764,12 +764,12 @@ This playbook can either be used to run the installation on the localhost or any

-
-

6 Group Variables

+
+

6 Group Variables

-
-

6.1 PPAs

+
+

6.1 PPAs

---
@@ -781,14 +781,14 @@ This playbook can either be used to run the installation on the localhost or any
 repositories:
   - '{{ ppa_owner }}/{{branch}}-main'
   - '{{ ppa_owner }}/{{branch}}-vdr'
+  - '{{ ppa_owner }}/{{branch}}-kodi'
   #- '{{ ppa_owner }}/{{branch}}-yavdr'
-  #- '{{ ppa_owner }}/{{branch}}-kodi'
 
-
-

6.2 VDR user, directories, special configuration and plugins

+
+

6.2 VDR user, directories, special configuration and plugins

# properties of the user vdr and vdr-related options
@@ -814,8 +814,8 @@ This playbook can either be used to run the installation on the localhost or any
 
-
-

6.3 Media directories

+
+

6.3 Media directories

# dictionary of directories for (shared) files. Automatically exported via NFS and Samba if those roles are enabled
@@ -830,8 +830,8 @@ This playbook can either be used to run the installation on the localhost or any
 
-
-

6.4 NFS

+
+

6.4 NFS

nfs:
@@ -840,8 +840,8 @@ This playbook can either be used to run the installation on the localhost or any
 
-
-

6.5 Samba

+
+

6.5 Samba

samba:
@@ -851,8 +851,8 @@ This playbook can either be used to run the installation on the localhost or any
 
-
-

6.6 Additional packages

+
+

6.6 Additional packages

# additional packages you want to install
@@ -871,8 +871,8 @@ This playbook can either be used to run the installation on the localhost or any
 
-
-

6.7 System pre-configuration

+
+

6.7 System pre-configuration

frontend: vdr
@@ -886,8 +886,8 @@ This playbook can either be used to run the installation on the localhost or any
 
-
-

6.8 Serial IR

+
+

6.8 Serial IR

# Serial device to configure for a homebrew receiver.
@@ -899,20 +899,20 @@ This playbook can either be used to run the installation on the localhost or any
 
-
-

7 Roles

+
+

7 Roles

-
-

7.1 install-dependencies

+
+

7.1 install-dependencies

-
-

7.1.1 tasks

+
+

7.1.1 tasks

    -
  1. main.yml
    +
  2. main.yml
    ---
    @@ -930,19 +930,19 @@ This playbook can either be used to run the installation on the localhost or any
     
-
-

7.2 nvidia experimental drivers

+
+

7.2 nvidia experimental drivers

install nvidia-396 from ppa:graphics-drivers/ppa

-
-

7.2.1 tasks

+
+

7.2.1 tasks

    -
  1. main.yml
    +
  2. main.yml
    ---
    @@ -971,15 +971,15 @@ install nvidia-396 from ppa:graphics-drivers/ppa
     
-
-

7.3 yavdr-common

+
+

7.3 yavdr-common

This role is used to set up a basic yaVDR installation. It creates the directories, installs the vdr and other useful packages.

-
-

7.3.1 default variables

+
+

7.3.1 default variables

This section is for reference only, please use the files in global_vars for customizations. @@ -992,7 +992,7 @@ This section is for reference only, please use the files in global_vars

    -
  1. Repositories
    +
  2. Repositories

    You can set a list of package repositories which provide the necessary packages. Feel free to use own PPAs if you need special customization to the VDR and it’s plugins. @@ -1009,7 +1009,7 @@ You can set a list of package repositories which provide the necessary packages.

-
  • Drivers
    +
  • Drivers

    Automatically installed drivers can be very useful, but if you know you need a certain driver, you can simply set it’s value to true. If you don’t want a driver to be installed, set it’s value to false. @@ -1022,7 +1022,7 @@ Automatically installed drivers can be very useful, but if you know you need a c

  • -
  • Additional Packages
    +
  • Additional Packages

    Add additional packages you would like to have on your installation to this list @@ -1036,7 +1036,7 @@ Add additional packages you would like to have on your installation to this list

  • -
  • VDR
    +
  • VDR

    This section allows you to set the recording directory, the user and group that runs the vdr and it’s home directory. @@ -1069,15 +1069,15 @@ This section allows you to set the recording directory, the user and group that

  • -
    -

    7.3.2 tasks

    +
    +

    7.3.2 tasks

    yavdr-common executes the following tasks:

      -
    1. main.yml
      +
    2. main.yml
      ---
      @@ -1095,7 +1095,7 @@ yavdr-common executes the following tasks:
       
        -
      1. Disable default installation of recommended packages
        +
      2. Disable default installation of recommended packages

        This task prevents apt to automatically install all recommended dependencies for packages: @@ -1112,7 +1112,7 @@ This task prevents apt to automatically install all recommended dependencies for

    -
  • Set up package repositories
    +
  • Set up package repositories
    - name: add PPAs
    @@ -1132,7 +1132,7 @@ This task prevents apt to automatically install all recommended dependencies for
     
  • -
  • Use bash instead of dash
    +
  • Use bash instead of dash
    - name: use bash instead of dash
    @@ -1144,15 +1144,15 @@ This task prevents apt to automatically install all recommended dependencies for
     
  • -
  • create user vdr
    +
  • create user vdr
  • -
  • Disable release-upgrade notifications
    +
  • Disable release-upgrade notifications
      -
    1. SOMEDAY move from lineinfile to template
      +
    2. SOMEDAY move from lineinfile to template
      - name: disable release-upgrade notifications
      @@ -1174,7 +1174,7 @@ This task prevents apt to automatically install all recommended dependencies for
       
  • -
  • Install essential packages
    +
  • Install essential packages
    - name: apt | install basic packages
    @@ -1205,7 +1205,7 @@ This task prevents apt to automatically install all recommended dependencies for
     
  • -
  • Install additional packages (user defined)
    +
  • Install additional packages (user defined)
    - name: apt | install extra packages
    @@ -1218,15 +1218,15 @@ This task prevents apt to automatically install all recommended dependencies for
     
  • -
  • create directories
    +
  • create directories
  • -
  • create sudoers drop-in for vdr
    +
  • create sudoers drop-in for vdr
  • -
  • basic scripts for standby support
    +
  • basic scripts for standby support

    Stop vdr before entering suspend and unload dvb modules, reverse this operation on resume @@ -1237,8 +1237,8 @@ Stop vdr before entering suspend and unload dvb modules, reverse this operation

  • -
    -

    7.3.3 templates

    +
    +

    7.3.3 templates

    {{ ansible_managed | comment('c') }}
    @@ -1249,7 +1249,7 @@ APT::Install-Suggests "0";
     
      -
    1. yavdr sudoers drop-in
      +
    2. yavdr sudoers drop-in

      Allow the vdr user to restart vdr.service and reboot the system @@ -1261,7 +1261,7 @@ Allow the vdr user to restart vdr.service and reboot the system

    -
  • suspend hooks
    +
  • suspend hooks
    #!/bin/bash
    @@ -1290,7 +1290,7 @@ Allow the vdr user to restart vdr.service and reboot the system
     
  • -
  • module-helper
    +
  • module-helper
    #!/usr/bin/env python3
    @@ -1377,12 +1377,12 @@ Allow the vdr user to restart vdr.service and reboot the system
     
     
    -
    -

    7.4 collect facts about the system with custom modules

    +
    +

    7.4 collect facts about the system with custom modules

    -
    -

    7.4.1 variables

    +
    +

    7.4.1 variables

    first_run: False
    @@ -1390,12 +1390,12 @@ Allow the vdr user to restart vdr.service and reboot the system
     
    -
    -

    7.4.2 tasks

    +
    +

    7.4.2 tasks

      -
    1. main.yml
      +
    2. main.yml
      - name: get information about usb and pci hardware and loaded kernel modules
      @@ -1444,16 +1444,16 @@ Allow the vdr user to restart vdr.service and reboot the system
       
    -
    -

    7.5 vdr

    +
    +

    7.5 vdr

    -
    -

    7.5.1 tasks

    +
    +

    7.5.1 tasks

      -
    1. install the basic vdr packages
      +
    2. install the basic vdr packages
      ---
      @@ -1471,7 +1471,7 @@ Allow the vdr user to restart vdr.service and reboot the system
       
    3. -
    4. Add svdrp/svdrp-disc to /etc/services
      +
    5. Add svdrp/svdrp-disc to /etc/services
      - name: add svdrp and svdrp-disc to /etc/services
      @@ -1486,7 +1486,7 @@ Allow the vdr user to restart vdr.service and reboot the system
       
    6. -
    7. Set up the recording directory for the vdr user
      +
    8. Set up the recording directory for the vdr user
      - name: create vdr recdir
      @@ -1521,7 +1521,7 @@ Allow the vdr user to restart vdr.service and reboot the system
       
    9. -
    10. Install additional vdr plugins
      +
    11. Install additional vdr plugins

      The additional plugins to install can be set in the variable {{vdr_plugins}} in the group variables @@ -1537,7 +1537,7 @@ The additional plugins to install can be set in the variable {{vdr_plugins

  • -
  • copy vdr configuration files (if they don’t exist yet)
    +
  • copy vdr configuration files (if they don’t exist yet)
    - name: ensure vdr is stopped
    @@ -1568,7 +1568,7 @@ The additional plugins to install can be set in the variable {{vdr_plugins
     
  • -
  • start vdr after network-online.target
    +
  • start vdr after network-online.target
    - name: create directory for vdr.service systemd drop-in files
    @@ -1589,8 +1589,8 @@ The additional plugins to install can be set in the variable {{vdr_plugins
     
     
    -
    -

    7.5.2 templates

    +
    +

    7.5.2 templates

    Start after network-online.target @@ -1602,12 +1602,12 @@ Start after network-online.target

    -
    -

    7.5.3 files

    +
    +

    7.5.3 files

      -
    1. remote.conf
      +
    2. remote.conf
      LIRC.Up KEY_UP
      @@ -1742,7 +1742,7 @@ XKeySym.Next       XF86AudioNext
       
    3. -
    4. keymacros.conf
      +
    5. keymacros.conf
      # Remote control key macros for VDR
      @@ -1768,12 +1768,12 @@ User0     @osdteletext
       
    -
    -

    7.6 STARTED yavdr-network

    +
    +

    7.6 STARTED yavdr-network

    -
    -

    7.6.1 default variables

    +
    +

    7.6.1 default variables

    install_avahi: true
    @@ -1781,8 +1781,8 @@ User0     @osdteletext
     
    -
    -

    7.6.2 tasks

    +
    +

    7.6.2 tasks

    ---
    @@ -1850,12 +1850,12 @@ User0     @osdteletext
     
    -
    -

    7.7 vdr-plugin-menuorg

    +
    +

    7.7 vdr-plugin-menuorg

    -
    -

    7.7.1 tasks

    +
    +

    7.7.1 tasks

    ---
    @@ -1877,8 +1877,8 @@ User0     @osdteletext
     
    -
    -

    7.7.2 templates

    +
    +

    7.7.2 templates

    <?xml version="1.0" encoding="UTF-8"?>                                                                                                                      
    @@ -1937,17 +1937,17 @@ User0     @osdteletext
     
    -
    -

    7.8 nfs-server

    +
    +

    7.8 nfs-server

    -
    -

    7.8.1 TODO avahi-services für NFS beim Stoppen des nfs-kernel-servers depublizieren, beim Start wieder announcen

    +
    +

    7.8.1 TODO avahi-services für NFS beim Stoppen des nfs-kernel-servers depublizieren, beim Start wieder announcen

    -
    -

    7.8.2 tasks

    +
    +

    7.8.2 tasks

    ---
    @@ -1975,12 +1975,12 @@ User0     @osdteletext
     
    -
    -

    7.8.3 templates

    +
    +

    7.8.3 templates

      -
    1. /etc/exports
      +
    2. /etc/exports
      /srv *(rw,fsid=0,sync,no_subtree_check,all_squash,anongid={{ vdr.gid }},anonuid={{ vdr.uid }})
      @@ -1991,7 +1991,7 @@ User0     @osdteletext
       
    3. -
    4. avahi services
      +
    5. avahi services
      <?xml version="1.0" standalone='no'?>
      @@ -2012,15 +2012,15 @@ User0     @osdteletext
       
    -
    -

    7.9 yavdr-remote

    +
    +

    7.9 yavdr-remote

    The role yavdr-remote sets up the foundation for using eventlircd, lircd2uinput and the pre-configuration for remote receivers which can be detected by udev.

    -
    -

    7.9.1 default variables

    +
    +

    7.9.1 default variables

    lircd0_socket: /var/run/lirc/lircd0
    @@ -2028,8 +2028,8 @@ The role yavdr-remote sets up the foundation for using eventlircd,
     
    -
    -

    7.9.2 tasks

    +
    +

    7.9.2 tasks

    ---
    @@ -2100,12 +2100,12 @@ The role yavdr-remote sets up the foundation for using eventlircd,
     
    -
    -

    7.9.3 templates

    +
    +

    7.9.3 templates

      -
    1. Systemd Drop-in to start vdr with lirc support
      +
    2. Systemd Drop-in to start vdr with lirc support
      {% if frontend != 'kodi' %}
      @@ -2116,7 +2116,7 @@ The role yavdr-remote sets up the foundation for using eventlircd,
       
    3. -
    4. Systemd Drop-in to start lircd2uinput with lircd
      +
    5. Systemd Drop-in to start lircd2uinput with lircd
      [Service]
      @@ -2126,7 +2126,7 @@ The role yavdr-remote sets up the foundation for using eventlircd,
       
    6. -
    7. create /etc/rc_maps.cfg
      +
    8. create /etc/rc_maps.cfg
      {{ ansible_managed | comment }}
      @@ -2318,12 +2318,12 @@ ati_remote    rc-medion-x10-digitainer   /lib/udev/rc_keymaps/rc-medion-x10-digi
       
    -
    -

    7.10 pulseaudio

    +
    +

    7.10 pulseaudio

    -
    -

    7.10.1 tasks

    +
    +

    7.10.1 tasks

    ---
    @@ -2345,8 +2345,8 @@ ati_remote    rc-medion-x10-digitainer   /lib/udev/rc_keymaps/rc-medion-x10-digi
     
    -
    -

    7.10.2 templates

    +
    +

    7.10.2 templates

    # Use PulseAudio by default
    @@ -2368,20 +2368,20 @@ ati_remote    rc-medion-x10-digitainer   /lib/udev/rc_keymaps/rc-medion-x10-digi
     
    -
    -

    7.11 yavdr-xorg

    +
    +

    7.11 yavdr-xorg

    -
    -

    7.11.1 About the GUI session

    +
    +

    7.11.1 About the GUI session

    -The X-Server is started by using the two systemd units xlogin@.service and x@.service provided by the package xlogin. The former is enabled (and started) for the vdr user - which results (using the default settings for the user vdr with the uid 666) in the activation of xlogin@vdr.service when reaching the graphical.target. To simplify starting and stopping the X-server and the desktop session a yavdr-xorg.service is provided by the package yavdr-xorg, which depends on the two units mentioned before. +The X-Server is started by using the two systemd units xlogin@.service and x@.service provided by the package xlogin. The former is enabled (and started) for the vdr user - which results (using the default settings for the user vdr with the uid 666) in the activation of xlogin@vdr.service when reaching the graphical.target. To simplify starting and stopping the X-server and the desktop session a yavdr-xorg.service is provided by the package yavdr-xorg, which depends on the two units mentioned before.

    x@vt7.service is started automatically as a dependency of xlogin@vdr.service and starts the X-server. xlogin@vdr.service also starts a systemd user session using user@666.service. -In order to use the keyboard layout configured during installation for the X-Server the script write-x11-keyboard-config reads the keyboard configuration from /etc/default/keyboard when starting x@.service and writes the file /etc/X11/xorg.conf.d/00-keyboard.conf (because systemd for Ubuntu (and Debian) has been patched not to create /etc/X11/xorg.conf.d/00-keyboard.conf according to the localectl settings). +In order to use the keyboard layout configured during installation for the X-Server we are using a script write-x11-keyboard-config, which reads the keyboard configuration from /etc/default/keyboard when starting x@.service and writes the file /etc/X11/xorg.conf.d/00-keyboard.conf (because systemd for Ubuntu (and Debian) has been patched not to automatically create the configuration file /etc/X11/xorg.conf.d/00-keyboard.conf according to the localectl settings).

    @@ -2402,8 +2402,8 @@ In order to achive a clean shutdown of the session, x@t7.service is

    -
    -

    7.11.2 default variables

    +
    +

    7.11.2 default variables

    first_run: False
    @@ -2426,12 +2426,12 @@ In order to achive a clean shutdown of the session, x@t7.service is
     
    -
    -

    7.11.3 tasks

    +
    +

    7.11.3 tasks

      -
    1. main.yml
      +
    2. main.yml
      ---
      @@ -2444,7 +2444,7 @@ In order to achive a clean shutdown of the session, x@t7.service is
       
    3. -
    4. setup-xorg.yml
      +
    5. setup-xorg.yml
      ---
      @@ -2493,6 +2493,12 @@ In order to achive a clean shutdown of the session, x@t7.service is
             - '-w alsa-driver-broken'
             # - '-a pulse' # do we need this with our existing asound.conf?
       
      +- name: vdr-config | use vaapi for softhddevice if we got an intel IGP
      +  lineinfile:
      +    path: /etc/vdr/conf.avail/softhddevice.conf
      +    line: '-v va-pi'
      +    state: present if intel_detected else absent
      +
       - name: add a login shell for the user vdr
         user:
             name: '{{ vdr.user }}'
      @@ -2556,7 +2562,7 @@ In order to achive a clean shutdown of the session, x@t7.service is
       
    6. -
    7. detect-xorg.yml
      +
    8. detect-xorg.yml
      ---
      @@ -2736,11 +2742,15 @@ In order to achive a clean shutdown of the session, x@t7.service is
         when:
           - intel_detected
       
      +- name: server flags config snippet to disable screen blanking
      +  template:
      +    src: templates/10-serverflags.conf.j2
      +    dest: /etc/X11/xorg.conf.d/10-serverflags.conf
       
    9. -
    10. intel.yml
      +
    11. intel.yml

      KMS drivers (like for intel (i915) and amd (radeon)) require additional configuration besides a customized xorg.conf - for a „static“ output configuration (which works if the TV or AV receiver is not turned on) we need to force loading the display(s) EDID early during the boot process. @@ -2788,12 +2798,12 @@ Please note that rescanning the connected displays works only after removing the

    -
    -

    7.11.4 templates

    +
    +

    7.11.4 templates

      -
    1. grub
      +
    2. grub
      {{ ansible_managed | comment }}
      @@ -2803,11 +2813,11 @@ Please note that rescanning the connected displays works only after removing the
       
    3. -
    4. xorg
      +
    5. xorg
        -
      1. x-verbose@.service
        +
      2. x-verbose@.service
        # file: roles/yavdr-xorg/templates/systemd/system/x-verbose@.service.j2
        @@ -2823,7 +2833,7 @@ Please note that rescanning the connected displays works only after removing the
         
      3. -
      4. Drop-in snippet for x@.service
        +
      5. Drop-in snippet for x@.service
        [Unit]
        @@ -2849,7 +2859,7 @@ Please note that rescanning the connected displays works only after removing the
         
      6. -
      7. Drop-in snippet for vdr.service
        +
      8. Drop-in snippet for vdr.service
        {{ ansible_managed | comment }}
        @@ -2861,7 +2871,7 @@ Please note that rescanning the connected displays works only after removing the
         
      9. -
      10. xorg.conf snippets
        +
      11. xorg.conf snippets
        {{ ansible_managed | comment }}
        @@ -2876,25 +2886,45 @@ EndSection
         
      12. -
      13. intel graphics xorg.conf snippet
        +
      14. intel graphics xorg.conf snippet
        {{ ansible_managed | comment }}
        -
        -{% set output = xorg.primary.connector|replace("-", "") %}
        +{% set primary_output = xorg.primary.connector|replace("-", "") %}
        +{% if xorg.secondary is defined %}
        +  {% set secondary_output = xorg.secondary.connector|replace("-", "") %}
        +{% endif %}
         
         Section "Device"
           Identifier  "Device0"
           Driver      "intel"
           Option      "TearFree" "true"
        -  
        -  Option      "UseEDID" "true"
        -  Option      "CustomEDID" "{{ output }}:{{ xorg.primary.edid }}"
        +{% 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"
        +EndSection
        +{% endif %}
        +
         Section "Screen"
           Identifier  "Screen0"
           Device      "Device0"
        -  Monitor     "{{ output }}"
        +  Monitor     "{{ primary_output }}"
           DefaultDepth  24
           SubSection "Display"
             Depth       24
        @@ -2905,8 +2935,26 @@ Section "Screen"
         {% endif %}
           EndSubSection
         EndSection
        +
        +{% 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 %}
         Section "Monitor"
        -  Identifier  "{{ output }}"
        +  Identifier  "{{ primary_output }}"
         {% if xorg.primary.modelines %}
         {% for modeline in xorg.primary.modelines %}
           {{ modeline }}
        @@ -2918,8 +2966,23 @@ Section "Monitor"
         {% endif %}
         EndSection
         
        +{% 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 %}
         {% for connector, data in xrandr["Screen 0:"].iteritems() %}
        -{% if not data.is_connected or connector != xorg.primary.connector %}
        +{% if not data.is_connected or connector != xorg.primary.connector or (xorg.secondary is defined and connector != xorg.secondary.connector) %}
         Section "Monitor"
           Identifier "{{ connector|replace("-","") }}"
           Option "Ignore" "true"
        @@ -2931,7 +2994,7 @@ EndSection
         
      15. -
      16. xorg.conf
        +
      17. xorg.conf
        {{ ansible_managed | comment }}
        @@ -3257,9 +3320,24 @@ EndSection
         
      18. +
      19. snippet to disable screen blanking
        +
        +
        +
        {{ ansible_managed | comment }}
        +Section "ServerFlags"
        +    Option         "NoPM" "true"
        +    Option         "blank time" "0"
        +    Option         "standby time" "0"
        +    Option         "suspend time" "0"
        +    Option         "off time" "0"
        +EndSection
        +
        +
        +
        +
    6. -
    7. vdr
      +
    8. vdr

      Set environment variables for system locale and user session on startup @@ -3275,12 +3353,12 @@ Set environment variables for system locale and user session on startup

    -
    -

    7.11.5 files

    +
    +

    7.11.5 files

      -
    1. initramfs EDID hook
      +
    2. initramfs EDID hook
      #!/bin/bash
      @@ -3305,16 +3383,16 @@ exit 0
       
    -
    -

    7.12 yavdr-desktop

    +
    +

    7.12 yavdr-desktop

    -
    -

    7.12.1 Tasks

    +
    +

    7.12.1 Tasks

      -
    1. main.yml
      +
    2. main.yml
      ---
      @@ -3481,16 +3559,16 @@ exit 0
       
    -
    -

    7.12.2 Templates

    +
    +

    7.12.2 Templates

      -
    1. xorg configuration
      +
    2. xorg configuration
        -
      1. .Xresources
        +
      2. .Xresources
        xterm*background: Black
        @@ -3513,7 +3591,7 @@ XTerm.vt100.font: 7x13
         
      3. -
      4. .xinitrc
        +
      5. .xinitrc
        #!/bin/bash
        @@ -3525,11 +3603,11 @@ XTerm.vt100.font: 7x13
         
    3. -
    4. openbox
      +
    5. openbox
        -
      1. autostart
        +
      2. autostart
        # forward environment variables to an environment file and the systemd user session
        @@ -3565,7 +3643,7 @@ systemctl --user isolate yavdr-desktop.target
         
      3. -
      4. rc.xml
        +
      5. rc.xml
        <?xml version="1.0" encoding="UTF-8"?>
        @@ -4412,7 +4490,7 @@ systemctl --user isolate yavdr-desktop.target
         
      6. -
      7. rc2.xml
        +
      8. rc2.xml
        <?xml version="1.0" encoding="UTF-8"?>
        @@ -5241,11 +5319,11 @@ systemctl --user isolate yavdr-desktop.target
         
    6. -
    7. Systemd User Session
      +
    8. Systemd User Session
        -
      1. yavdr-desktop.target
        +
      2. yavdr-desktop.target
        [Unit]
        @@ -5258,7 +5336,7 @@ systemctl --user isolate yavdr-desktop.target
         
      3. -
      4. detect-second-display
        +
      5. detect-second-display
        #!/bin/bash
        @@ -5287,7 +5365,7 @@ systemctl --user isolate yavdr-desktop.target
         
      6. -
      7. switch-displays
        +
      8. switch-displays

        This script exchanges the primary and secondary screen. It needs access to the systemd user session. @@ -5306,7 +5384,7 @@ frontend-dbus-send start

  • -
  • openbox-second.service
    +
  • openbox-second.service
    [Unit]
    @@ -5328,7 +5406,7 @@ frontend-dbus-send start
     
  • -
  • osd2web.service
    +
  • osd2web.service
    [Unit]
    @@ -5351,7 +5429,7 @@ frontend-dbus-send start
     
  • -
  • tmux.service
    +
  • tmux.service
    [Unit]
    @@ -5370,7 +5448,7 @@ frontend-dbus-send start
     
  • -
  • wm-exit.service
    +
  • wm-exit.service
    [Unit]
    @@ -5389,7 +5467,7 @@ frontend-dbus-send start
     
  • -
  • irexec
    +
  • irexec

    irexec.service starts irexec for the user session @@ -5422,12 +5500,12 @@ end

  • -
    -

    7.13 samba-install

    +
    +

    7.13 samba-install

    -
    -

    7.13.1 tasks

    +
    +

    7.13.1 tasks

    ---
    @@ -5448,12 +5526,12 @@ end
     
    -
    -

    7.14 samba-config

    +
    +

    7.14 samba-config

    -
    -

    7.14.1 tasks

    +
    +

    7.14.1 tasks

    ---
    @@ -5478,16 +5556,16 @@ end
     
    -
    -

    7.14.2 templates

    +
    +

    7.14.2 templates

      -
    1. smb.conf
      +
    2. smb.conf
        -
      1. global settings
        +
      2. global settings
        {{ ansible_managed | comment }}
        @@ -5561,7 +5639,8 @@ end
         
         # This option controls how unsuccessful authentication attempts are mapped 
         # to anonymous connections
        -   map to guest = bad user
        +   map to guest = bad password
        +   guest account = nobody
         
         {% if samba.windows_compatible %}
         # disable unix extensions and enable following symlinks
        @@ -5573,7 +5652,7 @@ end
         
      3. -
      4. media directories
        +
      5. media directories
        {% for name, path in media_dirs.iteritems() %}
        @@ -5595,7 +5674,7 @@ end
         
      6. -
      7. include custom samba exports
        +
      8. include custom samba exports
        include = /etc/samba/smb.conf.custom
        @@ -5608,15 +5687,15 @@ end
         
    -
    -

    7.15 STARTED autoinstall-drivers

    +
    +

    7.15 STARTED autoinstall-drivers

    It would be nice to be able to detect if it is suitable to install those drivers:

    -
    -

    7.15.1 TODO sundtek for Sundtek devices (local or network connection)

    +
    +

    7.15.1 TODO sundtek for Sundtek devices (local or network connection)

    Vendor-IDs: @@ -5627,7 +5706,7 @@ Vendor-IDs:

      -
    1. planned packages
      +
    2. planned packages
      • yavdr-hardware-sundtek
      • @@ -5638,8 +5717,8 @@ Vendor-IDs:
    -
    -

    7.15.2 TODO drivers for TT S2-6400 FF

    +
    +

    7.15.2 TODO drivers for TT S2-6400 FF

    https://github.com/s-moch/linux-saa716x - kann man den relevanten Teil als dkms-Paket bauen? @@ -5647,15 +5726,15 @@ Vendor-IDs:

    -
    -

    7.16 autoinstall-ubuntu-drivers

    +
    +

    7.16 autoinstall-ubuntu-drivers

    The tool ubuntu-drivers is used to install the matching driver version for nvidia graphics cards, virtualbox guest additions and Intel and AMD microcode updates.

    -
    -

    7.16.1 tasks

    +
    +

    7.16.1 tasks

    ---
    @@ -5678,8 +5757,8 @@ The tool ubuntu-drivers is used to install the matching driver version for nvidi
     
    -
    -

    7.17 autoinstall-virtualbox-guest

    +
    +

    7.17 autoinstall-virtualbox-guest

    This role installs the guest additions for virtualbox guests on Ubuntu 18.04 @@ -5728,12 +5807,12 @@ This role installs the guest additions for virtualbox guests on Ubuntu 18.04

    -
    -

    7.18 autoinstall-atric-usb

    +
    +

    7.18 autoinstall-atric-usb

    -
    -

    7.18.1 dependencies

    +
    +

    7.18.1 dependencies

    ---
    @@ -5745,8 +5824,8 @@ This role installs the guest additions for virtualbox guests on Ubuntu 18.04
     
    -
    -

    7.18.2 tasks

    +
    +

    7.18.2 tasks

    ---
    @@ -5788,8 +5867,8 @@ This role installs the guest additions for virtualbox guests on Ubuntu 18.04
     
    -
    -

    7.18.3 templates

    +
    +

    7.18.3 templates

    {{ ansible_managed | comment }}
    @@ -5818,12 +5897,12 @@ This role installs the guest additions for virtualbox guests on Ubuntu 18.04
     
    -
    -

    7.19 autoinstall-yausbir

    +
    +

    7.19 autoinstall-yausbir

    -
    -

    7.19.1 dependencies

    +
    +

    7.19.1 dependencies

    ---
    @@ -5834,8 +5913,8 @@ This role installs the guest additions for virtualbox guests on Ubuntu 18.04
     
    -
    -

    7.19.2 tasks

    +
    +

    7.19.2 tasks

    ---
    @@ -5877,8 +5956,8 @@ This role installs the guest additions for virtualbox guests on Ubuntu 18.04
     
    -
    -

    7.19.3 templates

    +
    +

    7.19.3 templates

    {{ ansible_managed | comment }}
    @@ -5906,15 +5985,15 @@ This role installs the guest additions for virtualbox guests on Ubuntu 18.04
     
    -
    -

    7.20 autoinstall-satip

    +
    +

    7.20 autoinstall-satip

    If a Sat>IP Server responds to a discovery request, the package vdr-plugin-satip is installed.

    -
    -

    7.20.1 tasks

    +
    +

    7.20.1 tasks

    ---
    @@ -5938,12 +6017,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.21 autoinstall-targavfd

    +
    +

    7.21 autoinstall-targavfd

    -
    -

    7.21.1 tasks

    +
    +

    7.21.1 tasks

    ---
    @@ -5959,12 +6038,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.22 autoinstall-imonlcd

    +
    +

    7.22 autoinstall-imonlcd

    -
    -

    7.22.1 tasks

    +
    +

    7.22.1 tasks

    ---
    @@ -5980,12 +6059,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.23 autoinstall-libcecdaemon

    +
    +

    7.23 autoinstall-libcecdaemon

    -
    -

    7.23.1 tasks

    +
    +

    7.23.1 tasks

    ---
    @@ -6001,12 +6080,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.24 autoinstall-pvr350

    +
    +

    7.24 autoinstall-pvr350

    -
    -

    7.24.1 tasks

    +
    +

    7.24.1 tasks

    ---
    @@ -6022,8 +6101,8 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.25 autoinstall-hauppauge-pvr

    +
    +

    7.25 autoinstall-hauppauge-pvr

    ---
    @@ -6038,12 +6117,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.26 autoinstall-firmware

    +
    +

    7.26 autoinstall-firmware

    -
    -

    7.26.1 dependencies

    +
    +

    7.26.1 dependencies

    ---
    @@ -6054,8 +6133,8 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.26.2 tasks

    +
    +

    7.26.2 tasks

    ---
    @@ -6096,12 +6175,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.27 autoinstall-dvbsky-firmware

    +
    +

    7.27 autoinstall-dvbsky-firmware

    -
    -

    7.27.1 dependencies

    +
    +

    7.27.1 dependencies

    ---
    @@ -6112,8 +6191,8 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.27.2 defaults

    +
    +

    7.27.2 defaults

    ---
    @@ -6123,8 +6202,8 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.27.3 tasks

    +
    +

    7.27.3 tasks

    ---
    @@ -6174,15 +6253,15 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.28 TODO autoinstall-dvbhddevice

    +
    +

    7.28 TODO autoinstall-dvbhddevice

    How to get a driver for the TT-6400 FF card? Needed firmware files are in the yavdr-firmware package.

    -
    -

    7.28.1 dependencies

    +
    +

    7.28.1 dependencies

    ---
    @@ -6193,8 +6272,8 @@ How to get a driver for the TT-6400 FF card? Needed firmware files are in the 
     
    -
    -

    7.28.2 tasks

    +
    +

    7.28.2 tasks

    ---
    @@ -6212,12 +6291,12 @@ How to get a driver for the TT-6400 FF card? Needed firmware files are in the 
     
    -
    -

    7.29 TODO autoinstall-dvbsddevice

    +
    +

    7.29 TODO autoinstall-dvbsddevice

    -
    -

    7.29.1 dependencies

    +
    +

    7.29.1 dependencies

    ---
    @@ -6228,8 +6307,8 @@ How to get a driver for the TT-6400 FF card? Needed firmware files are in the 
     
    -
    -

    7.29.2 tasks

    +
    +

    7.29.2 tasks

    ---
    @@ -6249,12 +6328,12 @@ How to get a driver for the TT-6400 FF card? Needed firmware files are in the 
     
    -
    -

    7.30 autoinstall-hardware-irmp

    +
    +

    7.30 autoinstall-hardware-irmp

    -
    -

    7.30.1 dependencies

    +
    +

    7.30.1 dependencies

    ---
    @@ -6265,8 +6344,8 @@ How to get a driver for the TT-6400 FF card? Needed firmware files are in the 
     
    -
    -

    7.30.2 tasks

    +
    +

    7.30.2 tasks

    ---
    @@ -6282,19 +6361,19 @@ How to get a driver for the TT-6400 FF card? Needed firmware files are in the 
     
    -
    -

    7.31 Serial IR Receivers

    +
    +

    7.31 Serial IR Receivers

    This role preconfigures the system for serial „homebrew“ receivers. Newer kernel versions provide serial_ir which acts as a rc-core driver, so we don’t need lircd - eventlircd can use the device directly.

    -As configured in the role yavdr-remote (/etc/rc_maps.cfg) a keytable for a RC-6 MCE remote is loaded by default. You can choose a different keymap which may also use another ir-protocol. +As configured in the role yavdr-remote (/etc/rc_maps.cfg) a keytable for a RC-6 MCE remote is loaded by default. You can choose a different keymap which may also use another ir-protocol.

    -
    -

    7.31.1 defaults

    +
    +

    7.31.1 defaults

    --- 
    @@ -6305,8 +6384,8 @@ As configured in the role yavdr-remote (/etc/rc_maps.cfg
     
    -
    -

    7.31.2 tasks

    +
    +

    7.31.2 tasks

    -
    -

    7.31.3 templates

    +
    +

    7.31.3 templates

      -
    1. load serial_ir on startup
      +
    2. load serial_ir on startup
      {{ ansible_managed | comment }}
      @@ -6349,7 +6428,7 @@ serial_ir
       
    3. -
    4. serial_ir module options
      +
    5. serial_ir module options
      {{ ansible_managed | comment }}
      @@ -6368,7 +6447,7 @@ install serial_ir setserial /dev/{{setserial options
      +
    6. setserial options
      {{ ansible_managed | comment }}
      @@ -6387,21 +6466,21 @@ install serial_ir setserial /dev/{{
      -

      7.32 kodi

      +
      +

      7.32 kodi

      -
      -

      7.32.1 tasks

      +
      +

      7.32.1 tasks

        -
      1. Install KODI
        +
      2. Install KODI
          -
        • main.yml
          -
          +
        • main.yml
          +
          - import_tasks: install-kodi.yml
             tags:
          @@ -6417,7 +6496,7 @@ install serial_ir setserial /dev/{{install-kodi.yml
          +
        • install-kodi.yml
          ---
          @@ -6427,6 +6506,7 @@ install serial_ir setserial /dev/{{name:
                 - kodi
                 - kodi-pvr-vdr-vnsi
          +      - python3-lxml
               state: present
               install_recommends: no
           
          @@ -6448,7 +6528,7 @@ install serial_ir setserial /dev/{{configure-kodi.yml
          +
        • configure-kodi.yml
          - name: create kodi.service for the user session
          @@ -6488,7 +6568,12 @@ install serial_ir setserial /dev/{{group: '{{ vdr.group }}'    
                 mode: "0664"
                 force: no
          -# TODO: Add configuration files
          +
          +- name: expand template for set-kodi-display
          +  template:
          +    src: 'templates/set-kodi-display.j2'
          +    dest: '/usr/bin/set-kodi-display'
          +    mode: "0755"
           
          @@ -6497,12 +6582,12 @@ install serial_ir setserial /dev/{{ -

          7.32.2 templates

          +
          +

          7.32.2 templates

            -
          1. kodi.service
            +
          2. kodi.service

            This systemd unit for the user session starts (and stops) kodi. @@ -6524,17 +6609,144 @@ This systemd unit for the user session starts (and stops) kodi.

        • +
        • set-kodi-diplay
          +
          +

          +This is a version-dependent script to force KODI to use the display set by the environment variable DISPLAY. The following Version is intended for KODI 18. +

          +
          +
          #!/usr/bin/env python3
          +"""
          +{{ ansible_managed }}
          +
          +This Script changes the monitor in KODI's guisettings.xml to the wanted output
          +according to the DISPLAY environment variable. It works with KODI 18 (not KODI 17!).
          +
          +In order to change the display we need to modify the settings/videoscreen nodes.
          +
          +Basic algorithm:
          +    - get the current videoscreen.monitor
          +    - check if it needs to be changed
          +    - create a backup of the videoscreen nodes in /var/lib/vdr/.kodi/.display_cache/{CONNETOR}-videoscreen.xml
          +    - check if there is an existing backup for the new CONNECTOR
          +    - parse the backup of the videoscreen nodes
          +    - replace the videoscreen nodes with the backup data
          +"""
          +
          +import copy
          +import os
          +import sys
          +import subprocess
          +from lxml import etree as ET
          +
          +
          +GUISETTINGS = '/var/lib/vdr/.kodi/userdata/guisettings.xml'
          +CACHE_DIR = '/var/lib/vdr/.kodi/.display_cache'
          +VIDEOSCREEN_TEMPLATE = """<settings version="2">
          +    <setting id="videoscreen.monitor">{}</setting>
          +</settings>"""
          +
          +
          +def create_cache_dir():
          +    try:
          +        os.makedirs(CACHE_DIR, exist_ok=True)
          +    except PermissionError:
          +        sys.exit(f"Error: insufficient permissions to create cachedir {CACHE_DIR}")
          +    except Exception as e:
          +        sys.exit(f"Unexpected Error when trying to create {CACHE_DIR}:", e)
          +
          +
          +
          +def get_output_name():
          +    """
          +    get display name from xrandr output for given DISPLAY environment variable
          +    """
          +    try:
          +        xrandr_output = [
          +            l for l in subprocess.check_output(
          +                ["xrandr"],
          +                env={"DISPLAY": os.environ["DISPLAY"]}
          +            ).decode("utf-8").splitlines()
          +        ]
          +        return next(l.split()[0] for l in xrandr_output if " connected " in l)
          +    except Exception as e:
          +        sys.exit("could not determine output name", e)
          +
          +
          +def parse_template(template_path, template, output=""):
          +    """read videoscreen settings from backup or create a stub file"""
          +    try:
          +        xml_tree = ET.parse(template_path)
          +    except OSError:
          +        print(f"{template_path} not found, creating stub file", file=sys.stderr)
          +        xml_template = ET.fromstring(template.format(output))
          +        xml_tree = ET.ElementTree(xml_template)
          +    finally:
          +        xml_tree.write(template_path)
          +    return xml_tree
          +
          +
          +def main(output):
          +    guisettings = parse_template(GUISETTINGS, VIDEOSCREEN_TEMPLATE, "Default")
          +
          +    # parse guisettings Etree for display name an backup videoscreen data
          +    root = guisettings.getroot()
          +    old_output = root.find("./setting[@id='videoscreen.monitor']").text
          +    if old_output == output:
          +        print("no changes necessary, exiting", file=sys.stderr)
          +        sys.exit()
          +
          +    # create a minimal guisettings etree
          +    xml_path = os.path.join(CACHE_DIR, f'{old_output}-videoscreen.xml')
          +    base_tree = ET.fromstring('<settings version="2"></settings>')
          +    xml_tree = ET.ElementTree(base_tree)
          +    backup_root = xml_tree.getroot()
          +
          +    # copy videoscreen elements to backup etree
          +    videoscreen_elements = root.xpath(
          +            "./setting[starts-with(@id, 'videoscreen.')]")
          +    for element in videoscreen_elements:
          +        backup_root.append(copy.deepcopy(element))
          +        element.getparent().remove(element)
          +    xml_tree.write(xml_path)
          +    print(f"written backup for {old_output} to {xml_path}", file=sys.stderr)
          +
          +    # change videoscreen node to content of backup file
          +    xml_path = os.path.join(CACHE_DIR, f'{output}-videoscreen.xml')
          +    videodir_xml = parse_template(xml_path, VIDEOSCREEN_TEMPLATE, output)
          +    videodir_root = videodir_xml.getroot()
          +    videoscreen = videodir_root.find("./setting[@id='videoscreen.monitor']")
          +    # copy videoscreen.* elements from Backup
          +    videoscreen_elements = videodir_root.xpath(
          +            "./setting[starts-with(@id, 'videoscreen.')]")
          +    for element in videoscreen_elements:
          +        new_element = copy.deepcopy(element)
          +        root.append(new_element)
          +    guisettings.write(GUISETTINGS)
          +
          +
          +if __name__ == '__main__':
          +    create_cache_dir()
          +    output = get_output_name()
          +    try:
          +        main(output)
          +    except Exception as e:
          +        print("Could not change videoscreen.* settings:", str(e), file=sys.stderr)
          +
          +
          +
          +
      -
      -

      7.32.3 files

      +
      +

      7.32.3 files

      Those configuration files provide a preconfiguration for kodi which overrides the system wide configuration

        -
      1. Lircmap.xml
        +
      2. Lircmap.xml

        This file allows to map keys sent by remotes via eventlircd (which uses the name devinput) to kodi key names. @@ -6605,14 +6817,14 @@ This file allows to map keys sent by remotes via eventlircd (which uses the name

    7. -
    8. keymaps
      +
    9. keymaps

      This file maps the keys defined in Lircmap.xml to actions within kodi.

        -
      1. remote.xml
        +
      2. remote.xml
        <?xml version="1.0" encoding="UTF-8"?>
        @@ -7164,17 +7376,17 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
         
    10. -
      -

      7.33 dvd

      +
      +

      7.33 dvd

      -
      -

      7.33.1 tasks

      +
      +

      7.33.1 tasks

        -
      • install libdvd-pkg, allow programs to eject optical media
        -
        +
      • install libdvd-pkg, allow programs to eject optical media
        +
        ---
         # file: roles/dvd/tasks/main.yml
        @@ -7213,17 +7425,17 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
         
      -
      -

      7.34 install-sundtek

      +
      +

      7.34 install-sundtek

      -
      -

      7.34.1 variables

      +
      +

      7.34.1 variables

      -
      -

      7.34.2 tasks

      +
      +

      7.34.2 tasks

      ---
      @@ -7272,12 +7484,12 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
       
      -
      -

      7.34.3 templates

      +
      +

      7.34.3 templates

        -
      1. Overrides for systemd unit sundtek.service
        +
      2. Overrides for systemd unit sundtek.service
        • [ ] wait for network
        • @@ -7285,7 +7497,7 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
      3. -
      4. /etc/systemd/system/sundtek.service
        +
      5. /etc/systemd/system/sundtek.service
        {{ ansible_managed | comment }}
        @@ -7298,6 +7510,7 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
         Type=forking
         ExecStart=/opt/bin/mediasrv -d --pluginpath=/opt/bin --wait-for-devices
         ExecStop=/opt/bin/mediaclient --shutdown
        +Restart=on-failure
         [Install]
         WantedBy=multi-user.target
         
        @@ -7305,7 +7518,7 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
      6. -
      7. /etc/sundtek.conf
        +
      8. /etc/sundtek.conf
        # ----- GLOBAL SECTION -----
        @@ -7413,8 +7626,8 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
         
      -
      -

      7.35 template-test

      +
      +

      7.35 template-test

      ---
      @@ -7655,12 +7868,12 @@ EndSection
       
      -
      -

      7.36 wakeup

      +
      +

      7.36 wakeup

      -
      -

      7.36.1 defaults

      +
      +

      7.36.1 defaults

      ---
      @@ -7670,8 +7883,8 @@ EndSection
       
      -
      -

      7.36.2 tasks

      +
      +

      7.36.2 tasks

      ---
      @@ -7692,8 +7905,8 @@ EndSection
       
      -
      -

      7.36.3 templates

      +
      +

      7.36.3 templates

      {{ ansible_managed | comment }}
      @@ -7719,12 +7932,12 @@ ACPI_START_AHEAD=5
       
      -
      -

      7.37 grub-config

      +
      +

      7.37 grub-config

      -
      -

      7.37.1 default variables

      +
      +

      7.37.1 default variables

      system:
      @@ -7736,8 +7949,8 @@ ACPI_START_AHEAD=5
       
      -
      -

      7.37.2 tasks

      +
      +

      7.37.2 tasks

      ---
      @@ -7762,8 +7975,8 @@ ACPI_START_AHEAD=5
       
      -
      -

      7.37.3 templates

      +
      +

      7.37.3 templates

      #!/bin/sh
      @@ -7786,8 +7999,8 @@ fi
       
      -
      -

      7.37.4 handlers

      +
      +

      7.37.4 handlers

      ---
      @@ -7810,15 +8023,15 @@ fi
       
      -
      -

      8 Modules

      +
      +

      8 Modules

      This section contains custom modules for the yaVDR Playbooks. They are used to collect facts about the system and configure applications and daemons.

      -
      -

      8.1 hardware_facts.py

      +
      +

      8.1 hardware_facts.py

      # This Module collects the vendor- and device ids for USB- and PCI(e)-devices and currently loaded kernel modules.
      @@ -7996,8 +8209,8 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
       
      -
      -

      8.2 pci_facts.py

      +
      +

      8.2 pci_facts.py

      @@ -8073,8 +8286,8 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
       
      -
      -

      8.3 satip_facts.py

      +
      +

      8.3 satip_facts.py

      DOCUMENTATION = '''
      @@ -8198,8 +8411,8 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
       
      -
      -

      8.4 xrandr_facts.py

      +
      +

      8.4 xrandr_facts.py

      • [ ] support multiple screens (-d :0.0 .. :0.n)
      • @@ -8463,33 +8676,39 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c raise ValueError -Connector = namedtuple('Connector', "name xrandr_edid") - - -def find_drm_connectors(primary): +def find_drm_connectors(connections): """ - takes a namedtuple Connector as the only argument. - - returns a dict with the following schema: + returns a dict with the following schema (secondary may be empty): { 'primary': { 'edid': 'edid.HDMI-1.bin', 'drm_connector': 'HDMI-A-1', 'xrandr_connector': 'HDMI-1', }, + 'secondary': { + 'edid': 'edid.eDP-1.bin', + 'drm_connector': 'eDP-1', + 'xrandr_connector': 'eDP-1', + } 'ignored_outputs': ['HDMI-A-2', 'DP-1'] } """ STATUS_GLOB = '/sys/class/drm/card0*/status' CONNECTOR_RE = re.compile('card0-(?P<connector>[^/]+)/status') - try: - with open(primary.xrandr_edid, 'rb') as f: - xrandr_edid_bytes = f.read() - except IOError: - xrandr_edid_bytes = b'' + def read_edid_bytes(edid_file): + edid_bytes = b'' + try: + with open(edid_file, 'rb') as f: + edid_bytes = f.read() + except IOError: + pass + return edid_bytes - drm = {'primary': {}, 'ignored_outputs': []} + xrandr_edid_bytes = read_edid_bytes(connections.get('primary', {}).get('edid', "")) + secondary_xrandr_edid_bytes = read_edid_bytes(connections.get('secondary', {}).get('edid', '')) + + drm = {'primary': {}, 'secondary': {}, 'ignored_outputs': []} for status_p in glob(STATUS_GLOB): match = re.search(CONNECTOR_RE, status_p) if match: @@ -8503,19 +8722,22 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c except IOError: continue - if connected and xrandr_edid_bytes: - drm_edid = os.path.join(os.path.dirname(status_p), 'edid') - try: - with open(drm_edid, 'rb') as f: - is_primary = f.read() == xrandr_edid_bytes - except IOError: - continue - else: - if is_primary: + if connected: + edid = read_edid_bytes(os.path.join( + os.path.dirname(status_p), 'edid')) + if edid: + if edid == xrandr_edid_bytes: drm['primary'] = { - 'edid': os.path.basename(primary.xrandr_edid), + 'edid': os.path.basename(connections['primary'].get('edid', "")), 'drm_connector': drm_connector, - 'xrandr_connector': primary.name, + 'xrandr_connector': connections['primary'].get('connector',''), + } + continue + if secondary_xrandr_edid_bytes: + drm['secondary'] = { + 'edid': os.path.basename(connections.get('secondary').get('edid', '')), + 'drm_connector': drm_connector, + 'xrandr_connector': connections['secondary'].get('connector',''), } continue drm['ignored_outputs'].append(drm_connector) @@ -8558,22 +8780,24 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c result[name]['bus_id'] = bus_id connector_0, resolution_0, refreshrate_0 = max(modes, key=sort_mode)[:3] - vendor_0, model_0, modelines_0 = parse_edid_data('/etc/X11/edid.{}.bin'.format(connector_0)) + connector_0_edid = '/etc/X11/edid.{}.bin'.format(connector_0) + vendor_0, model_0, modelines_0 = parse_edid_data(connector_0_edid) create_entry(result, 'primary', connector_0, resolution_0, refreshrate_0, vendor_0, model_0, modelines_0) - if write_edids: - drm = find_drm_connectors(Connector(connector_0, - '/etc/X11/edid.{}.bin'.format(connector_0))) - # check if additional monitors exist other_modes = [mode for mode in modes if mode[0] != connector_0] if other_modes: connector_1, resolution_1, refreshrate_1 = max(other_modes, key=sort_mode)[:3] - vendor_1, model_1, modelines_1 = parse_edid_data('/etc/X11/edid.{}.bin'.format(connector_1)) + connector_1_edid = '/etc/X11/edid.{}.bin'.format(connector_1) + vendor_1, model_1, modelines_1 = parse_edid_data(connector_1_edid) create_entry(result, 'secondary', connector_1, resolution_1, refreshrate_1, vendor_1, model_1, modelines_1) + if write_edids: + drm = find_drm_connectors(result) + + module.exit_json(changed=True if write_edids else False, ansible_facts={'xrandr': data, 'xorg': result, 'drm': drm}) @@ -8593,8 +8817,8 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
      -
      -

      9 Handlers

      +
      +

      9 Handlers

      - name: Reconfigure unattended upgrades with dpkg
      @@ -8687,7 +8911,7 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
       

      Autor: Alexander Grothe <seahawk1986@gmx.de>

      -

      Created: 2019-01-19 Sa 12:24

      +

      Created: 2019-02-21 Do 23:33

      Validate

      diff --git a/Manual.org b/Manual.org index 9457218..93478c6 100644 --- a/Manual.org +++ b/Manual.org @@ -35,6 +35,26 @@ #+LATEX: \defaultfontfeatures{Ligatures=TeX} #+LATEX_HEADER: \usepackage{parskip} # #+LATEX_HEADER_EXTRA: +#+BEGIN_SRC latex +\newcommand*\justify{% + \fontdimen2\font=0.4em% interword space + \fontdimen3\font=0.2em% interword stretch + \fontdimen4\font=0.1em% interword shrink + \fontdimen7\font=0.1em% extra space + \hyphenchar\font=`\-% allowing hyphenation +} + +\renewcommand{\texttt}[1]{% + \begingroup + \ttfamily + \begingroup\lccode`~=`/\lowercase{\endgroup\def~}{/\discretionary{}{}{}}% + \begingroup\lccode`~=`[\lowercase{\endgroup\def~}{[\discretionary{}{}{}}% + \begingroup\lccode`~=`.\lowercase{\endgroup\def~}{.\discretionary{}{}{}}% + \catcode`/=\active\catcode`[=\active\catcode`.=\active + \justify\scantokens{#1\noexpand}% + \endgroup +} +#+END_SRC #+EXCLUDE_TAGS: noexport :END: @@ -1832,7 +1852,7 @@ ctl.!default { The X-Server is started by using the two systemd units ~xlogin@.service~ and ~x@.service~ provided by the package *xlogin*. The former is enabled (and started) for the vdr user - which results (using the default settings for the user *vdr* with the uid *666*) in the activation of ~xlogin@vdr.service~ when reaching the graphical.target. To simplify starting and stopping the X-server and the desktop session a ~yavdr-xorg.service~ is provided by the package ~yavdr-xorg~, which depends on the two units mentioned before. ~x@vt7.service~ is started automatically as a dependency of ~xlogin@vdr.service~ and starts the X-server. ~xlogin@vdr.service~ also starts a systemd user session using ~user@666.service~. -In order to use the keyboard layout configured during installation for the X-Server the script ~write-x11-keyboard-config~ reads the keyboard configuration from ~/etc/default/keyboard~ when starting ~x@.service~ and writes the file ~/etc/X11/xorg.conf.d/00-keyboard.conf~ (because systemd for Ubuntu (and Debian) has been patched not to create ~/etc/X11/xorg.conf.d/00-keyboard.conf~ according to the ~localectl~ settings). +In order to use the keyboard layout configured during installation for the X-Server we are using a script ~write-x11-keyboard-config,~ which reads the keyboard configuration from ~/etc/default/keyboard~ when starting ~x@.service~ and writes the file ~/etc/X11/xorg.conf.d/00-keyboard.conf~ (because systemd for Ubuntu (and Debian) has been patched not to automatically create the configuration file ~/etc/X11/xorg.conf.d/00-keyboard.conf~ according to the ~localectl~ settings). To prevent stopping the X-server when vdr is running, additional dependencies are set up - see the drop-in rules created in ~/etc/systemd/system/vdr.service.d/~. @@ -2336,6 +2356,12 @@ preferred_refreshrates: - '-w alsa-driver-broken' # - '-a pulse' # do we need this with our existing asound.conf? +- name: vdr-config | use vaapi for softhddevice if we got an intel IGP + lineinfile: + path: /etc/vdr/conf.avail/softhddevice.conf + line: '-v va-pi' + state: present if intel_detected else absent + - name: add a login shell for the user vdr user: name: '{{ vdr.user }}' @@ -2704,21 +2730,41 @@ EndSection ***** intel graphics xorg.conf snippet #+BEGIN_SRC jinja2 :tangle roles/yavdr-xorg/templates/20-intel.conf.j2 {{ ansible_managed | comment }} - -{% set output = xorg.primary.connector|replace("-", "") %} +{% set primary_output = xorg.primary.connector|replace("-", "") %} +{% if xorg.secondary is defined %} + {% set secondary_output = xorg.secondary.connector|replace("-", "") %} +{% endif %} Section "Device" Identifier "Device0" Driver "intel" Option "TearFree" "true" - - Option "UseEDID" "true" - Option "CustomEDID" "{{ output }}:{{ xorg.primary.edid }}" +{% 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" +EndSection +{% endif %} + Section "Screen" Identifier "Screen0" Device "Device0" - Monitor "{{ output }}" + Monitor "{{ primary_output }}" DefaultDepth 24 SubSection "Display" Depth 24 @@ -2729,8 +2775,26 @@ Section "Screen" {% endif %} EndSubSection EndSection + +{% 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 %} Section "Monitor" - Identifier "{{ output }}" + Identifier "{{ primary_output }}" {% if xorg.primary.modelines %} {% for modeline in xorg.primary.modelines %} {{ modeline }} @@ -2742,8 +2806,23 @@ Section "Monitor" {% endif %} EndSection +{% 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 %} {% for connector, data in xrandr["Screen 0:"].iteritems() %} -{% if not data.is_connected or connector != xorg.primary.connector %} +{% if not data.is_connected or connector != xorg.primary.connector or (xorg.secondary is defined and connector != xorg.secondary.connector) %} Section "Monitor" Identifier "{{ connector|replace("-","") }}" Option "Ignore" "true" diff --git a/library/xrandr_facts.py b/library/xrandr_facts.py index 8d0cb4e..a725f9e 100755 --- a/library/xrandr_facts.py +++ b/library/xrandr_facts.py @@ -255,33 +255,39 @@ def collect_nvidia_data(): raise ValueError -Connector = namedtuple('Connector', "name xrandr_edid") - - -def find_drm_connectors(primary): +def find_drm_connectors(connections): """ - takes a namedtuple Connector as the only argument. - - returns a dict with the following schema: + returns a dict with the following schema (secondary may be empty): { 'primary': { 'edid': 'edid.HDMI-1.bin', 'drm_connector': 'HDMI-A-1', 'xrandr_connector': 'HDMI-1', }, + 'secondary': { + 'edid': 'edid.eDP-1.bin', + 'drm_connector': 'eDP-1', + 'xrandr_connector': 'eDP-1', + } 'ignored_outputs': ['HDMI-A-2', 'DP-1'] } """ STATUS_GLOB = '/sys/class/drm/card0*/status' CONNECTOR_RE = re.compile('card0-(?P[^/]+)/status') - try: - with open(primary.xrandr_edid, 'rb') as f: - xrandr_edid_bytes = f.read() - except IOError: - xrandr_edid_bytes = b'' + def read_edid_bytes(edid_file): + edid_bytes = b'' + try: + with open(edid_file, 'rb') as f: + edid_bytes = f.read() + except IOError: + pass + return edid_bytes - drm = {'primary': {}, 'ignored_outputs': []} + xrandr_edid_bytes = read_edid_bytes(connections.get('primary', {}).get('edid', "")) + secondary_xrandr_edid_bytes = read_edid_bytes(connections.get('secondary', {}).get('edid', '')) + + drm = {'primary': {}, 'secondary': {}, 'ignored_outputs': []} for status_p in glob(STATUS_GLOB): match = re.search(CONNECTOR_RE, status_p) if match: @@ -295,19 +301,22 @@ def find_drm_connectors(primary): except IOError: continue - if connected and xrandr_edid_bytes: - drm_edid = os.path.join(os.path.dirname(status_p), 'edid') - try: - with open(drm_edid, 'rb') as f: - is_primary = f.read() == xrandr_edid_bytes - except IOError: - continue - else: - if is_primary: + if connected: + edid = read_edid_bytes(os.path.join( + os.path.dirname(status_p), 'edid')) + if edid: + if edid == xrandr_edid_bytes: drm['primary'] = { - 'edid': os.path.basename(primary.xrandr_edid), + 'edid': os.path.basename(connections['primary'].get('edid', "")), 'drm_connector': drm_connector, - 'xrandr_connector': primary.name, + 'xrandr_connector': connections['primary'].get('connector',''), + } + continue + if secondary_xrandr_edid_bytes: + drm['secondary'] = { + 'edid': os.path.basename(connections.get('secondary').get('edid', '')), + 'drm_connector': drm_connector, + 'xrandr_connector': connections['secondary'].get('connector',''), } continue drm['ignored_outputs'].append(drm_connector) @@ -350,22 +359,24 @@ def output_data(data, write_edids=True): result[name]['bus_id'] = bus_id connector_0, resolution_0, refreshrate_0 = max(modes, key=sort_mode)[:3] - vendor_0, model_0, modelines_0 = parse_edid_data('/etc/X11/edid.{}.bin'.format(connector_0)) + connector_0_edid = '/etc/X11/edid.{}.bin'.format(connector_0) + vendor_0, model_0, modelines_0 = parse_edid_data(connector_0_edid) create_entry(result, 'primary', connector_0, resolution_0, refreshrate_0, vendor_0, model_0, modelines_0) - if write_edids: - drm = find_drm_connectors(Connector(connector_0, - '/etc/X11/edid.{}.bin'.format(connector_0))) - # check if additional monitors exist other_modes = [mode for mode in modes if mode[0] != connector_0] if other_modes: connector_1, resolution_1, refreshrate_1 = max(other_modes, key=sort_mode)[:3] - vendor_1, model_1, modelines_1 = parse_edid_data('/etc/X11/edid.{}.bin'.format(connector_1)) + connector_1_edid = '/etc/X11/edid.{}.bin'.format(connector_1) + vendor_1, model_1, modelines_1 = parse_edid_data(connector_1_edid) create_entry(result, 'secondary', connector_1, resolution_1, refreshrate_1, vendor_1, model_1, modelines_1) + if write_edids: + drm = find_drm_connectors(result) + + module.exit_json(changed=True if write_edids else False, ansible_facts={'xrandr': data, 'xorg': result, 'drm': drm}) diff --git a/roles/yavdr-xorg/tasks/setup-xorg.yml b/roles/yavdr-xorg/tasks/setup-xorg.yml index 809c439..8697590 100644 --- a/roles/yavdr-xorg/tasks/setup-xorg.yml +++ b/roles/yavdr-xorg/tasks/setup-xorg.yml @@ -44,6 +44,12 @@ - '-w alsa-driver-broken' # - '-a pulse' # do we need this with our existing asound.conf? +- name: vdr-config | use vaapi for softhddevice if we got an intel IGP + lineinfile: + path: /etc/vdr/conf.avail/softhddevice.conf + line: '-v va-pi' + state: present if intel_detected else absent + - name: add a login shell for the user vdr user: name: '{{ vdr.user }}' diff --git a/roles/yavdr-xorg/templates/20-intel.conf.j2 b/roles/yavdr-xorg/templates/20-intel.conf.j2 index 50b0a8e..b425a2d 100644 --- a/roles/yavdr-xorg/templates/20-intel.conf.j2 +++ b/roles/yavdr-xorg/templates/20-intel.conf.j2 @@ -1,19 +1,39 @@ {{ ansible_managed | comment }} - -{% set output = xorg.primary.connector|replace("-", "") %} +{% set primary_output = xorg.primary.connector|replace("-", "") %} +{% if xorg.secondary is defined %} + {% set secondary_output = xorg.secondary.connector|replace("-", "") %} +{% endif %} Section "Device" Identifier "Device0" Driver "intel" Option "TearFree" "true" - - Option "UseEDID" "true" - Option "CustomEDID" "{{ output }}:{{ xorg.primary.edid }}" +{% 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" +EndSection +{% endif %} + Section "Screen" Identifier "Screen0" Device "Device0" - Monitor "{{ output }}" + Monitor "{{ primary_output }}" DefaultDepth 24 SubSection "Display" Depth 24 @@ -24,8 +44,26 @@ Section "Screen" {% endif %} EndSubSection EndSection + +{% 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 %} Section "Monitor" - Identifier "{{ output }}" + Identifier "{{ primary_output }}" {% if xorg.primary.modelines %} {% for modeline in xorg.primary.modelines %} {{ modeline }} @@ -37,8 +75,23 @@ Section "Monitor" {% endif %} EndSection +{% 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 %} {% for connector, data in xrandr["Screen 0:"].iteritems() %} -{% if not data.is_connected or connector != xorg.primary.connector %} +{% if not data.is_connected or connector != xorg.primary.connector or (xorg.secondary is defined and connector != xorg.secondary.connector) %} Section "Monitor" Identifier "{{ connector|replace("-","") }}" Option "Ignore" "true"