# UNFPA TME

```
╔══════════════════════════════════════════════════════════════════════════════╗
║                                                                              ║
║     ◆     U N F P A   T M E     ◆                                            ║
║                                                                              ║
╚══════════════════════════════════════════════════════════════════════════════╝
```

**United Nations Population Fund**  
*Technical & Monitoring Environment*

---

Raspberry Pi kiosk deployment for **unfpa_tme** — a fullscreen touchscreen display running [TuneMe](https://tuneme.org) with automated display management, screensavers, and kiosk hardening.

## Overview

This repository contains the configuration, scripts, and assets used to operate the UNFPA TME kiosk node. The system boots into a locked-down Chromium session pointed at `https://tuneme.org/#/home`, with HDMI auto-detection, idle video screensavers, and browser extensions to keep the kiosk stable in production.

## Host

| | |
|---|---|
| **Hostname** | `unfpa_tme` |
| **Platform** | Raspberry Pi (Debian 13 / aarch64) |
| **Display** | Fullscreen HDMI kiosk |

## Repository Structure

```
unfpa_tme/
├── mkiosk/                  # Kiosk display, screensaver & boot scripts
│   ├── auto-display-setup.sh
│   ├── failover.sh
│   └── screensaver/
├── fixes/
│   └── tab-blocker/         # Chromium extension (tab blocking, popup bypass)
├── capture_logs.py          # DevTools log capture utility
├── combine.py               # Compose UNFPA + TuneMe background image
├── dump_dom.py              # DOM inspection utility
├── inspect.py               # Page inspection utility
├── unfpa.jpeg               # UNFPA branding asset
├── tuneme.jpeg              # TuneMe branding asset
└── new_background.png       # Composed kiosk background
```

## Features

- **Fullscreen kiosk mode** — Chromium launches on boot in `--kiosk` against TuneMe
- **HDMI auto-detection** — resolves output and preferred resolution via `xrandr`
- **Idle screensaver** — video screensaver when the display is idle
- **Kiosk helper extension** — blocks tabs, bypasses popups, filters content on `tuneme.org`
- **Failover & watchdog scripts** — keep the display session running

## Getting Started

### Clone

```bash
git clone git@github.com:catchupweb/unfpa_tme.git
cd unfpa_tme
```

### Kiosk setup

The main entry point for the display is:

```bash
./mkiosk/auto-display-setup.sh
```

This script waits for X11, detects HDMI, sets resolution, and launches Chromium in kiosk mode.

### Screensaver

Scripts under `mkiosk/screensaver/` handle idle detection and video playback. See `mkiosk/screensaver/TWEAKING_GUIDE.md` for tuning options.

### Browser extension

Load `fixes/tab-blocker/` as an unpacked Chromium extension to enable kiosk hardening on TuneMe.

## Utilities

| Script | Purpose |
|---|---|
| `combine.py` | Builds a 1920×1080 background from `unfpa.jpeg` and `tuneme.jpeg` |
| `capture_logs.py` | Captures browser console logs via Chrome DevTools WebSocket |
| `dump_dom.py` | Dumps page DOM for debugging |
| `inspect.py` | Inspects page elements |

## Author

**Catchupweb**  
📧 [nsanasey@catchupweb.co.za](mailto:nsanasey@catchupweb.co.za)