add player setup
This commit is contained in:
parent
f2ee180967
commit
097dcfefc4
2 changed files with 63 additions and 0 deletions
12
parsifal-player.service
Normal file
12
parsifal-player.service
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Parsifal Player
|
||||||
|
After=lightdm.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStartPre=/bin/sh -c 'for i in {1..10}; do xset q && break || sleep 2; done'
|
||||||
|
ExecStart=/usr/bin/mpv --fs --no-osc --loop-file=inf %h/main.mov
|
||||||
|
Restart=always
|
||||||
|
Environment=DISPLAY=:0
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=graphical.target
|
51
setup-player.yml
Normal file
51
setup-player.yml
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
---
|
||||||
|
- hosts: players
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Install mpv, unclutter
|
||||||
|
apt:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: present
|
||||||
|
update_cache: yes
|
||||||
|
loop:
|
||||||
|
- mpv
|
||||||
|
- unclutter
|
||||||
|
|
||||||
|
- name: Ensure systemd user directory exists
|
||||||
|
file:
|
||||||
|
path: "/home/{{ ansible_user }}/.config/systemd/user"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ ansible_user }}"
|
||||||
|
group: "{{ ansible_user }}"
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: Copy all service files
|
||||||
|
copy:
|
||||||
|
src: "{{ item }}"
|
||||||
|
dest: "/home/{{ ansible_user }}/.config/systemd/user/{{ item }}"
|
||||||
|
owner: "{{ ansible_user }}"
|
||||||
|
group: "{{ ansible_user }}"
|
||||||
|
mode: "0644"
|
||||||
|
loop:
|
||||||
|
- parsifal.service
|
||||||
|
- unclutter.service
|
||||||
|
|
||||||
|
- name: Reload systemd user service
|
||||||
|
become: yes
|
||||||
|
become_user: "{{ ansible_user }}"
|
||||||
|
systemd:
|
||||||
|
daemon_reload: yes
|
||||||
|
scope: user
|
||||||
|
|
||||||
|
- name: Enable all services
|
||||||
|
become: yes
|
||||||
|
become_user: "{{ ansible_user }}"
|
||||||
|
systemd:
|
||||||
|
name: "{{ item }}"
|
||||||
|
enabled: yes
|
||||||
|
state: started
|
||||||
|
scope: user
|
||||||
|
loop:
|
||||||
|
- parsifal-player
|
||||||
|
- unclutter
|
Loading…
Reference in a new issue