summarylogtreecommitdiffstats
path: root/0001-alias-superd-to-systemd-user.patch
blob: deb30825a43e4cd084fe2931b35f186b46645950 (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
65
66
67
68
69
70
71
From fbcf02f44aeca0e0722d4c4b6732eae7179a93c5 Mon Sep 17 00:00:00 2001
From: ArenM <aren@peacevolution.org>
Date: Wed, 16 Nov 2022 09:53:04 -0500
Subject: [PATCH sxmo-utils 1/9] alias superd to systemd --user

---
 configs/default_hooks/sxmo_hook_contextmenu.sh | 2 +-
 configs/default_hooks/sxmo_hook_start.sh       | 7 +------
 scripts/core/sxmo_appmenu.sh                   | 2 +-
 scripts/core/sxmo_common.sh                    | 1 +
 4 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/configs/default_hooks/sxmo_hook_contextmenu.sh b/configs/default_hooks/sxmo_hook_contextmenu.sh
index 07956f4..d89ac47 100755
--- a/configs/default_hooks/sxmo_hook_contextmenu.sh
+++ b/configs/default_hooks/sxmo_hook_contextmenu.sh
@@ -15,7 +15,7 @@ XPROPOUT="$(sxmo_wm.sh focusedwindow)"
 WMCLASS="${1:-$(printf %s "$XPROPOUT" | grep app: | cut -d" " -f2- | tr '[:upper:]' '[:lower:]')}"
 
 superd_service_isrunning() {
-	superctl status "$1" | grep -q started
+	systemctl --user is-active --quiet "$1" 2>/dev/null
 }
 
 sxmo_service_isrunning() {
diff --git a/configs/default_hooks/sxmo_hook_start.sh b/configs/default_hooks/sxmo_hook_start.sh
index 194814d..8140d6d 100755
--- a/configs/default_hooks/sxmo_hook_start.sh
+++ b/configs/default_hooks/sxmo_hook_start.sh
@@ -9,12 +9,7 @@
 # Create xdg user directories, such as ~/Pictures
 xdg-user-dirs-update
 
-sxmo_daemons.sh start daemon_manager superd -v
-
-# let time to superd to start correctly
-while ! superctl status > /dev/null 2>&1; do
-	sleep 0.5
-done
+printenv | cut -d '=' -f 1 | xargs systemctl --user import-environment
 
 # Load our sound daemons
 
diff --git a/scripts/core/sxmo_appmenu.sh b/scripts/core/sxmo_appmenu.sh
index e45a54c..07da1e2 100755
--- a/scripts/core/sxmo_appmenu.sh
+++ b/scripts/core/sxmo_appmenu.sh
@@ -19,7 +19,7 @@ confirm() {
 }
 
 supertoggle_daemon() {
-	if superctl status "$1" | grep -q started; then
+	if systemctl --user is-active "$1" 2>/dev/null; then
 		superctl stop "$1"
 		sxmo_notify_user.sh "$1 Stopped"
 	else
diff --git a/scripts/core/sxmo_common.sh b/scripts/core/sxmo_common.sh
index 16e7799..4c181d5 100755
--- a/scripts/core/sxmo_common.sh
+++ b/scripts/core/sxmo_common.sh
@@ -16,6 +16,7 @@ command -v shopt > /dev/null && shopt -s expand_aliases
 alias dmenu="sxmo_dmenu.sh"
 alias bemenu="sxmo_dmenu.sh"
 alias jq="gojq" # better performances
+alias superctl="systemctl --user"
 
 if ! command -v sxmobar > /dev/null; then
 	sxmobar() {
-- 
2.39.2