From 7e70eb7ea10ef1fb3af501efa596d712a644eed5 Mon Sep 17 00:00:00 2001
From: j1nx
Date: Mon, 4 Sep 2023 11:58:31 +0000
Subject: [PATCH] [ALL] Add quadlet container files for the GUI. gui_websocket
will be launched however the GUI itself not yet by default.
---
.../systemd/users/ovos_gui.container | 45 +++++++++++++++++++
.../users/ovos_gui_websocket.container | 24 ++++++++++
2 files changed, 69 insertions(+)
create mode 100644 buildroot-external/rootfs-overlay/etc/containers/systemd/users/ovos_gui.container
create mode 100644 buildroot-external/rootfs-overlay/etc/containers/systemd/users/ovos_gui_websocket.container
diff --git a/buildroot-external/rootfs-overlay/etc/containers/systemd/users/ovos_gui.container b/buildroot-external/rootfs-overlay/etc/containers/systemd/users/ovos_gui.container
new file mode 100644
index 00000000..08493f65
--- /dev/null
+++ b/buildroot-external/rootfs-overlay/etc/containers/systemd/users/ovos_gui.container
@@ -0,0 +1,45 @@
+[Unit]
+Description=OpenVoiceOS GUI Service
+After=local-fs.target
+Wants=pipewire.service
+After=pipewire.service
+Wants=ovos_messagebus.service
+After=ovos_messagebus.service
+Wants=ovos_phal.service
+After=ovos_phal.service
+Wants=ovos_gui_websocket.service
+After=ovos_gui_websocker.service
+
+[Container]
+ContainerName=ovos_gui
+Image=docker.io/smartgic/ovos-gui:alpha
+AutoUpdate=registry
+LogDriver=journald
+HostName=ovos_gui
+Network=host
+Timezone=local
+UserNS=keep-id:uid=%U,gid=%G
+Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
+Environment=XDG_RUNTIME_DIR=%t
+Environment=QT_QPA_PLATFORM=eglfs
+Environment=QT_QPA_EGLFS_KMS_ATOMIC=1
+Environment=QT_QPA_PLATFORMTHEME=qt5ct
+Environment=QT_PLUGIN_PATH=/usr/lib/qt/plugins:/usr/lib/plugins:/usr/lib/plugins/kf5
+Environment=QT_LOGGING_RULES='*=false'
+Environment=QT_FILE_SELECTORS=ovos
+Environment=QT_FONT_DPI=120
+Environment=QT_IM_MODULE=qtvirtualkeyboard
+Environment=QT_QUICK_CONTROLS_STYLE=OpenVoiceStyle
+Environment=XDG_CURRENT_DESKTOP=kde
+Environment=QML2_IMPORT_PATH=/usr/lib/qml
+AddDevice=/dev/snd
+AddDevice=/dev/dri
+Volume=%h/ovos/config:/home/ovos/.config/mycroft
+Volume=/dev/shm:/tmp
+Volume=%t/pipewire-0:/run/user/1000/pipewire-0:ro
+Volume=%t/bus:/run/user/1000/bus:ro
+Volume=%h/ovos/share:/home/ovos/.local/share/mycroft
+
+[Service]
+TimeoutStartSec=900
+Restart=always
diff --git a/buildroot-external/rootfs-overlay/etc/containers/systemd/users/ovos_gui_websocket.container b/buildroot-external/rootfs-overlay/etc/containers/systemd/users/ovos_gui_websocket.container
new file mode 100644
index 00000000..8ebebab1
--- /dev/null
+++ b/buildroot-external/rootfs-overlay/etc/containers/systemd/users/ovos_gui_websocket.container
@@ -0,0 +1,24 @@
+[Unit]
+Description=OpenVoiceOS GUI Websocket Service
+Wants=ovos_messagebus.service
+After=ovos_messagebus.service
+After=local-fs.target
+
+[Container]
+ContainerName=ovos_gui_websocket
+Image=docker.io/smartgic/ovos-gui-websocket:alpha
+AutoUpdate=registry
+LogDriver=journald
+HostName=ovos_gui_websocket
+Network=host
+Timezone=local
+UserNS=keep-id:uid=%U,gid=%G
+Volume=%h/ovos/config:/home/ovos/.config/mycroft:ro
+Volume=/dev/shm:/tmp
+
+[Service]
+TimeoutStartSec=900
+Restart=always
+
+[Install]
+WantedBy=multi-user.target default.target