From: Phillip Berndt Date: Thu, 16 Dec 2021 09:59:16 +0000 (+0100) Subject: Merge broadcast_rgb feature (#204) X-Git-Tag: 1.12~4 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6b814e115768437778816483dd239774dddb14ee;hp=c1c074ab894f517d4f5194de3359c213e50fb9f0;p=deb_pkgs%2Fautorandr.git Merge broadcast_rgb feature (#204) --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a01ee28 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.*.swp diff --git a/README.md b/README.md index daa6b38..4060529 100644 --- a/README.md +++ b/README.md @@ -147,9 +147,20 @@ names in your configuration directory to have autorandr use any of them as the default configuration without you having to change the system-wide configuration. -You can store default values for any option in an INI-file in -`~/.config/autorandr/settings.ini` in a section `config`. The most useful -candidate for doing that is `skip-options`, if you need it. +You can store default values for any option in an INI-file located at +`~/.config/autorandr/settings.ini`. In a `config` section, you may place any +default values in the form `option-name=option-argument`. + +A common and effective use of this is to specify default `skip-options`, for +instance skipping the `gamma` setting if using +[`redshift`](https://github.com/jonls/redshift) as a daemon. To implement +the equivalent of `--skip-options gamma`, your `settings.ini` file should look +like this: + +``` +[config] +skip-options=gamma +``` ## Advanced usage @@ -238,6 +249,11 @@ options nvidia_drm modeset=1 ## Changelog +**autorandr 1.12** +* *2021-12-16* Switch default interpreter to Python 3 +* *2021-12-16* Add `--list` to list all profiles +* *2021-12-16* Add `--cycle` to cycle all detected profiles + **autorandr 1.11** * *2020-05-23* Handle empty sys.executable * *2020-06-08* Fix Python 2 compatibility diff --git a/autorandr.1 b/autorandr.1 index d268822..d20264b 100644 --- a/autorandr.1 +++ b/autorandr.1 @@ -38,6 +38,9 @@ List only the current (active) configuration(s) .BR \-\-config Dump the variable values of your current xrandr setup .TP +.BR \-\-cycle +Cycle through all detected profiles +.TP .BR \-\-debug Enable verbose output .TP @@ -50,14 +53,31 @@ Don't change anything, only print the xrandr commands .BR \-\-fingerprint Fingerprint the current hardware setup .TP +.BR \-\-match-edid +Match displays based on edid instead of name +.TP .BR \-\-force Force loading or reloading of a profile .TP +.BR \-\-list +List all profiles +.TP \fB\-\-skip\-options [\fIOPTION\fR] ... \fRSet a comma\-separated list of xrandr arguments to skip both in change detection and profile application. See \fBxrandr(1)\fR for xrandr arguments. .TP .BR \-\-version Show version information and exit +.SH FILES +Configuration files are searched for in the \fIautorandr +\fRdirectory in the colon separated list of paths in \fI$XDG_CONFIG_DIRS +\fR- or in \fI/etc/xdg +\fRif that var is not set. They are then looked for in \fI~/.autorandr +\fRand if that doesn't exist, in \fI$XDG_CONFIG_HOME/autorandr +\fRor in \fI~/.config/autorandr\fR if that var is unset. + +In each of those directories it looks for directories with \fIconfig\fR and +\fIsetup\fR in them. It is best to manage these files with the +\fBautorandr\fR utility. .SH AUTHOR \fRPhillip Berndt .br diff --git a/autorandr.py b/autorandr.py index f47a994..ec159bf 100755 --- a/autorandr.py +++ b/autorandr.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # encoding: utf-8 # # autorandr.py @@ -39,10 +39,14 @@ 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: @@ -90,11 +94,14 @@ Usage: autorandr [options] --batch run autorandr for all users with active X11 sessions --current only list current (active) configuration(s) --config dump your current xrandr setup +--cycle automatically load the next detected profile --debug enable verbose output --detected only list detected (available) configuration(s) --dry-run don't change anything, only print the xrandr commands --fingerprint fingerprint your current hardware setup +--match-edid match diplays based on edid instead of name --force force (re)loading of a profile / overwrite exiting files +--list list configurations --skip-options