I'm creating a simple device with a Raspberry Pi and a touchscreen display connected to it.
On boot, I want to show a loading image (a simple gif or jpg) while X is starting. Then a chromium-browser instance will be started in kiosk mode showing my web-app.
What I have done
I created a simple script which shows the splashscreen using
fbi(as suggested in this answer):#! /bin/sh ### BEGIN INIT INFO # Provides: splashscreen.sh # Required-Start: # Required-Stop: # Should-Start: # Default-Start: S # Default-Stop: 5 # Short-Description: Show custom splashscreen # Description: Show custom splashscreen ### END INIT INFO do_start () { fbi -T 1 -noverbose -a /home/splash.jpg exit 0 } case "$1" in start|"") do_start ;; restart|reload|force-reload) echo "Error: argument '$1' not supported" >&2 exit 3 ;; stop) # No-op ;; status) exit 0 ;; *) echo "Usage: asplashscreen [start|stop]" >&2 exit 3 ;; esacI added a simple script which starts
Xandchromium:#!/bin/bash ### BEGIN INIT INFO # Provides: myapp.sh # Required-Start: # Required-Stop: # Should-Start: # Should-Stop: # Default-Start: 5 # Default-Stop: # Short-Description: Avvia l'applicazione # Description: Avvia l'applicazione ### END INIT INFO if [ $1 == "start" ] then echo "Starting X server - $(date)" sudo X -nocursor >/dev/null 2>&1 & echo "Waiting X server start - $(date)" while [ ! -x /tmp/.X11-unix/X0 ]; do sleep 0.001 done echo "Starting chromium-browser - $(date)" sudo DISPLAY=:0 chromium-browser --noerrdialogs --disable-pinch --kiosk --start-full-screen --incognito http://localhost >/dev/null 2>&1 & exit 0 fi
Everything works fine, except that the splash screen disappears as soon as the sudo X -nocursor >/dev/null 2>&1 & command is run, which makes the screen black until X ends loading (and chromium appears).
I also created a simple python script which starts again fbi, but it is hidden almost immediately.
So, how can I show the loading image while X loads in the "background"?
Any advice is accepted. My goal is to give the best experience to the user (in fact, I've hidden all of the console messages).
Consider that I'm using jessie-lite on Raspberry Pi 3 Model B.
Thank you!