From cc619123c3c0a1f4b52f38797af8a1782ac89a1a Mon Sep 17 00:00:00 2001 From: David McKinney Date: Thu, 11 Apr 2019 09:27:22 -0400 Subject: [PATCH] Added session switcher unit file to use sway kernel command line option to start sway session on boot --- .../citadel-config/citadel-config.bb | 5 ++++- .../files/systemd/session-switcher.service | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 meta-citadel/recipes-citadel/citadel-config/files/systemd/session-switcher.service diff --git a/meta-citadel/recipes-citadel/citadel-config/citadel-config.bb b/meta-citadel/recipes-citadel/citadel-config/citadel-config.bb index c20a369..b678db1 100644 --- a/meta-citadel/recipes-citadel/citadel-config/citadel-config.bb +++ b/meta-citadel/recipes-citadel/citadel-config/citadel-config.bb @@ -47,6 +47,7 @@ SRC_URI = "\ file://iptables-flush.sh \ file://systemd/zram-swap.service \ file://systemd/iptables.service \ + file://systemd/session-switcher.service \ file://skel/profile \ file://skel/bashrc \ file://skel/vimrc \ @@ -68,7 +69,7 @@ RDEPENDS_${PN} = "bash" inherit allarch systemd useradd -SYSTEMD_SERVICE_${PN} = "zram-swap.service watch-run-user.path iptables.service" +SYSTEMD_SERVICE_${PN} = "zram-swap.service watch-run-user.path iptables.service session-switcher.service" do_install() { install -m 0755 -d ${D}/storage @@ -97,6 +98,8 @@ do_install() { install -m 644 ${WORKDIR}/systemd/zram-swap.service ${D}${systemd_system_unitdir} install -m 644 ${WORKDIR}/systemd/iptables.service ${D}${systemd_system_unitdir} + install -m 644 ${WORKDIR}/systemd/session-switcher.service ${D}${systemd_system_unitdir} + install -m 644 ${WORKDIR}/systemd/watch-run-user.path ${D}${systemd_system_unitdir} install -m 644 ${WORKDIR}/systemd/watch-run-user.service ${D}${systemd_system_unitdir} install -m 644 ${WORKDIR}/systemd/launch-default-realm.path ${D}${systemd_system_unitdir} diff --git a/meta-citadel/recipes-citadel/citadel-config/files/systemd/session-switcher.service b/meta-citadel/recipes-citadel/citadel-config/files/systemd/session-switcher.service new file mode 100644 index 0000000..9241d1f --- /dev/null +++ b/meta-citadel/recipes-citadel/citadel-config/files/systemd/session-switcher.service @@ -0,0 +1,13 @@ +[Unit] +Description=Session Switcher +After=accounts-daemon.service +Wants=accounts-daemon.service + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/bin/sh -c 'for arg in `cat /proc/cmdline`; do case $arg in sway) /usr/bin/busctl call org.freedesktop.Accounts /org/freedesktop/Accounts/User1000 org.freedesktop.Accounts.User SetXSession s "sway"; esac; done' + +[Install] +WantedBy=graphical.target +