How to black out screen when watching video/playing game on other screen?

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.)?


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.