Two shell scripts to toggle a connected display in and out of a 1920x1080 interlaced broadcast mode on X11. Useful when a capture card, hardware encoder, or downstream broadcast workflow demands a true 1080i signal that the desktop normally won't produce.
The custom modeline uses SMPTE 274M timing (74.25 MHz pixel clock, 1080i60).
- Runs
xrandr --queryand finds every connected output. - If only one is connected, uses it.
- If multiple are connected, prompts you to pick one (
selectmenu). - Registers the
1080i_broadcastmodeline if it isn't already known to X. - Attaches the mode to the chosen output and switches to it.
- Scans
xrandr --queryfor whichever output is currently running1080i_broadcast(the mode line marked with*). - Runs
xrandr --output <that one> --autoto restore its native progressive mode. - Detaches and removes the custom modeline.
No hard-coded output names — both scripts work whether the display is on HDMI-1, HDMI-2, DP-1, etc.
curl -O https://gist.githubusercontent.com/ammmze/b2099fee4fb5fea7977e9a21799c8e55/raw/set_1080i.sh
curl -O https://gist.githubusercontent.com/ammmze/b2099fee4fb5fea7977e9a21799c8e55/raw/reset_display.sh
chmod +x set_1080i.sh reset_display.shMove them anywhere on your $PATH if you'd like (e.g. ~/.local/bin/).
./set_1080i.sh # switch into 1080i broadcast mode
./reset_display.sh # restore normal display modeIn your desktop environment's keyboard settings, add custom shortcuts pointing at the absolute path of each script. Suggested bindings:
| Action | Suggested key |
|---|---|
set_1080i.sh |
Ctrl + Alt + B (Broadcast) |
reset_display.sh |
Ctrl + Alt + P (Progressive) |
- X11 (will not work under Wayland —
xrandrcannot inject modelines on Wayland sessions) xrandr,awk,bash- A GPU driver / display that accepts custom modelines (most Intel/AMD/NVIDIA drivers do; some HDMI sinks reject non-EDID modes)
Ubuntu 26.04's default GNOME desktop is Wayland-only, and Wayland does not support custom xrandr modelines. To use these scripts on a fresh install, switch to an X11-supported desktop session.
XFCE (via Xubuntu) is the lightest option:
sudo apt update
sudo apt install xubuntu-desktopDuring installation you'll be prompted to pick a default display manager. Choose gdm3 (not lightdm) — it handles session switching cleanly and works well alongside the default Ubuntu stack.
KDE works too if you prefer it (sudo apt install kubuntu-desktop).
Reboot. At the login screen:
- Click your username.
- Click the gear / session-picker icon (usually bottom-right).
- Select Xfce Session (or any entry explicitly labeled X11 / on Xorg).
- Log in.
Confirm you're on X11 from a terminal:
pgrep -al XorgIf a real Xorg process is listed, you're on X11 — these scripts will work.
Note:
$XDG_SESSION_TYPEandloginctl show-session ... -p Typeboth frequently reportwaylandon Ubuntu 26.04 even when the actual server is Xorg (gdm3 mis-tags the session). They are unreliable for this check. The only ground truth is which server process is running —XorgvsXwayland. If onlyXwaylandshows up, you logged into a Wayland session; log out and pick the Xfce / Xorg one.
See Install above. From there, set_1080i.sh handles modeline registration, output detection, and switching; you don't need to run any xrandr commands by hand.
If you want 1080i active every time you log in, add a line to ~/.xprofile:
~/path/to/set_1080i.sh- The custom modeline is not persistent across reboots. The
setscript re-registers it on each invocation, so this is fine for normal use. - If your workflow needs 1080i50 (PAL) instead of 1080i60, swap the modeline in
set_1080i.sh— same pixel clock, different horizontal/vertical totals. - If
xrandr --addmodefails withBadMatch, your driver or sink is rejecting the mode; that's a hardware/driver issue, not a script bug.