我在信息亭模式下使用 Chromium。无需鼠标和键盘即可使用触摸屏。浏览器在下面显示的 /boot/xinitrc 中启动。在启动时,我可以在屏幕上看到正在启动的不同进程,但最后在浏览器启动前屏幕变黑了大约 15 秒。出了什么问题?启动后的浏览器运行正常。
#!/bin/sh
while true; do
# Clean up previously running apps, gracefully at first then harshly
killall -TERM chromium 2>/dev/null;
killall -TERM matchbox-window-manager 2>/dev/null;
sleep 2;
killall -9 chromium 2>/dev/null;
killall -9 matchbox-window-manager 2>/dev/null;
# Clean out existing profile information
rm -rf /home/pi/.cache;
rm -rf /home/pi/.config;
rm -rf /home/pi/.pki;
# Generate the bare minimum to keep Chromium happy!
mkdir -p /home/pi/.config/chromium/Default
sqlite3 /home/pi/.config/chromium/Default/Web\ Data "CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR); INSERT INTO meta VALUES('version','46');$
# Disable DPMS / Screen blanking
xset -dpms
xset s off
# Reset the framebuffer's colour-depth
fbset -depth $( cat /sys/module/*fb*/parameters/fbdepth );
# Hide the cursor (move it to the bottom-right, comment out if you want mouse interaction)
xwit -root -warp $( cat /sys/module/*fb*/parameters/fbwidth ) $( cat /sys/module/*fb*/parameters/fbheight )
# Start the window manager (remove "-use_cursor no" if you actually want mouse interaction)
matchbox-window-manager -use_titlebar no -use_cursor no &
# Start the browser (See http://peter.sh/experiments/chromium-command-line-switches/)
chromium-browser --app=http://localhost:8080/webvisu.htm
done;