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.
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.
Fixes#227.
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.
Changes since 1.9:
* *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
Fixes#191
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.
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.
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.