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 @@
1#!/bin/sh
2
3# set weston variables for use with global weston socket
4global_socket="/run/wayland-0"
5if [ -e "$global_socket" ]; then
6 weston_group=$(stat -c "%G" "$global_socket")
7 if [ "$(id -u)" = "0" ]; then
8 export WAYLAND_DISPLAY="$global_socket"
9 else
10 case "$(groups "$USER")" in
11 *"$weston_group"*)
12 export WAYLAND_DISPLAY="$global_socket"
13 ;;
14 *)
15 ;;
16 esac
17 fi
18 unset weston_group
19fi
20unset global_socket