2017-07-16 11:05:54 +02:00
|
|
|
---
|
|
|
|
# file: roles/yavdr-xorg/tasks/detect-xorg.yml
|
|
|
|
|
|
|
|
- name: "expand template for x-verbose@.service"
|
|
|
|
template:
|
|
|
|
src: "templates/systemd/system/x-verbose@.service.j2"
|
|
|
|
dest: "/etc/systemd/system/x-verbose@.service"
|
|
|
|
|
|
|
|
- name: "expand template for xorg-verbose.conf"
|
|
|
|
template:
|
|
|
|
src: "templates/xorg-verbose.conf.j2"
|
|
|
|
dest: "/etc/X11/xorg-verbose.conf"
|
|
|
|
|
2017-07-30 14:29:38 +02:00
|
|
|
- name: Stop VDR
|
|
|
|
systemd:
|
|
|
|
name: vdr.service
|
|
|
|
state: stopped
|
|
|
|
enabled: yes
|
|
|
|
notify: ['Start VDR']
|
|
|
|
|
|
|
|
- name: Stop xlogin
|
|
|
|
systemd:
|
2017-07-30 23:28:13 +02:00
|
|
|
name: 'xlogin@{{ vdr.user }}.service'
|
2017-07-30 14:29:38 +02:00
|
|
|
state: stopped
|
|
|
|
|
|
|
|
- name: Stop x
|
|
|
|
systemd:
|
|
|
|
name: x@vt7.service
|
|
|
|
state: stopped
|
|
|
|
|
2017-11-21 11:30:03 +01:00
|
|
|
- name: "wait a little bit before starting x-verbose@vt7.service (needed?)"
|
|
|
|
wait_for:
|
|
|
|
timeout: 3
|
|
|
|
|
2017-07-16 11:05:54 +02:00
|
|
|
- name: "start x-verbose@.service"
|
|
|
|
systemd:
|
|
|
|
name: "x-verbose@vt7.service"
|
|
|
|
state: started
|
|
|
|
enabled: false
|
|
|
|
masked: false
|
|
|
|
daemon_reload: true
|
|
|
|
|
|
|
|
- name: "wait a little bit, so X has some time to start up (needed?)"
|
|
|
|
wait_for:
|
|
|
|
timeout: 3
|
|
|
|
|
|
|
|
- name: "detect xorg configuration"
|
|
|
|
action: xrandr_facts
|
|
|
|
|
|
|
|
- debug:
|
|
|
|
var: xorg.primary
|
|
|
|
|
|
|
|
- debug:
|
|
|
|
var: xorg.secondary
|
|
|
|
when: xorg.secondary is defined
|
|
|
|
|
|
|
|
- name: "stop x-verbose@vt7.service"
|
|
|
|
systemd:
|
|
|
|
name: "x-verbose@vt7.service"
|
|
|
|
state: stopped
|
|
|
|
enabled: false
|
|
|
|
masked: true
|
2017-07-30 14:29:38 +02:00
|
|
|
|
2017-11-21 11:30:03 +01:00
|
|
|
- name: "wait a little bit, so X has some time to shut down (needed?)"
|
|
|
|
wait_for:
|
|
|
|
timeout: 3
|
|
|
|
|
2017-07-30 14:29:38 +02:00
|
|
|
# TODO: expand template for xorg.conf (or snippets)
|
|
|
|
# with respect for the available graphics card driver
|
|
|
|
# nvidia, noveau, intel, radeon
|
2017-11-21 11:30:03 +01:00
|
|
|
|
|
|
|
- name: nvidia related config
|
|
|
|
block:
|
|
|
|
- name: create xorg.conf (for nvidia driver)
|
|
|
|
template:
|
|
|
|
src: templates/xorg.conf.j2
|
|
|
|
dest: /etc/X11/xorg.conf
|
|
|
|
backup: yes
|
|
|
|
when:
|
|
|
|
- nvidia_detected
|
|
|
|
- #+END_SRC
|
|
|
|
|
|
|
|
#+BEGIN_SRC yaml :tangle roles/yavdr-xorg/tasks/desktop-session.yml :mkdirp yes :padline no
|
|
|
|
---
|
|
|
|
# file: roles/yavdr-xorg/tasks/desktop-session.yml
|
|
|
|
|
|
|
|
- name: create folders for user configuration files
|
|
|
|
file:
|
|
|
|
state: directory
|
|
|
|
dest: '{{ item }}'
|
|
|
|
mode: '0775'
|
|
|
|
owner: '{{ vdr.user }}'
|
|
|
|
group: '{{ vdr.group }}'
|
|
|
|
with_items:
|
|
|
|
- '{{ vdr.home }}/.config/systemd/user'
|
|
|
|
- '{{ vdr.home }}/.config/openbox'
|
|
|
|
- '{{ vdr.home }}/.config/pulse'
|
|
|
|
|
|
|
|
- name: expand template for .xinitrc for vdr user
|
|
|
|
template:
|
|
|
|
src: 'templates/.xinitrc.j2'
|
|
|
|
dest: '{{ vdr.home }}/.xinitrc'
|
|
|
|
mode: 0755
|
|
|
|
owner: '{{ vdr.user }}'
|
|
|
|
group: '{{ vdr.group }}'
|
|
|
|
|
|
|
|
- name: expand template for openbox autostart
|
|
|
|
template:
|
|
|
|
src: 'templates/openbox/autostart.j2'
|
|
|
|
dest: '{{ vdr.home }}/.config/openbox/autostart'
|
|
|
|
mode: 0755
|
|
|
|
owner: '{{ vdr.user }}'
|
|
|
|
group: '{{ vdr.group }}'
|
|
|
|
|
|
|
|
- name: expand rc.xml for openbox
|
|
|
|
template:
|
|
|
|
src: 'templates/openbox/rc.xml.j2'
|
|
|
|
dest: '{{ vdr.home }}/.config/openbox/rc.xml'
|
|
|
|
mode: 0644
|
|
|
|
owner: '{{ vdr.user }}'
|
|
|
|
group: '{{ vdr.group }}'
|
|
|
|
|
|
|
|
- name: create yavdr-desktop.target for the user session
|
|
|
|
template:
|
|
|
|
src: 'templates/systemd/user/yavdr-desktop.target.j2'
|
|
|
|
dest: '{{ vdr.home }}/.config/systemd/user/yavdr-desktop.target'
|
|
|
|
mode: 0644
|
|
|
|
owner: '{{ vdr.user }}'
|
|
|
|
group: '{{ vdr.group }}'
|
|
|
|
|
|
|
|
- name: disable pulseaudio autospawning
|
|
|
|
lineinfile:
|
|
|
|
path: '{{ vdr.home }}/.config/pulse/client.conf'
|
|
|
|
line: 'autospawn = no'
|
|
|
|
create: yes
|
|
|
|
state: present
|
|
|
|
owner: '{{ vdr.user }}'
|
|
|
|
group: '{{ vdr.group }}'
|
|
|
|
|
|
|
|
- name: create tmux.service for the session
|
|
|
|
template:
|
|
|
|
src: roles/yavdr-xorg/templates/systemd/user/tmux.service.j2
|
|
|
|
dest: '{{ vdr.home }}/.config/systemd/user/tmux.service'
|
|
|
|
|
|
|
|
- name: create wm-exit.service for the session
|
|
|
|
template:
|
|
|
|
src: roles/yavdr-xorg/templates/systemd/user/wm-exit.service.j2
|
|
|
|
dest: '{{ vdr.home }}/.config/systemd/user/wm-exit.service'
|
|
|
|
|
|
|
|
- name: create detect-second-display.service for the session
|
2017-07-30 14:29:38 +02:00
|
|
|
template:
|
2017-11-21 11:30:03 +01:00
|
|
|
src: templates/systemd/user/detect-second-display.service.j2
|
|
|
|
dest: '{{ vdr.home }}/.config/systemd/user/detect-second-display.service'
|
|
|
|
|
|
|
|
- name: create openbox-second.service for the session
|
|
|
|
template:
|
|
|
|
src: templates/systemd/user/openbox-second.service.j2
|
|
|
|
dest: '{{ vdr.home }}/.config/systemd/user/openbox-second.service'
|
|
|
|
|
|
|
|
- name: create osd2web.service for the session
|
|
|
|
template:
|
|
|
|
src: templates/systemd/user/osd2web.service.j2
|
|
|
|
dest: '{{ vdr.home }}/.config/systemd/user/osd2web.service'
|
|
|
|
|
|
|
|
- name: link /usr/bin/start-desktop to /var/lib/vdr/plugins/desktop/starter
|
|
|
|
file:
|
|
|
|
src: /usr/bin/start-desktop
|
|
|
|
dest: /var/lib/vdr/plugins/desktop/starter
|
|
|
|
state: link
|
|
|
|
|
|
|
|
- name: enable and start xlogin for the vdr user
|
|
|
|
systemd:
|
|
|
|
daemon_reload: yes
|
|
|
|
name: 'xlogin@{{ vdr.user }}'
|
|
|
|
enabled: yes
|
|
|
|
state: started
|