Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 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 |