summaryrefslogtreecommitdiff
path: root/x11/wayland-logout/files/patch-wayland-logout.sh
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2020-11-16 12:28:05 +0000
committerJan Beich <jbeich@FreeBSD.org>2020-11-16 12:28:05 +0000
commit80576bdf48ea79b9b96ae69373c0875bf2628314 (patch)
treeebfdc55457e5249b97225a8dafc2c26d7b57137e /x11/wayland-logout/files/patch-wayland-logout.sh
parentx11/wcm: make wf-shell optional (diff)
x11/wayland-logout: add new port
wayland-logout is a simple program that sends SIGINT to a wayland compositor by looking up the pid for the wayland socket file. The path to the socket file is derived from WAYLAND_DISPLAY and XDG_RUNTIME_DIR environment variables. https://github.com/soreau/wayland-logout
Diffstat (limited to 'x11/wayland-logout/files/patch-wayland-logout.sh')
-rw-r--r--x11/wayland-logout/files/patch-wayland-logout.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/x11/wayland-logout/files/patch-wayland-logout.sh b/x11/wayland-logout/files/patch-wayland-logout.sh
new file mode 100644
index 000000000000..2b4ad6303c90
--- /dev/null
+++ b/x11/wayland-logout/files/patch-wayland-logout.sh
@@ -0,0 +1,21 @@
+lsof is slow and not supported on DragonFly
+
+--- wayland-logout.sh.orig 2020-09-11 19:48:32 UTC
++++ wayland-logout.sh
+@@ -1,7 +1,5 @@
+ #!/bin/sh
+
+-# REQUIREMENTS - lsof (not always present)
+-
+ if [ -z "${WAYLAND_DISPLAY}" ]; then
+ printf '%s\n' 'Error: WAYLAND_DISPLAY not set'
+ exit 1
+@@ -21,7 +19,7 @@ case "${WAYLAND_DISPLAY}" in
+ ;;
+ esac
+
+-WAYLAND_PIDS="$(lsof -t -f -- ${SOCKET_PATH})"
++WAYLAND_PIDS="$(sockstat -lu | awk "\$6 == \"${SOCKET_PATH}\" { print \$3 }" | uniq)"
+ set -- $WAYLAND_PIDS
+ if [ $# -gt 1 ]; then
+ printf '%s\n' 'Error: More than one process has been bound to the socket'