Coverage for lutris.util.display : 50%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]
""" Return list of tuples containing output name and geometry """
for output in get_outputs(): if output[0] != display: subprocess.Popen("xrandr --output %s --off" % output[0], shell=True)
"""Return the list of supported screen resolutions."""
"""Return the current resolution for the desktop.""" resolution = list() for line in iter_xrandr_output(): if line.startswith(" ") and "*" in line: resolution.append(line.split()[0]) if monitor == 'all': return resolution else: return resolution[monitor]
""" Change display resolution. Takes a string for single monitors or a list of displays as returned by get_outputs() """ if isinstance(resolution, basestring): logger.debug("Switching resolution to %s", resolution)
if resolution not in get_resolutions(): logger.warning("Resolution %s doesn't exist." % resolution) else: subprocess.Popen("xrandr -s %s" % resolution, shell=True) else: print resolution for display in resolution: display_name = display[0] display_geom = display[1] logger.debug("Switching to %s on %s", display[1], display[0]) display_resolution = display_geom.split('+')[0]
cmd = "xrandr --output %s --mode %s" % (display_name, display_resolution)
subprocess.Popen(cmd, shell=True).communicate() cmd = "xrandr --output %s --panning %s" % (display_name, display_geom) logger.debug(cmd) subprocess.Popen(cmd, shell=True)
"""Restore the desktop to its original state.""" #Restore resolution resolution = get_resolutions()[0] change_resolution(resolution) #Restore gamma os.popen("xgamma -gamma 1.0") |