Tuesday, August 9, 2011

re-enable second monitor in linux after it goes blank

solution:



  1. if your resolution was also changed, restore the original resolution:
    xrandr -s 0

  2. re-enable your second monitor:
    xrandr --auto

  3. restore any special setup. for example, I have my second monitor to the right of my first, extending my desktop. this is what I did to get it to work:
    xrandr --auto --output DFP2 --right-of DFP1



DFP1 and DFP2 are the names of my monitors, so that command probably won't work for you. in order to get the names of your monitors, in a terminal, run this command to list the connected monitors:
xrandr -q | grep " connected"

if you run this command before you run xrandr --auto, your disabled monitor should show up in the list without a resolution. for example, in my case DFP2 is the name of the disabled monitor:
$ xrandr -q | grep " connected"
DFP1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 473mm x 296mm
DFP2 connected (normal left inverted right x axis y axis)


to get the possible options for the --output parameter, just run xrandr --help to list them all.


details:



I have a dual-monitor linux setup, and in particular when running full-screen apps using Wine, my second monitor will go blank. once I close the app, my second monitor stays blank, and all my windows are moved to the first monitor.

up to this point I've been too lazy to figure out how to re-enable my second monitor, and I'd just reboot, which always fixes it. today I finally took the time to figure it out.

of course the best solution to any problem is preventing it in the first place. here's a great article I found on preventing this while I was looking for a solution to my problem:

How to Run Fullscreen Games In Linux With Dual Monitors

0 comments:

Post a Comment