I'm running Fedora 20 on a small Openbox setup that I'm fond of. I sometimes want to send things through a second display, e.g. plugging into a projector or a television. Given the pretty spartan nature of an Openbox session, just plugging in the HDMI cable (and turning on the display at the other end) gives me nothing; there's no obvious sign that the machine has found another display.

My problem isn't terribly technical; I can get things to work: the current workaround is to stop my session, dropping myself back to the GDM greeter, whereupon the screen blacks out for an instant and the laptop recognizes the display, allowing me to work across the two screens concurrently. I can then log back into Openbox and continue as cleared. This has obvious drawbacks, like requiring I drop all my work and re-login every time I want to watch something on a bigger screen.

My goal is to be able to "hotplug" a display and have my Openbox session adapt immediately to the two-screen setup, whether by some magical GNOME daemon or other trickery unknown to me. How should I approach this?

  • I'm inclined to say this is a duplicate question, except that I would like to leave the first portion of my answer, which is essentially to use xrandr to avoid logging out. I have moved the second part to the more appropriate question at unix.stackexchange.com/a/171916/87728 – iyrin Dec 7 '14 at 6:25
  • I have not tested the particulars, but reading this and the linked question, I'm convinced this is the right vector to explore. Thank you! – Kalvin Lee Dec 7 '14 at 7:25

xrandr1 may be the solution you are looking for so that you don't need to log out/log in.

From How to use xrandr:

The old days where you had to restart X when plugging a new monitor are gone. With RandR 1.2, you can plug/unplug monitors whenever you want. Running the following line will query all outputs and enable them with their default mode:

$ xrandr --auto

Ideally, the default config works for you. Otherwise, configure xrandr as needed. This is probably a good enough solution for most people to start using the display without logging out.

For details on automatically detecting when the monitor is plugged in, I have added an answer2 to the existing thread A tool for automatically applying RandR configuration when external display is plugged in

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.