应该是环境变量的问题 我vi /bin/qt4 看了一下它设置了一堆环境变量:
#!/bin/sh
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CONFFILE=/usr/local/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/local/lib/ts
export TSLIB_CALIBFILE=/etc/pointercal
export LD_LIBRARY_PATH=/usr/local/lib
export PATH=/bin:/sbin:/usr/bin/:/usr/sbin:/usr/local/bin
export QWS_DISPLAY=:1
TS_INFO_FILE=/sys/devices/virtual/input/input0/uevent
if [ -e $TS_INFO_FILE -a "/bin/grep -q TouchScreen < $TS_INFO_FILE" ]; then
export QWS_MOUSE_PROTO="Tslib:/dev/input/event0 MouseMan:/dev/input/mice
if [ ! -s /etc/pointercal ] ; then
rm /etc/pointercal
/usr/local/bin/ts_calibrate
fi
else
export QWS_MOUSE_PROTO="MouseMan:/dev/input/mice"
fi
unset TS_INFO_FILE
export QWS_KEYBOARD=TTY:/dev/tty1
export HOME=/root
cd $1 #我把这两句改成外部输入参数的形式,这样就可以通过命令行输入参数来启动自己要的程序了
./$2 -qws #
hotplug
用上面我改后的脚本启动程序没有问题,但另一个我无法想通的问题出现了:
我把最后三行注释掉:
#cd $1
#./$2 -qws
#hotplug
然后执行脚本后自己在命令行里启动程序 ./hi -qws 程序启动后触摸屏还是无法使用,费解
我只是把一个动作分解成两个动作了而已,求高手解惑....