blob: 86389d63a3b1c3b159f7a9a789665a8757678365 [file] [log] [blame]
Patrick Williams520786c2023-06-25 16:20:36 -05001#!/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