-
Notifications
You must be signed in to change notification settings - Fork 0
/
openbox-chromium
111 lines (96 loc) · 3.76 KB
/
openbox-chromium
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Disable any form of screen saver / screen blanking / power management
xset s off
xset s noblank
xset -dpms
POINTER_XID=$(xinput -list | grep "pointer" | grep -v vc4 | grep -v "Virtual" | cut -f 2 | cut -d "=" -f 2)
echo "POINTER_XID: $POINTER_XID"
# Rotate
KIOSK_ROTATE=${KIOSK_ROTATE:-"0"}
xrandr
if [ "$KIOSK_ROTATE" = "90" ]; then
xrandr -o right
xinput set-prop $POINTER_XID 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1
elif [ "$KIOSK_ROTATE" = "180" ]; then
xrandr | grep ' connected' | cut -f 1 -d ' ' | while read display; do xrandr --output $display --set TearFree on; done
xrandr -o inverted
xinput set-prop $POINTER_XID 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1
elif [ "$KIOSK_ROTATE" = "270" ]; then
xrandr -o left
xinput set-prop $POINTER_XID 'Coordinate Transformation Matrix' 0 -1 1 1 0 0 0 0 1
else # 0
xrandr -o normal
xinput set-prop $POINTER_XID 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
fi
# Flip
KIOSK_REFLECT=${KIOSK_REFLECT:-"n"}
if [ "$KIOSK_REFLECT" = "x" ]; then
xrandr -x
xinput set-prop $POINTER_XID 'Coordinate Transformation Matrix' -1 0 1 0 1 0 0 0 1
elif [ "$KIOSK_REFLECT" = "y" ]; then
xrandr -y
xinput set-prop $POINTER_XID 'Coordinate Transformation Matrix' 1 0 0 0 -1 1 0 0 1
elif [ "$KIOSK_REFLECT" = "xy" ]; then
xrandr -x -y
xinput set-prop $POINTER_XID 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1
fi
# FORCE 1080p
xrandr -s 1920x1080
# xrandr -o inverted
# xinput set-prop 'ELAN Touchscreen' 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1
# https://gist.github.com/mildmojo/48e9025070a2ba40795c
# Allow quitting the X server with CTRL-ATL-Backspace
setxkbmap -option terminate:ctrl_alt_bksp
# Start Chromium in kiosk mode
sed -i 's/\"exited_cleanly\":false/\"exited_cleanly\":true/' ~/.config/chromium/'Local State'
sed -i 's/\"exited_cleanly\":false/\"exited_cleanly\":true/; s/\"exit_type\":\"[^\"]\+\"/\"exit_type\":\"Normal\"/' ~/.config/chromium/Default/Preferences
KIOSK_URL=${KIOSK_URL:-"http://hemisphere-project.com"}
# Toggle fullscreen kiosk or windowed mode with devtools
KIOKS_ARG=""
if [ "$KIOSK_DEV" = "1" ]; then
KIOSK_ARG="--auto-open-devtools-for-tabs"
else
KIOSK_ARG="--kiosk"
fi
# Extra flags
if [ -n "$KIOSK_EXTRA" ]; then
KIOSK_ARG="$KIOSK_ARG $KIOSK_EXTRA"
fi
chromium \
--no-first-run \
--test-type \
--start-maximized \
--window-position=0,0 \
--window-size=1920,1080 \
--disable \
--disable-translate \
--disable-infobars \
--disable-suggestions-service \
--disable-save-password-bubble \
--disable-session-crashed-bubble \
--disable-features=OptimizationGuideModelDownloading,OptimizationHintsFetching,OptimizationTargetPrediction,OptimizationHints,Translate \
--deny-permission-prompts \
--disable-search-geolocation-disclosure \
--disable-web-security \
--disable-site-isolation-trials \
--simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT' \
--ignore-certificate-errors \
--disable-component-update \
--noerrdialogs \
--allow-browser-signin=false \
--overscroll-history-navigation=0 \
--enable-offline-auto-reload \
--enable-accelerated-video-decode \
--enable-gpu-rasterization \
--enable-unsafe-webgpu \
--ignore-gpu-blocklist \
--enable-zero-copy \
--enable-features=CanvasOopRasterization,EnableDrDc \
--incognito \
--no-sandbox \
--test-type \
--user-data-dir="/tmp" \
--autoplay-policy=no-user-gesture-required \
--enable-logging=stderr --v=1 --log-level=0 \
${KIOSK_ARG} \
"$KIOSK_URL" \
> /data/var/chromium/log.txt 2>&1