From e5490a96eeea0141c8b26152130aa81ab4236d73 Mon Sep 17 00:00:00 2001
From: Quanyang Wang <quanyang.wang@windriver.com>
Date: Wed, 8 Apr 2020 21:16:49 +0800
Subject: [PATCH 2/2] wrlinux: template: add lxqt support for wrlinux

Issue: LINUXEXEC-7162

Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
---
 recipes-graphics/lxqt/files/session.conf      | 24 +++++++++
 recipes-graphics/lxqt/lxqt-account.bb         |  9 ++++
 .../lxqt/lxqt-session_git.bbappend            |  8 +++
 wrlinux-distro/templates/feature/lxqt/README  |  7 +++
 .../templates/feature/lxqt/image.inc          |  4 ++
 .../templates/feature/lxqt/template.conf      | 53 +++++++++++++++++++
 6 files changed, 105 insertions(+)
 create mode 100644 recipes-graphics/lxqt/files/session.conf
 create mode 100644 recipes-graphics/lxqt/lxqt-account.bb
 create mode 100644 recipes-graphics/lxqt/lxqt-session_git.bbappend
 create mode 100644 wrlinux-distro/templates/feature/lxqt/README
 create mode 100644 wrlinux-distro/templates/feature/lxqt/image.inc
 create mode 100644 wrlinux-distro/templates/feature/lxqt/template.conf

diff --git a/recipes-graphics/lxqt/files/session.conf b/recipes-graphics/lxqt/files/session.conf
new file mode 100644
index 00000000..8c292f2f
--- /dev/null
+++ b/recipes-graphics/lxqt/files/session.conf
@@ -0,0 +1,24 @@
+[General]
+leave_confirmation=true
+window_manager=xfwm4
+
+[Environment]
+GTK_CSD=0
+GTK_OVERLAY_SCROLLING=0
+
+[Mouse]
+cursor_size=18
+cursor_theme=whiteglass
+acc_factor=20
+acc_threshold=10
+left_handed=false
+
+[Keyboard]
+delay=500
+interval=30
+beep=false
+
+[Font]
+antialias=true
+hinting=true
+dpi=96
diff --git a/recipes-graphics/lxqt/lxqt-account.bb b/recipes-graphics/lxqt/lxqt-account.bb
new file mode 100644
index 00000000..48d29cd4
--- /dev/null
+++ b/recipes-graphics/lxqt/lxqt-account.bb
@@ -0,0 +1,9 @@
+SUMMARY = "Add user wrluser for lxqt Desktop Environment"
+DESCRIPTION = "Since sddm not support root login, we add this user to resolve it"
+LICENSE = "MIT"
+inherit useradd
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--create-home \
+                       --user-group -P 'wrluser' wrluser"
+ALLOW_EMPTY_${PN} = "1"
diff --git a/recipes-graphics/lxqt/lxqt-session_git.bbappend b/recipes-graphics/lxqt/lxqt-session_git.bbappend
new file mode 100644
index 00000000..934001eb
--- /dev/null
+++ b/recipes-graphics/lxqt/lxqt-session_git.bbappend
@@ -0,0 +1,8 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+SRC_URI += " \
+    file://session.conf \
+"
+
+do_install_append () {
+    install -m 755 ${WORKDIR}/session.conf ${D}/usr/share/lxqt/
+}
diff --git a/wrlinux-distro/templates/feature/lxqt/README b/wrlinux-distro/templates/feature/lxqt/README
new file mode 100644
index 00000000..cf234817
--- /dev/null
+++ b/wrlinux-distro/templates/feature/lxqt/README
@@ -0,0 +1,7 @@
+This template is to add support to build an image with
+lxqt Desktop Environment support, and this template must
+work with meta-qt5 and meta-qt5-extra layer.
+
+#@TYPE: Wrtemplate
+#@NAME: lxqt
+#@DESCRIPTION: Enable lxqt support
diff --git a/wrlinux-distro/templates/feature/lxqt/image.inc b/wrlinux-distro/templates/feature/lxqt/image.inc
new file mode 100644
index 00000000..9d8491a5
--- /dev/null
+++ b/wrlinux-distro/templates/feature/lxqt/image.inc
@@ -0,0 +1,4 @@
+IMAGE_INSTALL += "packagegroup-lxqt-base"
+IMAGE_INSTALL += "sddm"
+IMAGE_INSTALL += "xfwm4"
+IMAGE_INSTALL += "lxqt-account"
diff --git a/wrlinux-distro/templates/feature/lxqt/template.conf b/wrlinux-distro/templates/feature/lxqt/template.conf
new file mode 100644
index 00000000..ff28c8e6
--- /dev/null
+++ b/wrlinux-distro/templates/feature/lxqt/template.conf
@@ -0,0 +1,53 @@
+VIRTUAL-RUNTIME_graphical_init_manager = "sddm"
+
+PNWHITELIST_meta-qt5-extra += 'compton'
+PNWHITELIST_meta-qt5-extra += 'compton-conf'
+PNWHITELIST_meta-qt5-extra += 'extra-cmake-modules'
+PNWHITELIST_meta-qt5-extra += 'kidletime'
+PNWHITELIST_meta-qt5-extra += 'kwayland'
+PNWHITELIST_meta-qt5-extra += 'kwindowsystem'
+PNWHITELIST_meta-qt5-extra += 'libdbusmenu-qt5'
+PNWHITELIST_meta-qt5-extra += 'libfm-qt'
+PNWHITELIST_meta-qt5-extra += 'libkscreen'
+PNWHITELIST_meta-qt5-extra += 'liblxqt'
+PNWHITELIST_meta-qt5-extra += 'libqtxdg'
+PNWHITELIST_meta-qt5-extra += 'libsysstat'
+PNWHITELIST_meta-qt5-extra += 'lximage-qt'
+PNWHITELIST_meta-qt5-extra += 'lxmenu-data'
+PNWHITELIST_meta-qt5-extra += 'lxqt-about'
+PNWHITELIST_meta-qt5-extra += 'lxqt-admin'
+PNWHITELIST_meta-qt5-extra += 'lxqt-build-tools'
+PNWHITELIST_meta-qt5-extra += 'lxqt-config'
+PNWHITELIST_meta-qt5-extra += 'lxqt-globalkeys'
+PNWHITELIST_meta-qt5-extra += 'lxqt-notificationd'
+PNWHITELIST_meta-qt5-extra += 'lxqt-openssh-askpass'
+PNWHITELIST_meta-qt5-extra += 'lxqt-panel'
+PNWHITELIST_meta-qt5-extra += 'lxqt-policykit'
+PNWHITELIST_meta-qt5-extra += 'lxqt-powermanagement'
+PNWHITELIST_meta-qt5-extra += 'lxqt-qtplugin'
+PNWHITELIST_meta-qt5-extra += 'lxqt-runner'
+PNWHITELIST_meta-qt5-extra += 'lxqt-session'
+PNWHITELIST_meta-qt5-extra += 'lxqt-sudo'
+PNWHITELIST_meta-qt5-extra += 'lxqt-themes'
+PNWHITELIST_meta-qt5-extra += 'lxqt-world'
+PNWHITELIST_meta-qt5-extra += 'lxqt-account'
+PNWHITELIST_meta-qt5-extra += 'muparser'
+PNWHITELIST_meta-qt5-extra += 'obconf-qt'
+PNWHITELIST_meta-qt5-extra += 'oxygen-icons5'
+PNWHITELIST_meta-qt5-extra += 'packagegroup-lxqt-base'
+PNWHITELIST_meta-qt5-extra += 'pavucontrol-qt'
+PNWHITELIST_meta-qt5-extra += 'pcmanfm-qt'
+PNWHITELIST_meta-qt5-extra += 'polkit-qt-1'
+PNWHITELIST_meta-qt5-extra += 'qps'
+PNWHITELIST_meta-qt5-extra += 'qterminal'
+PNWHITELIST_meta-qt5-extra += 'qtermwidget'
+PNWHITELIST_meta-qt5-extra += 'solid'
+PNWHITELIST_openembedded-layer += 'libconfig'
+PNWHITELIST_openembedded-layer += 'libstatgrab'
+PNWHITELIST_openembedded-layer += 'openbox'
+PNWHITELIST_openembedded-layer += 'polkit-group-rule-datetime'
+PNWHITELIST_openembedded-layer += 'pyxdg'
+PNWHITELIST_openembedded-layer += 'xdg-user-dirs'
+PNWHITELIST_meta-qt5-extra += 'sddm'
+PNWHITELIST_openembedded-layer += 'libxaw'
+PNWHITELIST_openembedded-layer += 'xmessage'
-- 
2.17.1

