#!/bin/sh
set -eu

mkdir -p "${XDG_RUNTIME_DIR:-/tmp/runtime-wechat}"
chmod 700 "${XDG_RUNTIME_DIR:-/tmp/runtime-wechat}" 2>/dev/null || true

until xdpyinfo -display "${DISPLAY:-:1}" >/dev/null 2>&1; do
  sleep 0.3
done

exec startxfce4
