summarylogtreecommitdiffstats
path: root/0007-start-stop-graphical-session.target.patch
blob: 7c8697ac572e37d29248950d3443994b40671afa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
From 42b25bdd8c5c44305d5a78f498f2b61e87fccd13 Mon Sep 17 00:00:00 2001
From: ArenM <aren@peacevolution.org>
Date: Fri, 22 Apr 2022 18:24:27 -0400
Subject: [PATCH sxmo-utils 7/9] start / stop graphical-session.target

---
 configs/default_hooks/sxmo_hook_start.sh | 1 +
 configs/services/sxmo-session.target     | 6 ++++++
 scripts/core/sxmo_winit.sh               | 1 +
 scripts/core/sxmo_xinit.sh               | 1 +
 4 files changed, 9 insertions(+)
 create mode 100644 configs/services/sxmo-session.target

diff --git a/configs/default_hooks/sxmo_hook_start.sh b/configs/default_hooks/sxmo_hook_start.sh
index 9697d8d..74443e4 100755
--- a/configs/default_hooks/sxmo_hook_start.sh
+++ b/configs/default_hooks/sxmo_hook_start.sh
@@ -10,6 +10,7 @@
 xdg-user-dirs-update
 
 printenv | cut -d '=' -f 1 | xargs systemctl --user import-environment
+systemctl --user start sxmo-session.target
 
 # Periodically update some status bar components
 sxmo_hook_statusbar.sh all
diff --git a/configs/services/sxmo-session.target b/configs/services/sxmo-session.target
new file mode 100644
index 0000000..1bea6c3
--- /dev/null
+++ b/configs/services/sxmo-session.target
@@ -0,0 +1,6 @@
+[Unit]
+Description=Graphical sxmo session
+Documentation=man:systemd.special
+BindsTo=graphical-session.target
+Wants=graphical-session-pre.target
+After=graphical-session-pre.target
diff --git a/scripts/core/sxmo_winit.sh b/scripts/core/sxmo_winit.sh
index fa78061..b160f84 100755
--- a/scripts/core/sxmo_winit.sh
+++ b/scripts/core/sxmo_winit.sh
@@ -35,6 +35,7 @@ start() {
 }
 
 cleanup() {
+	systemctl --user stop graphical-session.target sxmo-session.target
 	sxmo_daemons.sh stop all
 	pkill bemenu
 	pkill wvkbd
diff --git a/scripts/core/sxmo_xinit.sh b/scripts/core/sxmo_xinit.sh
index 4a71c48..cfa1921 100755
--- a/scripts/core/sxmo_xinit.sh
+++ b/scripts/core/sxmo_xinit.sh
@@ -57,6 +57,7 @@ start() {
 }
 
 cleanup() {
+	systemctl --user stop graphical-session.target sxmo-session.target
 	sxmo_daemons.sh stop all
 	pkill svkbd
 	pkill dmenu
-- 
2.39.2