summary refs log tree commit diff
path: root/bin/gui-enter
diff options
context:
space:
mode:
Diffstat (limited to 'bin/gui-enter')
-rwxr-xr-xbin/gui-enter10
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/gui-enter b/bin/gui-enter
index e14bafb..ac7a479 100755
--- a/bin/gui-enter
+++ b/bin/gui-enter
@@ -13,7 +13,7 @@ usage() {
 }
 
 case "$1" in
--h)	usage && exit 0 ;;
+	-h) usage && exit 0 ;;
 esac
 
 user="${1}"
@@ -26,15 +26,17 @@ marker_bins="
 	oguri
 	kanshi
 	waybar
-	gammastep
+	wlsunset
 	pipewire
 	swayidle
 "
 pid=
 for bin in ${marker_bins}; do
-	pid=$(cat "/run/user/"${uid}"/"${bin}".pid")
+	pid=$(cat "/run/user/${uid}/${bin}.pid")
 	kill -0 "${pid}" && break
 done
 
+# grep -zE '^(SWAY|I3|WAYLAND|DBUS|XDG|PATH)' /proc/"${pid}"/environ | tr '\0' '\n'
+
 env=$(grep -zE '^(SWAY|I3|WAYLAND|DBUS|XDG|PATH)' /proc/"${pid}"/environ | tr '\0' ' ' || true)
-exec doas -u "${user}" env ${env} "${@}"
+exec doas -nu "${user}" -- env ${env} "${@}"