From 25cd7fbb85168533c8901607e212ece4e2d83eb7 Mon Sep 17 00:00:00 2001
From: j1nx
Date: Wed, 8 Jun 2022 20:30:36 +0200
Subject: [PATCH] Set default systemd environment variables globally
---
.../systemd/system/user@.service.d/openvoiceos.conf | 12 ++++++++++++
.../usr/lib/environment.d/99-environment.conf | 9 +++++++++
2 files changed, 21 insertions(+)
create mode 100644 buildroot-external/rootfs-overlay/etc/systemd/system/user@.service.d/openvoiceos.conf
create mode 100644 buildroot-external/rootfs-overlay/usr/lib/environment.d/99-environment.conf
diff --git a/buildroot-external/rootfs-overlay/etc/systemd/system/user@.service.d/openvoiceos.conf b/buildroot-external/rootfs-overlay/etc/systemd/system/user@.service.d/openvoiceos.conf
new file mode 100644
index 00000000..95b62d85
--- /dev/null
+++ b/buildroot-external/rootfs-overlay/etc/systemd/system/user@.service.d/openvoiceos.conf
@@ -0,0 +1,12 @@
+[Service]
+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
diff --git a/buildroot-external/rootfs-overlay/usr/lib/environment.d/99-environment.conf b/buildroot-external/rootfs-overlay/usr/lib/environment.d/99-environment.conf
new file mode 100644
index 00000000..679dba26
--- /dev/null
+++ b/buildroot-external/rootfs-overlay/usr/lib/environment.d/99-environment.conf
@@ -0,0 +1,9 @@
+PATH=$HOME/.local/bin:/usr/lib/libexec:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
+XDG_DATA_DIRS=/usr/local/share:/usr/share
+XDG_DATA_HOME=$HOME/.local/share:$XDG_DATA_DIRS
+XDG_CONFIG_DIRS=/etc/xdg
+XDG_CONFIG_HOME=$HOME/.config:$XDG_CONFIG_DIRS
+XDG_CACHE_HOME=$HOME/.cache
+XDG_STATE_HOME=$HOME/.local/state:/var/lib
+LD_LIBRARY_PATH=/usr/lib
+LIBEXEC_PATH=/usr/lib/libexec