Skip to content

HanryYu/monitor-input-switch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monitor Input Switch

Screenshot

A GNOME Shell extension that switches an external monitor's input source via ddcutil. Lives in the Quick Settings panel.

Features:

  • Switch to HDMI (0x11), DisplayPort (0x0f), USB-C (0x1b) via DDC/CI VCP code 0x60
  • Choose one target monitor if multiple detected
  • Customize which inputs to show

Requirements

  • GNOME Shell 48, 49, or 50
  • ddcutil installed (which ddcutil to check) and ddcutil detect should list your monitor

Install

From Gnome Extensions (Recommended)

Coming soon.

From Latest GitHub Release

  1. Download the latest release from Releases.

  2. Install the extension:

    gnome-extensions install -f ~/Downloads/monitor-input-switch@nemofq.github.io.zip
  3. Restart the session by logging out.

  4. Enable the extension in Extension Manager or by running:

    gnome-extensions enable monitor-input-switch@nemofq.github.io

Troubleshooting

Screen hang during detection

Cause: ddcutil detect performs kernel-level I2C operations that can freeze the desktop on some hardware.

Mitigations:

  • Sysfs pre-check before ddcutil detect: We read /sys/class/drm/*/status to check if any external display is connected. If none, we skip ddcutil detect entirely.
  • --disable-dynamic-sleep on ddcutil detect: Prevents ddcutil from progressively extending sleep intervals on unresponsive buses.

GNOME startup / hotplug race conditions

Cause: During GNOME Shell startup and after display hotplug events, the compositor is still negotiating with monitors. Sending ddcutil commands during this window can race with the DRM subsystem and leave the desktop in a broken state.

Mitigations:

  • 30-second buffer before scanning: Both the first scan (after startup-complete) and scans triggered by monitors-changed wait 30 seconds to let hardware fully settle and avoid firing during hotplug event bursts.

Contributing

Feel free to submit an issue or pull request.

Acknowledgments

Thanks to these projects for the ideas and groundwork that made this extension possible.

License

MIT

About

GNOME extension for switching external monitor input sources via ddcutil

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%