Mirror external HDMI/monitor output onto primary display automatically

Openbox autostart now detects any connected output beyond the primary and mirrors the kiosk content onto it via xrandr, instead of leaving detected-but-unused external displays dark. Also documents the behavior, its limitation (applies at session start, not live hotplug), and adds an HDMI troubleshooting section to the README.
This commit is contained in:
Claude
2026-08-02 22:34:19 +00:00
parent b5d37fa646
commit 68a7345f5b
2 changed files with 29 additions and 1 deletions
+18 -1
View File
@@ -378,6 +378,21 @@ id kiosk
sudo -u kiosk DISPLAY=:0 xdpyinfo sudo -u kiosk DISPLAY=:0 xdpyinfo
``` ```
**External monitor/TV (HDMI) shows nothing:**
```bash
# List outputs and check if the external display is detected
sudo -u kiosk DISPLAY=:0 XAUTHORITY=/home/kiosk/.Xauthority xrandr
# Look for your output (e.g. HDMI1/HDMI2/HDMI-1) as "connected" with a mode list.
# If it's "connected" but not active, autostart should mirror it automatically on
# next login/boot. To apply immediately without rebooting:
sudo systemctl restart lightdm
# To test mirroring manually right now (replace names with what xrandr showed):
sudo -u kiosk DISPLAY=:0 XAUTHORITY=/home/kiosk/.Xauthority xrandr --output HDMI2 --auto --same-as eDP1
```
If the output shows `disconnected`, it's a cabling/port/EDID issue, not software — try a different cable/port or a monitor known to work.
**Audio not working:** **Audio not working:**
```bash ```bash
# Check PipeWire (use menu: Advanced → Audio Diagnostics) # Check PipeWire (use menu: Advanced → Audio Diagnostics)
@@ -1122,6 +1137,7 @@ See the LICENSE file in the repository for full terms.
**Current Version:** 1.0.3 **Current Version:** 1.0.3
**Recent Updates (v1.0.3):** **Recent Updates (v1.0.3):**
- **HDMI/external display mirroring:** autostart now detects any connected display beyond the primary (e.g. HDMI-out to a monitor/TV) and mirrors the kiosk output onto it automatically — previously the external output was left inactive even when detected by X
- **Package install:** installer now also installs `net-tools` and `ncdu` (alongside the already-installed `curl` and `git`) - **Package install:** installer now also installs `net-tools` and `ncdu` (alongside the already-installed `curl` and `git`)
- **Touch input fix (keyring):** added `--password-store=basic` to the Electron launch. Under LightDM autologin the GNOME keyring stays locked; when Chromium accessed it, the keyring unlock dialog grabbed all keyboard/touch input — the kiosk rendered fine but ignored every tap and keypress. This flag stops Electron from using the keyring, so the dialog never appears. - **Touch input fix (keyring):** added `--password-store=basic` to the Electron launch. Under LightDM autologin the GNOME keyring stays locked; when Chromium accessed it, the keyring unlock dialog grabbed all keyboard/touch input — the kiosk rendered fine but ignored every tap and keypress. This flag stops Electron from using the keyring, so the dialog never appears.
- **Touch gesture fix (libinput):** any touch screen is now forced to the `libinput` driver via `/etc/X11/xorg.conf.d/99-finger-libinput.conf` (matched by hardware capability, so it works on any brand and never affects keyboards, mice, or the pen/stylus). Some drivers — notably `wacom` — only do single-touch pointer emulation and never pass real multitouch to Chromium, so 1-finger and 2-finger swipe gestures could not fire. libinput delivers proper multitouch. - **Touch gesture fix (libinput):** any touch screen is now forced to the `libinput` driver via `/etc/X11/xorg.conf.d/99-finger-libinput.conf` (matched by hardware capability, so it works on any brand and never affects keyboards, mice, or the pen/stylus). Some drivers — notably `wacom` — only do single-touch pointer emulation and never pass real multitouch to Chromium, so 1-finger and 2-finger swipe gestures could not fire. libinput delivers proper multitouch.
@@ -1164,7 +1180,8 @@ See the LICENSE file in the repository for full terms.
**Known Limitations:** **Known Limitations:**
- Raspberry Pi support untested in production - Raspberry Pi support untested in production
- No web-based configuration (CLI menu only) - No web-based configuration (CLI menu only)
- Single display only (extended desktop not supported) - Extended desktop not supported — additional connected displays (e.g. HDMI-out to a monitor/TV) are automatically **mirrored**, not extended
- Display mirroring is applied at kiosk session start only — plugging in a display after boot requires restarting the display (`sudo systemctl restart lightdm`) or logging back in for it to pick up the new output
--- ---
+11
View File
@@ -7392,6 +7392,17 @@ TOUCHCFG
sudo -u "$KIOSK_USER" tee "$KIOSK_HOME/.config/openbox/autostart" > /dev/null <<'AUTOSTART' sudo -u "$KIOSK_USER" tee "$KIOSK_HOME/.config/openbox/autostart" > /dev/null <<'AUTOSTART'
#!/bin/bash #!/bin/bash
# Mirror any connected external display (e.g. HDMI-out to a monitor/TV) onto
# the primary display so the kiosk content shows on both.
PRIMARY_OUTPUT=$(xrandr --query | awk '/ primary/{print $1; exit}')
if [ -n "$PRIMARY_OUTPUT" ]; then
for OUT in $(xrandr --query | awk '/ connected/{print $1}'); do
if [ "$OUT" != "$PRIMARY_OUTPUT" ]; then
xrandr --output "$OUT" --auto --same-as "$PRIMARY_OUTPUT" 2>/dev/null
fi
done
fi
# AGGRESSIVE DPMS disable - multiple methods # AGGRESSIVE DPMS disable - multiple methods
xset s off xset s off
xset s noblank xset s noblank