X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=autorandr.py;h=1e980f6f7c0f7bc8f96999e36f5162a3971f5403;hb=HEAD;hp=aa4b8f2483169ac1c38175c7a630c21e462291f3;hpb=1f06c91fa1e28ae4e491c3d690a769a9b5169469;p=deb_pkgs%2Fautorandr.git diff --git a/autorandr.py b/autorandr.py index aa4b8f2..93b4e79 100755 --- a/autorandr.py +++ b/autorandr.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # encoding: utf-8 # # autorandr.py @@ -28,20 +28,30 @@ import binascii import copy import getopt import hashlib +import math import os import posix import pwd import re +import shlex import subprocess import sys import shutil import time +import glob from collections import OrderedDict -from distutils.version import LooseVersion as Version from functools import reduce from itertools import chain + +if sys.version_info.major == 2: + import ConfigParser as configparser +else: + import configparser + +__version__ = "1.14" + try: input = raw_input except NameError: @@ -49,46 +59,106 @@ except NameError: virtual_profiles = [ # (name, description, callback) + ("off", "Disable all outputs", None), ("common", "Clone all connected outputs at the largest common resolution", None), + ("clone-largest", "Clone all connected outputs with the largest resolution (scaled down if necessary)", None), ("horizontal", "Stack all connected outputs horizontally at their largest resolution", None), ("vertical", "Stack all connected outputs vertically at their largest resolution", None), + ("horizontal-reverse", "Stack all connected outputs horizontally at their largest resolution in reverse order", None), + ("vertical-reverse", "Stack all connected outputs vertically at their largest resolution in reverse order", None), +] + +properties = [ + "Colorspace", + "max bpc", + "aspect ratio", + "Broadcast RGB", + "audio", + "non-desktop", + "TearFree", + "underscan vborder", + "underscan hborder", + "underscan", + "scaling mode", ] help_text = """ Usage: autorandr [options] -h, --help get this small help --c, --change reload current setup +-c, --change automatically load the first detected profile +-d, --default make profile the default profile +-l, --load load profile -s, --save save your current setup to profile -r, --remove remove profile --l, --load load profile --d, --default make profile the default profile ---skip-options