diff options
Diffstat (limited to 'meta/recipes-graphics/wayland/weston-init/weston-socket.sh')
-rwxr-xr-x | meta/recipes-graphics/wayland/weston-init/weston-socket.sh | 20 |
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 | ||
4 | global_socket="/run/wayland-0" | ||
5 | if [ -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 | ||
19 | fi | ||
20 | unset global_socket | ||