#!/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 copy import getopt import binascii import hashlib import os import re import subprocess import sys from distutils.version import LooseVersion as Version from functools import reduce from itertools import chain from collections import OrderedDict import posix 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 -l, --load load profile -d, --default make profile the default profile --skip-options