{
    "sourceFile": "pi-setup.sh",
    "activeCommit": 0,
    "commits": [
        {
            "activePatchIndex": 0,
            "patches": [
                {
                    "date": 1748356106533,
                    "content": "Index: \n===================================================================\n--- \n+++ \n"
                }
            ],
            "date": 1748356106533,
            "name": "Commit-0",
            "content": "#!/bin/bash\n\necho \"🍓 Adhaan Raspberry Pi Kiosk Setup\"\necho \"==================================\"\n\n# Update systeem\necho \"📦 Systeem bijwerken...\"\nsudo apt update -y\nsudo apt upgrade -y\n\n# Installeer Docker\necho \"🐳 Docker installeren...\"\ncurl -fsSL https://get.docker.com -o get-docker.sh\nsudo sh get-docker.sh\nsudo usermod -aG docker $USER\nrm get-docker.sh\n\n# Installeer Docker Compose\necho \"🔧 Docker Compose installeren...\"\nsudo apt install -y docker-compose\n\n# Installeer GUI componenten voor kiosk mode\necho \"🖥️  GUI componenten installeren...\"\nsudo apt install -y --no-install-recommends \\\n    xserver-xorg \\\n    x11-xserver-utils \\\n    xinit \\\n    openbox \\\n    chromium-browser \\\n    unclutter\n\n# Maak kiosk script\necho \"📝 Kiosk script aanmaken...\"\ncat > /home/$USER/kiosk.sh << 'EOF'\n#!/bin/bash\nsleep 5\n/usr/bin/chromium-browser \\\n    --kiosk \\\n    --start-maximized \\\n    --noerrdialogs \\\n    --disable-infobars \\\n    --disable-session-crashed-bubble \\\n    --disable-restore-session-state \\\n    --disable-background-timer-throttling \\\n    --disable-backgrounding-occluded-windows \\\n    --disable-renderer-backgrounding \\\n    --disable-features=TranslateUI \\\n    --disable-ipc-flooding-protection \\\n    --enable-features=OverlayScrollbar \\\n    --no-first-run \\\n    --fast \\\n    --fast-start \\\n    --disable-default-apps \\\n    --disable-popup-blocking \\\n    --disable-prompt-on-repost \\\n    --disable-hang-monitor \\\n    --disable-background-networking \\\n    --aggressive-cache-discard \\\n    --memory-pressure-off \\\n    --max_old_space_size=100 \\\n    --force-device-scale-factor=1 \\\n    http://localhost:5090 &\nEOF\n\nchmod +x /home/$USER/kiosk.sh\n\n# Configureer autostart\necho \"⚙️  Autostart configureren...\"\nsudo mkdir -p /etc/xdg/openbox\ncat > /tmp/autostart << 'EOF'\n# Schakel power management uit\nxset -dpms\nxset s noblank\nxset s off\n\n# Verberg cursor na 3 seconden\nunclutter -idle 3 -root &\n\n# Verwijder crash berichten\nsed -i 's/\"exited_cleanly\":false/\"exited_cleanly\":true/' ~/.config/chromium/'Local State' 2>/dev/null || true\nsed -i 's/\"exited_cleanly\":false/\"exited_cleanly\":true/; s/\"exit_type\":\"[^\"]\\+\"/\"exit_type\":\"Normal\"/' ~/.config/chromium/Default/Preferences 2>/dev/null || true\n\n# Start kiosk\n/home/USER_PLACEHOLDER/kiosk.sh\nEOF\n\nsed \"s/USER_PLACEHOLDER/$USER/g\" /tmp/autostart | sudo tee /etc/xdg/openbox/autostart > /dev/null\n\n# Configureer automatische X start\necho \"🚀 Automatische X start configureren...\"\nif ! grep -q \"startx\" ~/.bash_profile 2>/dev/null; then\n    echo '[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx -- -nocursor' >> ~/.bash_profile\nfi\n\n# Configureer automatische login\necho \"👤 Automatische login configureren...\"\nsudo raspi-config nonint do_boot_behaviour B4\n\n# Maak systemd service voor Docker\necho \"🔄 Docker service configureren...\"\ncat > /tmp/adhan-docker.service << 'EOF'\n[Unit]\nDescription=Adhaan Docker Services\nRequires=docker.service\nAfter=docker.service\n\n[Service]\nType=oneshot\nRemainAfterExit=yes\nWorkingDirectory=/home/USER_PLACEHOLDER/adhan\nExecStart=/usr/bin/docker-compose -f docker-compose-pi.yml up -d\nExecStop=/usr/bin/docker-compose -f docker-compose-pi.yml down\nTimeoutStartSec=0\n\n[Install]\nWantedBy=multi-user.target\nEOF\n\nsed \"s/USER_PLACEHOLDER/$USER/g\" /tmp/adhan-docker.service | sudo tee /etc/systemd/system/adhan-docker.service > /dev/null\nsudo systemctl enable adhan-docker.service\n\necho \"✅ Setup voltooid!\"\necho \"\"\necho \"📋 Volgende stappen:\"\necho \"1. Herstart de Pi: sudo reboot\"\necho \"2. De Pi start automatisch in kiosk mode\"\necho \"3. Docker containers starten automatisch\"\necho \"4. Webpagina opent automatisch op http://localhost:5090\"\necho \"\"\necho \"🔧 Handmatige bediening:\"\necho \"- Alt+F4: Sluit browser\"\necho \"- Ctrl+Alt+T: Open terminal\"\necho \"- sudo systemctl status adhan-docker: Check Docker status\" "
        }
    ]
}