#!/bin/sh
set -e
cd /usr/local/bin/
QTAPP="abc.out"
#QTAPPSTART="./${QTAPP} > /var/log/Xsession.log 2>&1"
QTAPPSTART="./${QTAPP}"
case "$1" in
start)
echo "====== Starting ${QTAPP} ======"
export XDG_RUNTIME_DIR=/run/user/0
export QT_QPA_PLATFORM=wayland
echo "XDG_RUNTIME_DIR: "$XDG_RUNTIME_DIR
echo "QT_QPA_PLATFORM: "$QT_QPA_PLATFORM
sleep 4
#export QT_DEBUG_PLUGINS=1
#eval $QTAPPSTART &
$QTAPPSTART &
;;
stop)
echo "------ Stopping ${QTAPP} ------"
killall $QTAPP
;;
restart)
$0 stop
$0 start
;;
*)
echo "usage: $0 { start | stop | restart }" >&2
exit 1
;;
esac
exit 0