def postInstall(fromVersion, fromRelease, toVersion, toRelease): if "0.90" <= fromVersion <= "0.96": from zorg import config busId = call("zorg", "Xorg.Display", "activeDeviceID") device = config.getDeviceInfo(busId) if device: config.saveDeviceInfo(device) config.saveXorgConfig(device)
def postInstall(fromVersion, fromRelease, toVersion, toRelease): if fromVersion and Version("0.90") <= Version(fromVersion) <= Version("0.96"): from zorg import config busId = call("zorg", "Xorg.Display", "activeDeviceID") device = config.getDeviceInfo(busId) if device: config.saveDeviceInfo(device) config.saveXorgConfig(device)
def postInstall(fromVersion, fromRelease, toVersion, toRelease): if fromVersion and Version("0.90") <= Version(fromVersion) <= Version("0.96"): from zorg import config busId = call("zorg", "Xorg.Display", "activeDeviceID") device = config.getDeviceInfo(busId) if device: config.saveDeviceInfo(device) config.saveXorgConfig(device) if fromRelease and int(fromRelease) < 81: from zorg import config layout, variant = config.getKeymapOld() config.saveKeymap(layout, variant)
def postInstall(fromVersion, fromRelease, toVersion, toRelease): enabledPackage = "/var/lib/zorg/enabled_package" if os.path.exists(enabledPackage) and file(enabledPackage).read() == "ati-drivers": call("ati_drivers", "Xorg.Driver", "enable") if fromVersion and Version(fromVersion) < Version("9.3"): from zorg import config busId = call("zorg", "Xorg.Display", "activeDeviceID") device = config.getDeviceInfo(busId) if device: device.probe_result["flags"] = "randr12" config.saveDeviceInfo(device) config.saveXorgConfig(device)
def postInstall(fromVersion, fromRelease, toVersion, toRelease): if fromVersion and Version("0.90") <= Version(fromVersion) <= Version( "0.96"): from zorg import config busId = call("zorg", "Xorg.Display", "activeDeviceID") device = config.getDeviceInfo(busId) if device: config.saveDeviceInfo(device) config.saveXorgConfig(device) if fromRelease and int(fromRelease) < 81: from zorg import config layout, variant = config.getKeymapOld() config.saveKeymap(layout, variant)
def postInstall(fromVersion, fromRelease, toVersion, toRelease): enabledPackage = "/var/lib/zorg/enabled_package" if os.path.exists(enabledPackage) and file( enabledPackage).read() == "ati-drivers": call("ati_drivers", "Xorg.Driver", "enable") if fromVersion and Version(fromVersion) < Version("9.3"): from zorg import config busId = call("zorg", "Xorg.Display", "activeDeviceID") device = config.getDeviceInfo(busId) if device: device.probe_result["flags"] = "randr12" config.saveDeviceInfo(device) config.saveXorgConfig(device)
def getDeviceOptions(busId, options): dev = getDeviceInfo(busId) if not dev: return options ignoredDisplays = [] enabledDisplays = [] horizSync = [] vertRefresh = [] metaModes = [] rotation = "" orientation = "" order = "" for name, output in dev.outputs.items(): if output.ignored: ignoredDisplays.append(name) continue if output.enabled: enabledDisplays.append(name) else: continue if name in dev.monitors: mon = dev.monitors[name] horizSync.append("%s: %s" % (name, mon.hsync)) vertRefresh.append("%s: %s" % (name, mon.vref)) if output.mode: if output.refresh_rate: metaModes.append("%s: %s_%s" % (name, output.mode, output.refresh_rate)) metaModes.append("%s: %s" % (name, output.mode)) else: metaModes.append("%s: nvidia-auto-select" % name) if output.rotation and not rotation: rotation = output.rotation if output.right_of: orientation = "%s RightOf %s" % (name, output.right_of) order = "%s, %s" % (output.right_of, name) elif output.below: orientation = "%s Below %s" % (name, output.below) order = "%s, %s" % (output.below, name) if ignoredDisplays: options["IgnoreDisplayDevices"] = ", ".join(ignoredDisplays) if horizSync: options["HorizSync"] = "; ".join(horizSync) options["VertRefresh"] = "; ".join(vertRefresh) if metaModes: options["MetaModes"] = ", ".join(metaModes) if rotation: options["Rotate"] = rotation if orientation: options["TwinView"] = "True" options["TwinViewOrientation"] = orientation options["TwinViewXineramaInfoOrder"] = order elif len(enabledDisplays) > 1: options["TwinView"] = "True" options["TwinViewOrientation"] = "%s Clone %s" % tuple(enabledDisplays[:2]) return options