-
Notifications
You must be signed in to change notification settings - Fork 0
/
kiosk
executable file
·92 lines (81 loc) · 1.89 KB
/
kiosk
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
#!/bin/bash
# interactive only (prevent start over ssh)
# [[ $- != *i* ]] && return
DIR="$(dirname "$(readlink -f "$0")")"
#
# DEFAULT CONFIG
#
URL="https://hemisphere-project.com"
ROTATE="0" # 0, 90, 180, 270
REFLECT="n" # n, x, y, xy
WINDOW=0 # 0, 1
NOCURSOR="" # "", -nocursor
EXTRA="" # ""
#
# CMD LINE OVERWRITE
#
while [[ $# -gt 0 ]]; do
case $1 in
-u|--url)
URL="$2"
shift # past argument
shift # past value
;;
-r|--rotate)
ROTATE="$2"
shift # past argument
shift # past value
;;
-m|--reflect)
REFLECT="$2"
shift # past argument
shift # past value
;;
-d|--devtools)
DEV=1
shift # past argument
;;
-c|--nocursor)
NOCURSOR="-nocursor"
shift # past argument
;;
-e|--extra)
EXTRA="$2"
shift # past argument
shift # past value
;;
-h|--help)
echo "Usage: kiosk [options]"
echo " "
echo "Options:"
echo " -u, --url <url> URL to load"
echo " -r, --rotate <deg> Rotate screen (0, 90, 180, 270)"
echo " -m, --reflect <mode> Reflect screen (n, x, y, xy)"
echo " -c, --nocursor Hide cursor"
echo " -d, --devtools Show devtools"
echo " -e, --extra <args> Extra chromium flags"
echo " -h, --help Show this help"
echo " "
shift # past argument
;;
*)
echo "Unknown argument $1"
echo "See kiosk --help for more info."
exit 1
;;
esac
done
LOADER_URL=file://${DIR}/loader.html#${URL}
# exit 0
# echo $URL
# echo $ROTATE
# echo $REFLECT
# echo $WINDOW
# echo $NOCURSOR
# echo $LOADER_URL
#INFO
echo " "
echo ".:: HKiosk ::."
echo " "
XAUTHORITY=/tmp/.Xauthority KIOSK_URL=$LOADER_URL KIOSK_ROTATE=$ROTATE KIOSK_REFLECT=$REFLECT KIOSK_DEV=$DEV KIOSK_EXTRA=$EXTRA startx -- $NOCURSOR
logout