5

I have a 2 display setup. When I have something full screen on one screen (such as a game or a movie), I often want to black out the other screen so that it's not a distraction. Is there any easy way to quickly black out one of the two screens, without going into system settings and disabling that screen entirely (which causes all of its windows to be relocated, etc.)?

4

Use xrandr to pick out the monitor you want to dim (I'm assuming the secondary monitor, if not remove the ^):

$ xrandr | awk '/ connected [^p]/{print $1}'
HDMI2

Then use it to set that display's brightness off:

xrandr --output HDMI2 --brightness 0 

You can set it to 1 to make it visible again:

xrandr --output HDMI2 --brightness 1

xrandr's output is of the form:

Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 32767 x 32767
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm
   1920x1080      60.0*+
... 
   720x400        70.1  
DP1 disconnected (normal left inverted right x axis y axis)
HDMI2 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 476mm x 267mm
   1920x1080      60.0*+   50.0     59.9  
   1920x1080i     60.1     50.0     60.0  
...
   720x400        70.1  
DP2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

So I'm looking for a display with connected, but not followed by primary in the description.

| improve this answer | |
  • Wow, great answer! It works perfectly. Thank you. – Mark E. Haase Nov 18 '14 at 21:44
  • Thanks for another great answer. However after blanking the primary screen LVDS1 you can't unblank it because you can't see it. As such I've assigned keyboard shortcuts to blank it <super>+B and unblank it <super>+U. – WinEunuuchs2Unix Oct 30 '16 at 19:00

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.