LoginSignup
5
6

More than 3 years have passed since last update.

Raspberry Pi OSで、Chromium を kiosk mode 実行する

Last updated at Posted at 2020-12-29

基本的な方法は以下を踏襲した。
https://blog.r0b.io/post/minimal-rpi-kiosk/

環境

Raspberry Pi 2 Model B

Raspberry Pi OS Lite をインストールする。

(参考 https://dev.classmethod.jp/articles/raspberry-pi-imager-introduction/

無線LANネットワークの設定をする。

(参考:https://qiita.com/nanbuwks/items/9a1d46c22e898178015c
以下のファイルを書き換える。

$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=JP
network={
ssid="myssid"
psk="mypassphrase"
}

「myssid」は自分の無線LANの「SSID」、
「mypassphrase」は自分の無線LANの「暗号化キー」に変更する。

最新パッケージに更新する。

$ sudo apt update
$ sudo apt upgrade

必要なパッケージをインストールする。

$ sudo apt-get install --no-install-recommends xserver-xorg-video-all \
  xserver-xorg-input-all xserver-xorg-core xinit x11-xserver-utils \
  chromium-browser

自動ログインの設定をする。

$ sudo raspi-config

Boot Options > Console Autologin

自動でstartxを起動する設定をする。

$ nano /home/pi/.bash_profile
".bash_profile
if [ -z $DISPLAY ] && [ $(tty) = /dev/tty1 ]
then
  startx -- -nocursor
fi

カーソルを消すために、-nocursorをつける。
(参考:https://qiita.com/naohikowatanabe/items/73b093399deb0ebf496e

startx時の設定をする。

/home/pi/.xinitrcを作成する。

$ nano /home/pi/.xinitrc
".xinitrc"
#!/usr/bin/env sh
xset -dpms
xset s off
xset s noblank

chromium-browser https://google.com \
  --window-size=1920,1080 \
  --window-position=0,0 \
  --start-fullscreen \
  --kiosk \
  --incognito \
  --noerrdialogs \
  --disable-translate \
  --no-first-run \
  --fast \
  --fast-start \
  --disable-infobars \
  --disable-features=TranslateUI \
  --disk-cache-dir=/dev/null \
  --overscroll-history-navigation=0 \
  --disable-pinch

--window-size=は、自身のディスプレイサイズに調整してください。

日本語フォントをインストールする。

このままだと、日本語が豆腐になっているので、(no more tofu)

$ sudo apt install fonts-noto-cjk

cjk は、China、Japanese、Koreaの3つだそうです。
(参考:https://oxynotes.com/?p=10293

まとめ

kioskモードでchromium を実行するところまでできました。

5
6
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
5
6