summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/wayland/weston-init/weston-socket.sh
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-graphics/wayland/weston-init/weston-socket.sh')
-rwxr-xr-xmeta/recipes-graphics/wayland/weston-init/weston-socket.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/meta/recipes-graphics/wayland/weston-init/weston-socket.sh b/meta/recipes-graphics/wayland/weston-init/weston-socket.sh
new file mode 100755
index 0000000000..86389d63a3
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston-init/weston-socket.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# set weston variables for use with global weston socket
+global_socket="/run/wayland-0"
+if [ -e "$global_socket" ]; then
+ weston_group=$(stat -c "%G" "$global_socket")
+ if [ "$(id -u)" = "0" ]; then
+ export WAYLAND_DISPLAY="$global_socket"
+ else
+ case "$(groups "$USER")" in
+ *"$weston_group"*)
+ export WAYLAND_DISPLAY="$global_socket"
+ ;;
+ *)
+ ;;
+ esac
+ fi
+ unset weston_group
+fi
+unset global_socket