#!/bin/sh
set -eu

pgrep -x Xvfb >/dev/null
pgrep -f 'dbus-daemon --system' >/dev/null
pgrep -f x11vnc >/dev/null
pgrep -f websockify >/dev/null
pgrep -f '/opt/wechat/wechat|/usr/bin/wechat' >/dev/null

if command -v xdotool >/dev/null 2>&1; then
  DISPLAY="${DISPLAY:-:1}" xdotool search --name 'Weixin\|WeChat' >/dev/null 2>&1 || true
fi

exit 0
