-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·60 lines (52 loc) · 1.79 KB
/
run.sh
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
#!/usr/bin/env bash
set -euo pipefail
CONTAINER=iss-display-streamer
readonly CONTAINER
LISTEN_ADDRESS="127.0.0.1"
readonly LISTEN_ADDRESS
VERBOSE=1
readonly VERBOSE
SCRIPT_NAME=$(basename "$0")
readonly SCRIPT_NAME
log() {
if (( 1=="${VERBOSE}" )); then
echo "$@" >&2
fi
logger -p user.notice -t "${SCRIPT_NAME}" "$@"
}
error() {
echo "$@" >&2
logger -p user.error -t "${SCRIPT_NAME}" "$@"
}
if [[ -z $(which podman) ]]; then
if [[ -z $(which docker) ]]; then
error "Could not find container executor."
error "Install either podman or docker"
exit 1
else
executor=docker
log "Using ${executor} to run ${CONTAINER}"
fi
else
executor=podman
log "Using ${executor} to run ${CONTAINER}"
fi
${executor} run -e XDG_RUNTIME_DIR=/tmp \
-e WAYLAND_DISPLAY=wayland-1 \
-e DISPLAY=:0 \
-e WLR_BACKENDS=headless \
-e WLR_LIBINPUT_NO_DEVICES=1 \
-e SWAYSOCK=/tmp/sway-ipc.sock \
-e MOZ_ENABLE_WAYLAND=1 \
-e BROWSER_FULLSCREEN=1 \
-e BROWSER_TABSWITCH_PAUSE=30 \
-e URL="https://bbusse.github.io/analog-digital-clock|\
https://www.rainviewer.com/map.html?loc=50.9307,10.1074,6&oFa=0&oC=1&oU=1&oCS=0&oF=1&oAP=1&c=1&o=100&lm=1&layer=radar&sm=1&sn=1&undefined=0|\
https://upload.wikimedia.org/wikipedia/commons/2/2b/Berlin_U-bahn_und_S-bahn.svg" \
-e STREAM_SOURCE="v4l2" \
-e DEBUG="1" \
-p "${LISTEN_ADDRESS}:5910:5910" \
-p "${LISTEN_ADDRESS}:6000:6000/tcp" \
-p "${LISTEN_ADDRESS}:6000:6000/udp" \
--device /dev/video0:/dev/video0 \
${CONTAINER}