#!/bin/sh
# First login: open the Welcome app (theme, Wi-Fi, save-to-USB persistence, installer, tips).
# Booted with "Install Moodtop to this computer" (moodtop.install): open the installer straight away.
# Welcome can be re-run any time from the launcher. On a live USB without persistence the
# home directory is fresh every boot, so Welcome shows again until the student saves to USB.
if grep -qw moodtop.install /proc/cmdline; then
  sleep 4
  exec mood-install
fi
flag="$HOME/.config/mood/firstrun-done"
[ -f "$flag" ] && exit 0
mkdir -p "$(dirname "$flag")" && touch "$flag"
sleep 3
exec mood-launch welcome
