84 lines
3.7 KiB
Docker
84 lines
3.7 KiB
Docker
FROM ubuntu:oracular
|
|
ENV url=https://google.de
|
|
ENV xrandr_conf="--mode 1920x1080 --rate 60"
|
|
# Decrease number of pacakges
|
|
RUN apt-get update && \
|
|
DEBIAN_FRONTEND='noninteractive' apt-get install -y --no-install-recommends xserver-xorg-video-all \
|
|
xserver-xorg-input-all xserver-xorg-core xinit x11-xserver-utils \
|
|
chromium-browser unclutter fbset
|
|
|
|
#apt-get install -y --no-install-recommends xorg xserver-xorg-input-evdev xserver-xorg-input-all
|
|
|
|
RUN DEBIAN_FRONTEND='noninteractive' apt-get install -y --no-install-recommends wget gnupg2 x11-utils tzdata
|
|
#RUN DEBIAN_FRONTEND='noninteractive' apt-get install -y --no-install-recommends unclutter xinit x11-xserver-utils
|
|
|
|
# TODO: keyboard should be configurable in runtime
|
|
# TODO: actually move all input related functionality to separate layer
|
|
#RUN printf "\
|
|
#Section \"ServerFlags\"\n\
|
|
# Option \"AutoAddDevices\" \"False\"\n\
|
|
#EndSection\n\
|
|
#\n\
|
|
#Section \"ServerLayout\"\n\
|
|
# Identifier \"Desktop\"\n\
|
|
# InputDevice \"Mouse0\" \"CorePointer\"\n\
|
|
# InputDevice \"Keyboard0\" \"CoreKeyboard\"\n\
|
|
#EndSection\n\
|
|
#\n\
|
|
#Section \"InputDevice\"\n\
|
|
# Identifier \"Keyboard0\"\n\
|
|
# Option \"CoreKeyboard\"\n\
|
|
# Option \"Device\" \"/dev/input/event4\"\n\
|
|
# Driver \"evdev\"\n\
|
|
#EndSection\n\
|
|
#\n\
|
|
#Section \"InputDevice\"\n\
|
|
# Identifier \"Mouse0\"\n\
|
|
# Driver \"mouse\"\n\
|
|
# Option \"Protocol\" \"auto\"\n\
|
|
# Option \"Device\" \"/dev/input/mice\"\n\
|
|
# Option \"ZAxisMapping\" \"4 5 6 7\"\n\
|
|
#EndSection\n\
|
|
#" > /etc/X11/xorg.conf.d/10-input.conf
|
|
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
|
|
RUN sh -c 'echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
|
|
RUN apt-get update
|
|
RUN DEBIAN_FRONTEND='noninteractive' apt-get install -y --no-install-recommends google-chrome-stable
|
|
RUN DEBIAN_FRONTEND='noninteractive' apt-get install -y -f
|
|
|
|
RUN printf "\
|
|
#xrandr \n\
|
|
#xrandr --addmode VGA-0 1200x900_60.00\n\
|
|
#xrandr --output default --gamma 0:0:0 --mode 1200x1000\n\
|
|
#rm -rf /tmp/* \n\
|
|
OUTPUT=\`xrandr -display :0 -q | sed '/ connected/!d;s/ .*//;q'\`\n\
|
|
while [ -z "\${OUTPUT}" ] \n\
|
|
do \n\
|
|
echo \"No display connected. Wait 10 Sec\" \n\
|
|
sleep 10 \n\
|
|
OUTPUT=\`xrandr -display :0 -q | sed '/ connected/!d;s/ .*//;q'\`\n\
|
|
done \n\
|
|
#xrandr -display :0 --output \$OUTPUT --set \"Broadcast RGB\" \"Full\"\n\
|
|
#xsetroot #000000\n\
|
|
#GEO="$(fbset -s | awk '$1 == "geometry" { print $2":"$3 }')" \n\
|
|
#fbset -s \n\
|
|
xrandr --output \$OUTPUT \$xrandr_conf \n\
|
|
export WIDTH=\$(xrandr --current | grep ' connected ' | cut -d ' ' -f 3 | cut -d '+' -f 1 | cut -d'x' -f1) \n\
|
|
export HEIGHT=\$(xrandr --current | grep ' connected ' | cut -d ' ' -f 3 | cut -d '+' -f 1 | cut -d'x' -f2) \n\
|
|
#vsize=`xdpyinfo | sed -n '/dimensions/s/[^0-9]*\([0-9]*\)x\([0-9]*\).*/\1/p'` \n\
|
|
#hsize=`xdpyinfo | sed -n '/dimensions/s/[^0-9]*\([0-9]*\)x\([0-9]*\).*/\2/p'` \n\
|
|
#xrandr | grep \* | sed -n 's/[^0-9]*\([0-9]*\)x\([0-9]*\).*/\2/p' \n\
|
|
#xdpyinfo | awk '/dimensions:/ { print $2; exit }' \n\
|
|
xset -dpms \n\
|
|
xset s off \n\
|
|
xset s noblank \n\
|
|
#echo "Resolution: \$WIDTH,\$HEIGHT" \n\
|
|
unclutter & \n\
|
|
google-chrome --no-sandbox --window-position=0,0 --window-size=\$WIDTH,\$HEIGHT --start-maximized --no-default-browser-check --start-fullscreen --kiosk --noerrdialogs --no-first-run --disable-infobars --incognito --overscroll-history-navigation=0 --disable-pinch --disable-translate --fast --fast-start --disable-features=TranslateUI --password-store=basic --app="\$url"\n\
|
|
" > /usr/local/bin/chrome-kiosk-wrapper
|
|
|
|
RUN chmod +x /usr/local/bin/chrome-kiosk-wrapper
|
|
|
|
CMD rm -rf /tmp/.X0-lock && /usr/bin/xinit /usr/local/bin/chrome-kiosk-wrapper -- :0 -nolisten tcp vt1
|
|
#cmd sleep infinity
|