1
0
Fork 0
mirror of https://github.com/seqizz/autorandr.git synced 2024-09-07 10:30:28 +02:00
Commit graph

435 commits

Author SHA1 Message Date
Gürkan Gür
5d3b326849 Make single-pass default 2021-03-23 19:16:53 +01:00
noughtnaut
be87b8b133 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.
2021-03-23 16:44:46 +01:00
Julian Grinblat
779330942c Add SlackBuild to installation options 2021-03-23 16:44:46 +01:00
Phillip Berndt
9e95d5cc2c 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.

Fixes #227.
2021-03-23 16:44:46 +01:00
Phillip Berndt
6eae3c8bb7 Make setgroups() behaviour Python 2 compatible
This fixes backwards compatibility of the change
2021-03-23 16:44:46 +01:00
Anthony Eadicicco
93c4c02b48 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.
2021-03-23 16:44:46 +01:00
Thomas de Queiroz Barros
501029fd46 Change os.exit to sys.exit
os.exit is not a function in python 3 or 2
2021-03-23 16:44:46 +01:00
Jerzy Drozdz
9cceecde26 Fixed python2 build problem 2021-03-23 16:44:46 +01:00
Jerzy Drozdz
787d2e49d5 rpm spec file update to 1.10.1 2021-03-23 16:44:46 +01:00
Julian Grinblat
2a01a4637b Add a note on udev usage with NVidia cards 2021-03-23 16:44:46 +01:00
Julian Grinblat
328e7894e3 sys.executable can be None too 2021-03-23 16:44:46 +01:00
Julian Grinblat
f806cb4d25 Handle empty sys.executable 2021-03-23 16:44:46 +01:00
Phillip Berndt
490644f8bb Point release 1.10.1
This reverts making autorandr-launcher the default and fixes the most
obvious issues. See #195 for why.
2021-03-23 16:44:46 +01:00
Phillip Berndt
5db5a715eb Fix warning during launcher compilation 2021-03-23 16:44:46 +01:00
Phillip Berndt
09971ff36f Clean up autorandr-launcher build process 2021-03-23 16:44:46 +01:00
Phillip Berndt
9594b701d9 Undo making the launcher the default
See #195
2021-03-23 16:44:46 +01:00
Phillip Berndt
d3811be1fb Adjust launcher autostart file to start in daemon mode
This is part of the fix for #199.
2021-03-23 16:44:46 +01:00
Phillip Berndt
4d68850bce Fix launcher crashing once X session exits
This is part of the fix for #199.
2021-03-23 16:44:46 +01:00
Phillip Berndt
9eb4a790e5 Bump version to 1.10
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
2021-03-23 16:44:46 +01:00
Phillip Berndt
2da7bdb902 Add script order change to README 2021-03-23 16:44:46 +01:00
Phillip Berndt
627eaf985e Search profile directory first for hook scripts
See #194.
2021-03-23 16:44:46 +01:00
Phillip Berndt
7b03b5303c Mention #180 in the README 2021-03-23 16:44:46 +01:00
Phillip Berndt
f76c6c62f9 Fix unnassigned variable issue if one profile is detected
Fixes #190.
2021-03-23 16:44:46 +01:00
Phillip Berndt
a13eba7287 Handle negative gamma values
Fixes #188.
2021-03-23 16:44:46 +01:00
Phillip Berndt
9cc53a2f45 Sort approximate matches in detected profiles by quality of match
See #189
2021-03-23 16:44:46 +01:00
Vincent Bernat
c566fa46a4 contrib: fix saved profile completion 2021-03-23 16:44:46 +01:00
martin f. krafft
40d812dc39 Fix small error
I am pretty sure this should be "docked" instead of "mobile"
2021-03-23 16:44:46 +01:00
Vincent Bernat
eb59840882 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.
2021-03-23 16:44:46 +01:00
Vincent Bernat
ce34e2de04 contrib: zsh completion 2021-03-23 16:44:46 +01:00
Vincent Bernat
029ce622c5 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.
2021-03-23 16:44:46 +01:00
gardar
b81e20b2d3 Fix dash/underscore typo in makefile 2021-03-23 16:44:46 +01:00
Phillip Berndt
bbfe5bc98e Fix two minor issues with the Makefile 2021-03-23 16:44:46 +01:00
Phillip Berndt
cf803a02fd 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.
2021-03-23 16:44:46 +01:00
Phillip Berndt
e12364959b Update README 2021-03-23 16:44:46 +01:00
Jordan Ephron
7a336f270f Don't fail if xrandr reports negative gamma value 2021-03-23 16:44:46 +01:00
Mathis Raguin
6b68ff1675 edit: rename var to found_top_left_monitor
Signed-off-by: Mathis Raguin <mathis@cri.epita.fr>
2021-03-23 16:44:46 +01:00
Mathis Raguin
78602f0947 fix: rework to match phillipberndt algorithm
Signed-off-by: Mathis Raguin <mathis@cri.epita.fr>
2021-03-23 16:44:46 +01:00
Mathis Raguin
a9076e34ee fix: move all output at once as they are enabled
Signed-off-by: Mathis Raguin <mathis@cri.epita.fr>
2021-03-23 16:44:46 +01:00
Mathis Raguin
317f7ca181 fix: output position if xrandr offsetted them
Signed-off-by: Mathis Raguin <mathis@cri.epita.fr>
2021-03-23 16:44:46 +01:00
Phillip Berndt
2dd966438f Version bump: 1.9 2021-03-23 16:44:46 +01:00
Vladimir-csp
3444cb7c28 classes 2021-03-23 16:44:46 +01:00
Vladimir-csp
77d140db7f egrep is deprecated according to manpage
also do classes as in manpage, no double escapes needed
2021-03-23 16:44:46 +01:00
Vladimir-csp
c1be543742 space class and double escapes in unit file 2021-03-23 16:44:46 +01:00
Vladimir-csp
74332fc46f \s does not work inside brackets 2021-03-23 16:44:46 +01:00
Vladimir-csp
2a936f39e4 account for occasional dash prefix, use sh 2021-03-23 16:44:46 +01:00
Vladimir-csp
1aebabf610 account for occasional dash prefix, use sh 2021-03-23 16:44:46 +01:00
Christophe-Marie Duquesne
87d44025dc Improvement of the regex performance for lid monitoring
This version of the regex avoids reading entire lines from the libinput
output, and concentrates on the event field.
2021-03-23 16:44:46 +01:00
Christophe-Marie Duquesne
167c386da9 Adding Christophe-Marie Duquesne to the contributors 2021-03-23 16:44:46 +01:00
Christophe-Marie Duquesne
9ea31b098b Only count a closed lid as disconnected if there are other connected outputs
As per @Vladimir-csp's advice
2021-03-23 16:44:46 +01:00
Christophe-Marie Duquesne
a4a4383f04 adding a lid listener xdg/autostart service 2021-03-23 16:44:46 +01:00