Phillip Berndt [Thu, 16 Dec 2021 09:14:19 +0000 (10:14 +0100)]
Fix mtime updating for --cycle
mtime updating resulted in --cycle always switching between the two most
recently used profiles. Invert the sort order if --cycle is in use to
mitigate.
Johannes Lange [Mon, 11 Jan 2021 16:47:03 +0000 (17:47 +0100)]
--list option: list configuration
- lists (all) configurations
- can be used with --curent and --detected
- in contrast to no arguments at all, it does not print decorations like "(detected)", "(current)", ...
Kevin Lyda [Sun, 11 Jul 2021 13:48:05 +0000 (14:48 +0100)]
Explain where files are saved
For people who manage their home directories with things like vcsh or
other versioning system, it's good to know where configuration files
live. This CL adds a FILES section to the man page.
Simon Piriou [Mon, 17 May 2021 09:52:46 +0000 (11:52 +0200)]
Add an option to match profiles based on edid
In some cases the display names change so the profile matching fails.
This commit introduces the "--match-edid" option, that allows one to
specify that the profiles matching should be done based on display edid.
This is done by updating the profiles after loading, based on current
display name/edid mapping requested using xrandr.
noughtnaut [Mon, 30 Nov 2020 23:21:05 +0000 (00:21 +0100)]
Reword README regarding environment variables
This clarifies the usage somewhat, without needing changes to existing
functionality. I may look into reworking the variables, but until then
this will be an improvement. That is to say, this is meant to NOT
resolve issue #230.
- Add section heading for variables
- Move `predetect`/`sleep` example up above new section
- Add example usage of variable, and explain the oddity with 'current'
profile during preswitch.
Phillip Berndt [Sun, 15 Nov 2020 15:32:28 +0000 (16:32 +0100)]
Release 1.11
This updates the readme with changes since 1.10.1 and releases 1.11.
This version primarily brings small bugfixes, only change warranting
minor version bump is that batch mode now assigns user groups.
In batch mode, set groups to group membership of target user.
Previously, group list was cleared during privilege de-escalation. This causes
profiles scripts to be run as the local user with an empty group list. This can
cause issues when, eg, the 'video' group is required for backlight control,
and the user is trying to invoke xbacklight from postswitch.sh.
* *2020-04-23* Fix hook script execution order to match description from readme
* *2020-04-11* Handle negative gamma values (fixes #188)
* *2020-04-11* Sort approximate matches in detected profiles by quality of match
* *2020-01-31* Handle non-ASCII environment variables (fixes #180)
* *2019-12-31* Fix output positioning if the top-left output is not the first
* *2019-12-31* Accept negative gamma values (and interpret them as 0)
* *2019-12-31* Prefer the X11 launcher over systemd/udev configuration
Vincent Bernat [Thu, 16 Jan 2020 10:42:06 +0000 (11:42 +0100)]
Handle non-ASCII environment variable values
When a process has an UTF-8 character in its environment, autorandr
crashes with:
```
Unhandled exception ('utf-8' codec can't decode byte 0xab in position 0: invalid start byte). Please report this as a bug at https://github.com/phillipberndt/autorandr/issues.
Traceback (most recent call last):
File "./autorandr.py", line 1439, in <module>
exception_handled_main()
File "./autorandr.py", line 1423, in exception_handled_main
main(sys.argv)
File "./autorandr.py", line 1203, in main
dispatch_call_to_sessions([x for x in argv if x != "--batch"])
File "./autorandr.py", line 1110, in dispatch_call_to_sessions
for environ_entry in open(environ_file).read().split("\0"):
File "/usr/lib/python3.7/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xab in position 0: invalid start byte
```
Instead, we read the environment without decoding and convert to ASCII
explicitely. Any environment variable not decodable will just be
skipped.
Vincent Bernat [Thu, 16 Jan 2020 10:48:59 +0000 (11:48 +0100)]
Fork and exec using the current Python interpreter
When testing against various versions of Python by invoking autorandr
with an explicit Python interpreter, in batch mode, autorandr will
reexecute itself without specifying the Python interpreter. This
change makes sure it is reexecuted using the current Python
interpreter.
Phillip Berndt [Tue, 31 Dec 2019 10:41:27 +0000 (11:41 +0100)]
Prefer X11 launcher (like srandr) over udev/systemd setup
See #162. The X11 launcher, that waits for randr events in X11 and runs
autorandr manually, proved to be more reliable than the setup using udev
and systemd. Make it the default.