Skip to content

Commit b7b1a26

Browse files
committed
Replace chromium with nw.js to fix 500px width issue
1 parent c3ad9c6 commit b7b1a26

File tree

5 files changed

+32
-1
lines changed

5 files changed

+32
-1
lines changed

rpi/.bash_profile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ then
55
startx
66
done
77
fi
8+
9+
if [ -f ~/.bashrc ]; then
10+
. ~/.bashrc
11+
fi

rpi/.xinitrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@ xrandr --output DSI-1 --rotate right
1515
xinput set-prop "raspberrypi-ts" --type=float "Coordinate Transformation Matrix" 0 1 0 -1 0 1 0 0 1
1616

1717
# Start browser in kiosk mode
18-
chromium-browser http://localhost:8083 --start-fullscreen --kiosk --incognito --noerrdialogs --no-first-run --disk-cache-dir=/dev/null
18+
#chromium-browser http://localhost:8083 --start-fullscreen --kiosk --incognito --noerrdialogs --no-first-run --disk-cache-dir=/dev/null
19+
20+
# Start nw.js
21+
nwjs ~/nwjs

rpi/Readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ wget -qO- https://github.com/RoboCup-SSL/ssl-remote-control/releases/latest/down
1414
./ssl-remote-control/bootstrap.sh
1515
# Optionally change the team color to BLUE in ~/.local/share/systemd/user/ssl-remote-control.service
1616
```
17+
18+
Note: Chromium has a minimum window size of 500px, but the currently used Raspberry PI display is only 480x800px.
19+
In portrait mode, 20px on the right are cut-off.
20+
21+
As an alternativ, [nw.js](https://docs.nwjs.io/en/latest/) is used. They do not provide arm builds, though, so the nw.js binary is taken from https://github.com/LeonardLaszlo/nw.js-armv7-binaries, specifically from an APT repository: https://github.com/LeonardLaszlo/nw.js-armv7-binaries/issues/47.

rpi/bootstrap.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ function installBrowser() {
5050
cp "${SCRIPT_DIR}/.bash_profile" ~/.bash_profile
5151
}
5252

53+
function install_nwjs() {
54+
sudo apt install apt-transport-https
55+
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DB348A58A292E9BC
56+
echo "deb https://repo.netsyms.com/apt main main" | sudo tee /etc/apt/sources.list.d/netsyms.list
57+
sudo apt update
58+
mkdir -p ~/nwjs
59+
cp "${SCRIPT_DIR}/package.json" ~/nwjs
60+
}
61+
5362
function configurePi() {
5463
sudo cp "${SCRIPT_DIR}/config.txt" /boot/config.txt
5564
}
@@ -58,6 +67,7 @@ updateSystem
5867
installService
5968
installRemoteControl
6069
installBrowser
70+
install_nwjs
6171
configurePi
6272

6373
echo "You may need to restart the system to apply some settings. Reboot now? (y/n)"

rpi/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "ssl-remote-control",
3+
"main": "http://localhost:8083",
4+
"window": {
5+
"kiosk": true,
6+
"width": 480,
7+
"height": 800
8+
}
9+
}

0 commit comments

Comments
 (0)