Kiosk Machine
This is a work in progress i.e. I am starting with a locked-down account and working towards a final kiosk deployment.
Two scripts will be created in the process and can be stored in /usr/local/bin.
I am trying to achieve this using PoPOS! with Firefox as the default browser, using duckduckgo as the start-up page and default search engine. The duckduckgo Firefox extension is also installed.
Create a script to run Firefox in full screen mode, opening duckduckgo's homepage in private mode.
I also set the Firefox settings so that no passwords are saved and everything is cleared on exit. ******************
#!/bin/bash
firefox -private-window "https://www.duckduckgo.com" &
while ! xdotool search --onlyvisible --class "firefox"; do
sleep 21
done
xdotool key F11 #xdotool needs to ne installed for this to work
To run the script at startup,login, login as the default user, press Alt + F2 and run gnome-session-properties.
Click on “Add”, name browse to the script and save.
Have the laptop reboot every 10min
#!/bin/bash
# Get idleIdle time in milliseconds idle_time=(10 minutes)
IDLE_TIME=$((10 * 60 * 1000))
while true; do
idle=$(xprintidle) #xprintidle needs to be installed
# Convert idle time to minutes
idle_minutes=$((idle_time / 60000))
# Check if idle time is greater than or equal to 10 minutes
if [ "$idle_minutes"idle" -ge 10"$IDLE_TIME" ]; then
shutdown -r
fi
sleep 60
done
Both the above scripts need to be made executable and stored in /usr/local/bin.executable.
chmod +x filename.shWe now need to set up the cron job to check for the idle time
crontab -eand add the following line so that it runs every minute
* * * * * /path/to/idle-reboot.sh #path and file name of idle script
Using OverlayRoot any changes will be lost when the system reboots.
sudo apt-get install overlayroot
then
sudo nano /etc/overlayroot.conf
and add
overlayroot="tmpfs"
Now reboot.
To disable overlayroot, comment out the above line
#overlayroot="tmpfs"
and then run
sudo update-initramfs -u
Now reboot