Skip to content

Commit 0bf3c08

Browse files
committed
Update bootstrap.sh
1 parent 0625ded commit 0bf3c08

File tree

4 files changed

+107
-2
lines changed

4 files changed

+107
-2
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
@@ -11,4 +11,7 @@ unclutter -idle 0 &
1111
xrandr --output HDMI-1 --mode 1024x768
1212

1313
# Start browser in kiosk mode
14-
chromium-browser http://localhost:8082 --start-fullscreen --kiosk --incognito --noerrdialogs --no-first-run --disk-cache-dir=/dev/null
14+
#chromium-browser http://localhost:8082 --start-fullscreen --kiosk --incognito --noerrdialogs --no-first-run --disk-cache-dir=/dev/null
15+
16+
# Start nw.js
17+
nwjs ~/nwjs

rpi/bootstrap.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -eu
3+
set -Eeuo pipefail
44

55
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
66

@@ -36,6 +36,7 @@ function installBrowser() {
3636
sudo apt-get install --no-install-recommends -y \
3737
xserver-xorg-video-all xserver-xorg-input-all xserver-xorg-core xinit x11-xserver-utils \
3838
unclutter \
39+
xinput \
3940
chromium-browser
4041

4142
# Enable Auto-Login on console
@@ -49,10 +50,26 @@ function installBrowser() {
4950
cp "${SCRIPT_DIR}/.bash_profile" ~/.bash_profile
5051
}
5152

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+
sudo apt install nw.js-normal
59+
mkdir -p ~/nwjs
60+
cp "${SCRIPT_DIR}/package.json" ~/nwjs
61+
}
62+
63+
function configurePi() {
64+
sudo cp "${SCRIPT_DIR}/config.txt" /boot/config.txt
65+
}
66+
5267
updateSystem
5368
installService
5469
installStatusBoard
5570
installBrowser
71+
install_nwjs
72+
configurePi
5673

5774
echo "You may need to restart the system to apply some settings. Reboot now? (y/n)"
5875
read -r response

rpi/config.txt

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# For more options and information see
2+
# http://rpf.io/configtxt
3+
# Some settings may impact device functionality. See link above for details
4+
5+
# uncomment if you get no picture on HDMI for a default "safe" mode
6+
#hdmi_safe=1
7+
8+
# uncomment the following to adjust overscan. Use positive numbers if console
9+
# goes off screen, and negative if there is too much border
10+
#overscan_left=16
11+
#overscan_right=16
12+
#overscan_top=16
13+
#overscan_bottom=16
14+
15+
# uncomment to force a console size. By default it will be display's size minus
16+
# overscan.
17+
#framebuffer_width=1280
18+
#framebuffer_height=720
19+
20+
# uncomment if hdmi display is not detected and composite is being output
21+
#hdmi_force_hotplug=1
22+
23+
# uncomment to force a specific HDMI mode (this will force VGA)
24+
#hdmi_group=1
25+
#hdmi_mode=1
26+
27+
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
28+
# DMT (computer monitor) modes
29+
#hdmi_drive=2
30+
31+
# uncomment to increase signal to HDMI, if you have interference, blanking, or
32+
# no display
33+
#config_hdmi_boost=4
34+
35+
# uncomment for composite PAL
36+
#sdtv_mode=2
37+
38+
#uncomment to overclock the arm. 700 MHz is the default.
39+
#arm_freq=800
40+
41+
# Uncomment some or all of these to enable the optional hardware interfaces
42+
#dtparam=i2c_arm=on
43+
#dtparam=i2s=on
44+
#dtparam=spi=on
45+
46+
# Uncomment this to enable infrared communication.
47+
#dtoverlay=gpio-ir,gpio_pin=17
48+
#dtoverlay=gpio-ir-tx,gpio_pin=18
49+
50+
# Additional overlays and parameters are documented /boot/overlays/README
51+
52+
# Enable audio (loads snd_bcm2835)
53+
dtparam=audio=on
54+
55+
# Automatically load overlays for detected cameras
56+
#camera_auto_detect=1
57+
58+
# Automatically load overlays for detected DSI displays
59+
display_auto_detect=1
60+
61+
# Enable DRM VC4 V3D driver
62+
dtoverlay=vc4-fkms-v3d
63+
max_framebuffers=2
64+
65+
# Disable compensation for displays with overscan
66+
disable_overscan=1
67+
68+
[cm4]
69+
# Enable host mode on the 2711 built-in XHCI USB controller.
70+
# This line should be removed if the legacy DWC2 controller is required
71+
# (e.g. for USB device mode) or if USB support is not required.
72+
otg_mode=1
73+
74+
[all]
75+
76+
[pi4]
77+
# Run as fast as firmware / board allows
78+
arm_boost=1
79+
80+
[all]
81+
avoid_warnings=1

0 commit comments

Comments
 (0)