From 32fd2f7a7b93a55e0ac8eff6a4d7f4dd7231c767 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sat, 3 Oct 2020 13:36:12 +0200 Subject: [PATCH] bundles/kodi: introduce --- bundles/kodi/files/Xwrapper.config | 2 ++ bundles/kodi/files/kodi.service | 18 +++++++++++++++ bundles/kodi/files/pulseaudio.service | 10 ++++++++ bundles/kodi/items.py | 33 +++++++++++++++++++++++++++ bundles/kodi/metadata.py | 25 ++++++++++++++++++++ 5 files changed, 88 insertions(+) create mode 100644 bundles/kodi/files/Xwrapper.config create mode 100644 bundles/kodi/files/kodi.service create mode 100644 bundles/kodi/files/pulseaudio.service create mode 100644 bundles/kodi/items.py create mode 100644 bundles/kodi/metadata.py diff --git a/bundles/kodi/files/Xwrapper.config b/bundles/kodi/files/Xwrapper.config new file mode 100644 index 0000000..ddaa564 --- /dev/null +++ b/bundles/kodi/files/Xwrapper.config @@ -0,0 +1,2 @@ +allowed_users=anybody +needs_root_rights=yes diff --git a/bundles/kodi/files/kodi.service b/bundles/kodi/files/kodi.service new file mode 100644 index 0000000..c63cb8a --- /dev/null +++ b/bundles/kodi/files/kodi.service @@ -0,0 +1,18 @@ +[Unit] +Description=Kodi +Conflicts=getty@tty7.service +After=systemd-user-sessions.service getty@tty7.service plymouth-quit.service +StartLimitIntervalSec=2 + +[Service] +User=kodi +Type=simple +ExecStart=/usr/bin/xinit /usr/bin/kodi-standalone -- :0 vt7 -nocursor +WorkingDirectory=/home/kodi +StandardOutput=journal +Restart=always +RestartSec=2 + +[Install] +WantedBy=graphical.target +Alias=display-manager.service diff --git a/bundles/kodi/files/pulseaudio.service b/bundles/kodi/files/pulseaudio.service new file mode 100644 index 0000000..b92a8fc --- /dev/null +++ b/bundles/kodi/files/pulseaudio.service @@ -0,0 +1,10 @@ +[Unit] +Description=PulseAudio for user kodi + +[Service] +User=kodi +Type=simple +ExecStart=pulseaudio --realtime --log-target=journal --daemonize=no + +[Install] +WantedBy=kodi.service diff --git a/bundles/kodi/items.py b/bundles/kodi/items.py new file mode 100644 index 0000000..57c5818 --- /dev/null +++ b/bundles/kodi/items.py @@ -0,0 +1,33 @@ +files = { + '/etc/systemd/system/kodi.service': { + 'triggers': { + 'action:systemd-reload', + 'svc_systemd:kodi:restart', + }, + }, + '/etc/systemd/system/pulseaudio.service': { + 'triggers': { + 'action:systemd-reload', + 'svc_systemd:pulseaudio:restart', + }, + }, + '/etc/X11/Xwrapper.config': {}, +} + +svc_systemd = { + 'kodi': { + 'needs': { + 'file:/etc/systemd/system/kodi.service', + 'file:/etc/X11/Xwrapper.config', + 'pkg_apt:kodi', + 'user:kodi', + 'svc_systemd:pulseaudio', + }, + }, + 'pulseaudio': { + 'needs': { + 'file:/etc/systemd/system/pulseaudio.service', + 'pkg_apt:pulseaudio', + }, + }, +} diff --git a/bundles/kodi/metadata.py b/bundles/kodi/metadata.py new file mode 100644 index 0000000..9d6eac4 --- /dev/null +++ b/bundles/kodi/metadata.py @@ -0,0 +1,25 @@ +defaults = { + 'apt': { + 'packages': { + 'cec-utils': {}, + 'fonts-noto': {}, + 'fonts-roboto': {}, + 'kodi': {}, + 'libcec4': {}, + 'pulseaudio': {}, + 'pulseaudio-utils': {}, + 'ttf-mscorefonts-installer': {}, + 'tv-fonts': {}, + 'xfonts-base': {}, + 'xserver-xorg-legacy': {}, + }, + }, + 'users': { + 'kodi': { + 'groups': { + 'audio', + 'tty', + }, + }, + }, +}