|
| 1 | +# Mir Kiosk Chromium |
| 2 | + |
| 3 | +Mir Kiosk Chromium enables to run web based kiosks on Ubuntu Core. This is forked from Gerry Boland's [chromium-mir-kiosk](https://code.launchpad.net/~gerboland/+git/chromium-snap) |
| 4 | + |
| 5 | +## Build |
| 6 | + |
| 7 | +`git clone https://github.com/zhex900/mir-kiosk-chromium` |
| 8 | + |
| 9 | +`cd mir-kiosk-chromium` |
| 10 | + |
| 11 | +`docker run --rm -v $PWD:/project -w /project zhex900/snapcraft:core18 snapcraft` |
| 12 | + |
| 13 | +## Install |
| 14 | + |
| 15 | +This is tested on Ubuntu Core 18 and 20 |
| 16 | + |
| 17 | +First install `mir-kiosk` |
| 18 | + |
| 19 | +`sudo snap install mir-kiosk` |
| 20 | + |
| 21 | +Install this snap package |
| 22 | + |
| 23 | +`sudo snap install ./mir-kiosk-chromium_87.0.4280.66_amd64.snap --dangerous --devmode` |
| 24 | + |
| 25 | +## Configuration |
| 26 | + |
| 27 | +To customize the startup url for chromium use: |
| 28 | + |
| 29 | +`sudo snap set chromium-mir-kiosk url="https://yoururl.com"` |
| 30 | + |
| 31 | +Set browser refresh interval. Default is 1hr (60 mins) |
| 32 | + |
| 33 | +`sudo snap set chromium-mir-kiosk resettime=60` |
| 34 | + |
| 35 | +Show nav bar |
| 36 | + |
| 37 | +`sudo snap set chromium-mir-kiosk shownav=true` |
| 38 | + |
| 39 | +Hide cursor (true/false) |
| 40 | + |
| 41 | +`sudo snap set chromium-mir-kiosk hidecursor=true` |
| 42 | + |
| 43 | +Disable kiosk mode (true/false) |
| 44 | + |
| 45 | +`sudo snap set chromium-mir-kiosk disablekiosk=true` |
| 46 | + |
| 47 | +## Screen orientation |
| 48 | + |
| 49 | +`sudo vim /var/snap/mir-kiosk/current/miral-kiosk.display`. |
| 50 | +Append this to the end of the file. |
| 51 | +``` |
| 52 | + kiosk: |
| 53 | + cards: |
| 54 | + - card-id: 0 |
| 55 | + DisplayPort-1: |
| 56 | + orientation: right # left or normal |
| 57 | +``` |
| 58 | +Apply the new kiosk layout |
| 59 | + |
| 60 | +`sudo snap set mir-kiosk display-layout=kiosk` |
| 61 | + |
| 62 | +## Remove chrome profile lock on boot |
| 63 | + |
| 64 | +When the kiosk is ungracefully shutdown, like lost of power. Chromium will display |
| 65 | +a white page asking to unlock existing profile. To remove this on reboot. Existing |
| 66 | +Chrome profile needs to be removed. |
| 67 | + |
| 68 | +`sudo vim /etc/systemd/system/snap.mir-kiosk-chromium.mir-kiosk-chromium.service` |
| 69 | + |
| 70 | +Add this before `ExecStart`. This will remove the profile lock when chromium crashes or ungracefully reboots. |
| 71 | + |
| 72 | +```yaml |
| 73 | +ExecStartPre=/usr/bin/rm -rf /root/snap/mir-kiosk-chromium/current/.config/chromium/SingletonLock |
| 74 | +ExecStartPre=/usr/bin/rm -rf /root/snap/mir-kiosk-chromium/current/.config/chromium/SingletonCookie |
| 75 | +ExecStartPre=/usr/bin/rm -rf /root/snap/mir-kiosk-chromium/current/.config/chromium/SingletonSocket |
| 76 | +``` |
| 77 | + |
| 78 | +Change `Restart` to `always`. `Restart=always` |
| 79 | + |
| 80 | +`sudo systemctl daemon-reload` |
| 81 | + |
| 82 | +`sudo snap restart mir-kiosk-chromium` |
| 83 | + |
| 84 | +##Reference: |
| 85 | +1. https://discourse.ubuntu.com/t/configuring-mir-kiosk-a-masterclass/8150 |
| 86 | +1. https://discourse.ubuntu.com/t/install-mir-kiosk-and-chromium-mir-kiosk-under-ubuntu-18-04-server/13108/4 |
0 commit comments