Chromium kiosk mode : Fullscreen and remove address bar

≯℡__Kan透↙ 提交于 2019-12-05 17:41:30

I had a similar issue ... I eventually used this in a .xinitrc file in the home directory.

#Disable DPMS.
xset -dpms
xset s off
xset s noblank

#Lets remove a lock file that could be caused due to a crash.
rm /home/pi/.config/chromium/SingletonLock

while true; do
    # Clean up previously running apps, gracefully at first then harshly
    killall -TERM chromium-browser 2>/dev/null;
    killall -TERM matchbox-window-manager 2>/dev/null;

    sleep 2;

    killall -9 chromium-browser 2>/dev/null;
    killall -9 matchbox-window-manager 2>/dev/null;

    # Launch window manager without title bar.
    exec matchbox-window-manager -use_titlebar no -use_cursor no -theme bluebox &

    # Run unclutter
    unclutter &

    # Launch browser.
    chromium-browser --incognito --kiosk --noerrdialogs --disable-translate --disable-cache --disk-cache-dir=/dev/null --disk-cache-size=1 --app=http://URL_TO_GO_TO

done;

I use the matchbox windows manager and had to make some other tweaks, but this is what I am using.

Try changing to this

#@xscreensaver -no-splash  # comment this line out to disable screensaver
@xset s off
@xset -dpms
@xset s noblank
@chromium-browser --incognito --kiosk http://www.fb.com/

For those arriving here from Google:

The answer to this question will vary, depending on how you have setup Chromium to automatically run (using OpenBox, Xsession, etc). The answer will also vary depending on what version of Raspbian you are running (Full, Lite, or Super Lite).

I would recommend using the following article to correctly set up your Raspberry Pi to perform this action: https://blockdev.io/raspberry-pi-2-and-3-chromium-in-kiosk-mode/ .

NOTE: While this article is great at walking you through how to correctly setup your pi to run in a proper kiosk mode, you will need to change the "sed"/"@sed" command(s) if you don't wish to be prompted about Chromium not exiting correctly. To fix this, please change your "sed" (or "@sed") command(s) to the following:

  • sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/Default/Preferences
  • sed -i ‘s/”exit_type”: “Crashed”/”exit_type”: “Normal”/’ ~/.config/chromium/Default/Preferences

If you are supposed to use "@sed", then please provide a "@" before each of the commands above.

Vilk

Other way to hide cursor in Raspbian is by using unclutter

sudo apt-get update
sudo apt-get install unclutter

then in the script, insert this line:

unclutter &
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!