1#!/bin/sh 2# 3# Start linux matrix... 4# 5 6# Load default env variables from profiles(e.g. /etc/profile.d/weston.sh) 7. /etc/profile 8 9case "$1" in 10 start) 11 printf "Starting matrix: " 12 export LC_ALL='zh_CN.utf8' 13 14 ifconfig lo 127.0.0.1 15 # Uncomment to disable mirror mode 16 # unset WESTON_DRM_MIRROR 17 18 export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/var/run} 19 export QT_QPA_PLATFORM=${QT_QPA_PLATFORM:-wayland} 20 21 { 22 # Wait for weston ready 23 while [ ! -e ${XDG_RUNTIME_DIR}/wayland-0 ]; do 24 sleep .1 25 done 26 /usr/bin/matrix-browser -no-sandbox --disable-gpu 127.0.0.1 >> /dev/null & 27 28 }& 29 ;; 30 stop) 31 killall matrix-browser 32 printf "stop finished" 33 ;; 34 *) 35 echo "Usage: $0 {start|stop}" 36 exit 1 37 ;; 38esac 39exit 0 40