bash 如何让 Raspberry Pi 直接启动到浏览器?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14320332/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I get Raspberry Pi to boot directly into browser?
提问by coolblue2000
I have put the following line in my /etc/bash.bashrcfile:
我在我的/etc/bash.bashrc文件中添加了以下行:
chromium--kiosk www.bbc.co.uk
However I then get an error at start up:
但是,我在启动时遇到错误:
"(chromium:2100): Gtk-WARNING **: cannot open display:"
If I set the Pi to boot into OS at startup it chromium never appears but if I start a terminal window it suddenly opens chromium in kiosk mode and with the specified web page!
如果我将 Pi 设置为在启动时启动到操作系统,它永远不会出现 Chromium,但是如果我启动一个终端窗口,它会突然以 kiosk 模式和指定的网页打开 Chromium!
What am I doing wrong?
我究竟做错了什么?
回答by Chris Seymour
Trying adding startxone line before chromium--kiosk www.bbc.co.ukin your ~/.bashrc. Your .bashrcfile is read every time you start bashfor example when the pi doesn't take you straight to the desktop you are in a bashshell but you have no xserverrunning so the chrome window cannot be displayed. So start the windowing environment in your .bashrcwith startxbefore you launch chrome.
试图将startx前一行chromium--kiosk www.bbc.co.uk在你的~/.bashrc。.bashrc每次启动bash时都会读取您的文件,例如,当 pi 没有将您直接带到您在bashshell 中的桌面但您没有xserver运行时,因此无法显示 chrome 窗口。因此.bashrc,startx在启动chrome.

