Compare commits

..

6 commits

Author SHA1 Message Date
48302bf947 hide participant label 2024-09-19 14:52:07 +02:00
13fe7d490d add input disable 2024-09-19 14:51:50 +02:00
85c1491b92 fix install? 2024-09-19 14:39:29 +02:00
097dcfefc4 add player setup 2024-09-19 14:33:04 +02:00
f2ee180967 refactor setup-autocall.yml 2024-09-19 14:24:42 +02:00
0e20540107 add gitignore 2024-09-19 14:06:36 +02:00
7 changed files with 123 additions and 38 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
node_modules

11
disable-input.service Normal file
View file

@ -0,0 +1,11 @@
[Unit]
Description=Disable Keyboard and Mouse Input
After=graphical-session.target
[Service]
Type=oneshot
ExecStartPre=/bin/sleep 60
ExecStart=%h/disable_input.sh
[Install]
WantedBy=default.target

8
disable_input.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
echo "Disabling input devices"
for id in $(xinput --list | grep -Eo 'id=[0-9]+' | cut -d= -f2); do
xinput --disable "$id"
echo "Disabled device ID $id"
done
echo "All devices disabled."

View file

@ -4,7 +4,8 @@
.subject,
.atlaskit-portal-container,
.atlaskit-portal,
#notifications-container {
#notifications-container,
.stage-participant-label {
display: none !important;
}

12
parsifal-player.service Normal file
View 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=default.target

View file

@ -57,48 +57,32 @@
owner: "{{ ansible_user }}"
mode: "0755"
- name: Symlink parsifal.service to systemd user directory
- name: Symlink all service files
file:
src: "/home/{{ ansible_user }}/parsifal/parsifal.service"
dest: "/home/{{ ansible_user }}/.config/systemd/user/parsifal.service"
src: "/home/{{ ansible_user }}/parsifal/{{ item }}"
dest: "/home/{{ ansible_user }}/.config/systemd/user/{{ item }}"
state: link
loop:
- parsifal.service
- unclutter.service
- x11vnc.service
- name: Symlink unclutter.service to systemd user directory
file:
src: "/home/{{ ansible_user }}/parsifal/unclutter.service"
dest: "/home/{{ ansible_user }}/.config/systemd/user/unclutter.service"
state: link
- name: Symlink x11vnc.service to systemd user directory
file:
src: "/home/{{ ansible_user }}/parsifal/x11vnc.service"
dest: "/home/{{ ansible_user }}/.config/systemd/user/x11vnc.service"
state: link
- name: Reload systemd for the current user
command: systemctl --user daemon-reload
- name: Reload systemd user service
become: yes
become_user: "{{ ansible_user }}"
environment:
XDG_RUNTIME_DIR: "/run/user/{{ ansible_user_uid }}" # Needed for running systemctl --user
systemd:
daemon_reload: yes
scope: user
- name: Enable and start the Parsifal service
command: systemctl --user enable --now parsifal
- name: Enable and start all services
become: yes
become_user: "{{ ansible_user }}"
environment:
XDG_RUNTIME_DIR: "/run/user/{{ ansible_user_uid }}" # Needed for running systemctl --user
- name: Enable and start the Unclutter service
command: systemctl --user enable --now unclutter
become: yes
become_user: "{{ ansible_user }}"
environment:
XDG_RUNTIME_DIR: "/run/user/{{ ansible_user_uid }}" # Needed for running systemctl --user
- name: Enable and start the x11vnc service
command: systemctl --user enable --now x11vnc
become: yes
become_user: "{{ ansible_user }}"
environment:
XDG_RUNTIME_DIR: "/run/user/{{ ansible_user_uid }}" # Needed for running systemctl --user
systemd:
name: "{{ item }}"
enabled: yes
state: started
scope: user
loop:
- parsifal
- unclutter
- x11vnc

68
setup-player.yml Normal file
View file

@ -0,0 +1,68 @@
---
- hosts: players
become: yes
tasks:
- name: Install mpv, unclutter
apt:
name: "{{ item }}"
state: present
update_cache: yes
loop:
- mpv
- unclutter
- name: Copy disable-input script
copy:
src: disable_input.sh
dest: "/home/{{ ansible_user }}/disable_input.sh"
owner: "{{ ansible_user }}"
group: "{{ ansible_user }}"
mode: "0755"
- 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-player.service
- disable-input.service
- unclutter.service
- name: Reload systemd user service
become: yes
become_user: "{{ ansible_user }}"
systemd:
daemon_reload: yes
scope: user
- name: Enable input disable service
become: yes
become_user: "{{ ansible_user }}"
systemd:
name: disable-input
enabled: yes
scope: user
- name: Enable and start all services
become: yes
become_user: "{{ ansible_user }}"
systemd:
name: "{{ item }}"
enabled: yes
state: started
scope: user
loop:
- parsifal-player
- unclutter