LoginSignup
4
3

More than 1 year has passed since last update.

Raspberry Pi起動時にChromiumを自動起動させる方法

Last updated at Posted at 2022-10-06

1.Chromium 起動スクリプトを作成

$ nano ~/launch.sh
launch.sh
/usr/bin/chromium-browser --noerrdialogs --disable-infobars --kiosk ____URL____

____URL____ここに自動で開きたいURLを書く

1.1テキストエディタnanoの終わらせ方

Ctrl + O
Enter
Ctrl + X

2.スクリプトを実行して確認

$ bash ~/launch.sh

3.autostart ファイル作成

$ mkdir -p ~/.config/lxsession/LXDE-pi
$ cp /etc/xdg/lxsession/LXDE-pi/autostart ~/.config/lxsession/LXDE-pi/autostart
$ nano ~/.config/lxsession/LXDE-pi/autostart

~/.config/lxsession/LXDE-pi/autostart/etc/xdg/lxsession/LXDE-pi/autostart の代わりに実行されます。

4.autostart一番下の行を追加する

※5.スクリーンの自動スリープを防ぐも同時に行うことを推奨。

autostart
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
bash /home/pi/launch.sh

5.スクリーンの自動スリープを防ぐ

$ nano ~/.config/lxsession/LXDE-pi/autostart
autostart
@xset s 0 0
@xset s noblank
@xset s noexpose
@xset dpms 0 0 0

6.Raspberry Piのマウスカーソルを非表示

Terminal で unclutter というアプリ(一定時間マウスが動かないと、カーソルが非表示され、再びマウスを動かせば、カーソルが表示されるアプリ)をインストールする。

$ sudo apt-get install unclutter

インストール後、

$ sudo nano /etc/xdg/lxsession/LXDE/autostart

下記を追記して、リブートを行う。

@unclutter -idle 0.1 -root

7.KIOSKモードのブラウザを強制終了

「Alt + F4」キーでブラウザを終了

8.今回の環境

– Raspberry pi 4 8G
– Raspberry Pi OS(2021-05-07-raspios-buster-armhf.img)
http://downloads.raspberrypi.org

※2021.8.11実装

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3