Kiosk端末
古いPCを再利用するためにDebianをインストールしてKiosk端末化していましたが,Debian12だとちょっと苦労したのでメモを残します.
OSのインストール
Debian12のnetinstイメージを使ってインストール.OSのインストールは特に工夫するところなくインストール.デスクトップ環境にはGNOME3を選択.
Kiosk端末向けの設定
ユーザーの追加
自動ログオン用のユーザーを作成して自動ログオンするようにした.
adduser kiosk
自動ログオン
/etc/gdm3/daemon.conf
を修正
AutomaticLoginEnable = true
AutomaticLogin=kiosk #自動ログオンに利用するユーザー
プログラムの自動起動
.config/autostart/kiosk.desktopを作成
[Desktop Entry]
Type=Application
Version=1.0
Name=Kiosk
Path=/home/kiosk
Exec=/home/kiosk/bin/firefox-kiosk
Icon=
Terminal=false
~kiosk/bin/firefox-kioskに起動用のスクリプトを準備
#!/bin/bash
sleep 5;
export http_proxy=http://proxy.example.jp:8080/ #proxy必用なら
export https_proxy=http://proxy.example.jp:8080/ #proxy必用なら
/usr/bin/firefox-esr -kiosk https://www.example.jp
シャットダウンと再起動
平日は8:00に起動,21:00にサスペンド.週末は10:00起動,17:00サスペンドするためにsystemdのタイマーでサスペンドと起動時間を設定する.
/etc/systemd/system/suspend.service
[Unit]
Description=System Suspend Monday to Friday
After=network-online.targetnetwork.target
[Service]
Type=idle
User=root
ExecStart=/usr/sbin/rtcwake -m off -s 39600
/etc/systemd/system/shutdown.timer
[Unit]
Description=System Suspend Monday to Friday
[Timer]
OnCalendar=Mon,Tue,Wed,Thu,Fri *-*-* 21:00:00
Persistent=false
[Install]
WantedBy=timers.target
/etc/systemd/system/suspend-weekend.service
[Unit]
Description=System Suspend Saturday to Sunday
After=network-online.targetnetwork.target
[Service]
Type=idle
User=root
ExecStart=/usr/sbin/rtcwake -m off -s 61000
/etc/systemd/system/suspend-weekend.timer
[Unit]
Description=System Suspend Saturday to Sunday
[Timer]
OnCalendar=Sat,Sun *-*-* 17:00:00
Persistent=false
[Install]
WantedBy=timers.target
systemctl daemon-reload
を実行後にタイマーを有効にする
systemctl enable suspend.timer
systemctl enable suspend-weekend.timer
gnomeの設定
GNOMEのホットコーナーを無効
設定,マルチタスク,ホットコーナーを無効
アクティビティを無効
Debian12だと自動ログオンでfirefoxをkioskモードで起動してもアクティビティ機能がクリックされたような状態で,ドックや仮想デスクトップを選択する画面になり,kioskモードのfirefoxがデスクトップを隠した状態にはならない.
検索すると,dash-to-dockという拡張機能をインストールすれば,この機能を無効にできることがわかった.
apt install gnome-shell-extension-dashtodock
kioskユーザーで拡張機能からdash-to-dockを有効にし,設定,外観タブの"Show overview on startup"を無効にする.
注意
無人の場所への設置やキーボードが使える場合はもう少し工夫が必用と思いますが,今回は有人の場所での利用でいたずらされる可能性が低い場所向けです.
機種によってはRTCからの起動にBIOS(UEFI)が対応していないかも.