X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=autorandr.py;h=7ad9736b136f516a7f0309a3b80b17f907b53809;hb=530cc6a39d363cb532572c1cd3ef05c0b5ddd1e2;hp=fbc1445bf09e015e2214a7a4c4d53f438fa54a16;hpb=6a99c52215e2d7504aff6cb38af5ea1dd87a5173;p=deb_pkgs%2Fautorandr.git diff --git a/autorandr.py b/autorandr.py index fbc1445..7ad9736 100755 --- a/autorandr.py +++ b/autorandr.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # encoding: utf-8 # # autorandr.py @@ -36,12 +36,24 @@ 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 +try: + from packaging.version import Version +except ModuleNotFoundError: + from distutils.version import LooseVersion as Version + +if sys.version_info.major == 2: + import ConfigParser as configparser +else: + import configparser + +__version__ = "1.11" + try: input = raw_input except NameError: @@ -49,6 +61,7 @@ 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), @@ -59,38 +72,48 @@ 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