#!/usr/bin/env python # encoding: utf-8 # # autorandr.py # Copyright (c) 2015, Phillip Berndt # # Autorandr rewrite in Python # # This script aims to be fully compatible with the original autorandr. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # from __future__ import print_function import binascii import copy import getopt import hashlib import os import posix import pwd import re import subprocess import sys import shutil import time from collections import OrderedDict from distutils.version import LooseVersion as Version from functools import reduce from itertools import chain try: input = raw_input except NameError: pass virtual_profiles = [ # (name, description, callback) ("common", "Clone all connected outputs at the largest common resolution", None), ("horizontal", "Stack all connected outputs horizontally at their largest resolution", None), ("vertical", "Stack all connected outputs vertically at their largest resolution", None), ] help_text = """ Usage: autorandr [options] -h, --help get this small help -c, --change reload current setup -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