buildroot linux 添加QT自动启动桌面

/etc/init.d/S99QTDesktop

#!/bin/sh
#
# Start/stop QTdesktop
#

export XDG_RUNTIME_DIR=/usr/qt-armhf/lib

#配置tslib

export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/lib/ts
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export LD_PRELOAD=/usr/lib/libts.so

#配置QT

export QTEDIR=/usr/qt-armhf/lib
export LD_LIBRARY_PATH=/usr/qt-armhf/lib:$LD_LIBRARY_PATH
export QT_QPA_GENERIC_PLUGINS=tslib:/dev/input/event1
export QT_QPA_FONTDIR=$QTEDIR/fonts
export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/qt-armhf/plugins
export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0
export QT_QPA_FB_TSLIB=1

#配置启动文件

DAEMON=/root/Desktop/Desktop

[ -f $CONFIG ] || exit 0

case "$1" in
  start)
    echo "Starting desktop..."
    start-stop-daemon -S -x "$DAEMON" &
    ;;
  stop)
    echo "Stopping desktop..."
    start-stop-daemon -K -x "$DAEMON"
    ;;
  reload|force-reload)
    echo "Reloading desktop configuration..."
    "$DAEMON" -s reload
    ;;
  restart)
    "$0" stop
    sleep 1 # Prevent race condition: ensure desktop stops before start.
    "$0" start
    ;;
  *)
  echo "Usage: $0 {start|stop|restart|reload|force-reload}"
  exit 1
esac

 

posted @ 2024-08-31 21:07  *^VV^*  阅读(30)  评论(0编辑  收藏  举报