Commit Graph

468 Commits

Author SHA1 Message Date
Kevin Lyda
5a4888ea78 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.
2021-08-18 12:38:01 +02:00
Florian Schmaus
4f010c576b autorandr.service: Use StartLimitIntervalSec
It's time that we use StartLimitIntervalSec as even Debian stable has
a recent enough systemd version.
2021-06-25 16:31:50 +02:00
Jerzy Drozdz
0d46eee394 Updated spec file 2021-06-09 22:33:15 +02:00
noughtnaut
7b7c05316e 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.
2020-12-01 11:36:46 +01:00
Julian Grinblat
cc731e35ef Add SlackBuild to installation options 2020-11-15 18:03:03 +01:00
Phillip Berndt
43af27a051 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.
2020-11-15 16:32:28 +01:00
Phillip Berndt
4693203165 Make setgroups() behaviour Python 2 compatible
This fixes backwards compatibility of the change
2020-10-09 16:16:51 +02:00
Anthony Eadicicco
26985aef96 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-10-09 16:16:51 +02:00
Thomas de Queiroz Barros
b890915df3 Change os.exit to sys.exit
os.exit is not a function in python 3 or 2
2020-08-24 21:01:55 +02:00
Jerzy Drozdz
b03c205a8c Fixed python2 build problem 2020-06-26 10:20:22 +02:00
Jerzy Drozdz
abee187c0f rpm spec file update to 1.10.1 2020-06-26 10:20:22 +02:00
Julian Grinblat
8cd356eaf1 Add a note on udev usage with NVidia cards 2020-06-26 10:19:10 +02:00
Julian Grinblat
a5994d5014 sys.executable can be None too 2020-06-26 10:18:49 +02:00
Julian Grinblat
df568a1622 Handle empty sys.executable 2020-06-26 10:18:49 +02:00
Phillip Berndt
c84bf4811f Point release 1.10.1
This reverts making autorandr-launcher the default and fixes the most
obvious issues. See #195 for why.
2020-05-04 09:23:05 +02:00
Phillip Berndt
c7186f509f Fix warning during launcher compilation 2020-05-04 09:20:49 +02:00
Phillip Berndt
73d7e36a2d Clean up autorandr-launcher build process 2020-05-04 09:20:25 +02:00
Phillip Berndt
8da5b1dc0b Undo making the launcher the default
See #195
2020-05-04 09:19:53 +02:00
Phillip Berndt
42104bf719 Adjust launcher autostart file to start in daemon mode
This is part of the fix for #199.
2020-05-04 08:58:08 +02:00
Phillip Berndt
dfb37523e3 Fix launcher crashing once X session exits
This is part of the fix for #199.
2020-05-04 08:57:53 +02:00
Phillip Berndt
76a229a5e7 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
2020-04-25 09:49:51 +02:00
Phillip Berndt
cc124f1d47 Add script order change to README 2020-04-23 16:02:34 +02:00
Phillip Berndt
5c346a2362 Search profile directory first for hook scripts
See #194.
2020-04-23 15:39:42 +02:00
Phillip Berndt
8617589114 Mention #180 in the README 2020-04-13 13:33:30 +02:00
Phillip Berndt
db90c119af Fix unnassigned variable issue if one profile is detected
Fixes #190.
2020-04-13 13:29:50 +02:00
Phillip Berndt
cde6a0e940 Handle negative gamma values
Fixes #188.
2020-04-11 14:14:53 +02:00
Phillip Berndt
0bbdbd0b1a Sort approximate matches in detected profiles by quality of match
See #189
2020-04-11 14:12:36 +02:00
Vincent Bernat
0ebfa82c7d contrib: fix saved profile completion 2020-01-31 11:41:08 +01:00
martin f. krafft
22d9431a86 Fix small error
I am pretty sure this should be "docked" instead of "mobile"
2020-01-31 08:44:47 +01:00
Vincent Bernat
5fd4907089 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.
2020-01-31 08:43:33 +01:00
Vincent Bernat
08d9b4f72d contrib: zsh completion 2020-01-31 08:40:07 +01:00
Vincent Bernat
bb7ba305c0 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.
2020-01-16 12:12:56 +01:00
Phillip Berndt
7bdc2c1979
Merge pull request #176 from gardar/patch-1
Fix dash/underscore typo in makefile
2020-01-02 18:06:25 +01:00
gardar
aa7f536331
Fix dash/underscore typo in makefile 2020-01-02 17:04:49 +00:00
Phillip Berndt
4452340c52 Fix two minor issues with the Makefile 2019-12-31 11:43:50 +01:00
Phillip Berndt
e1c85639c3 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.
2019-12-31 11:41:27 +01:00
Phillip Berndt
de9d7c6b0b Update README 2019-12-31 11:12:42 +01:00
Jordan Ephron
2bd9faadcd Don't fail if xrandr reports negative gamma value 2019-12-31 11:05:00 +01:00
Mathis Raguin
9f4fc9fbe7 edit: rename var to found_top_left_monitor
Signed-off-by: Mathis Raguin <mathis@cri.epita.fr>
2019-12-31 11:02:31 +01:00
Mathis Raguin
fa32200a9c fix: rework to match phillipberndt algorithm
Signed-off-by: Mathis Raguin <mathis@cri.epita.fr>
2019-12-31 11:02:31 +01:00
Mathis Raguin
3c4441a95f fix: move all output at once as they are enabled
Signed-off-by: Mathis Raguin <mathis@cri.epita.fr>
2019-12-31 11:02:31 +01:00
Mathis Raguin
e987251c21 fix: output position if xrandr offsetted them
Signed-off-by: Mathis Raguin <mathis@cri.epita.fr>
2019-12-31 11:02:31 +01:00
Phillip Berndt
ad32e62cd9 Version bump: 1.9 2019-12-19 12:45:43 +01:00
Phillip Berndt
854bba6ba9
Merge pull request #171 from Vladimir-csp/patch-2
Further fixes
2019-11-14 08:03:34 +01:00
Vladimir-csp
bc77e56be7
classes 2019-11-14 00:49:33 +03:00
Vladimir-csp
4ed7fa9b24
egrep is deprecated according to manpage
also do classes as in manpage, no double escapes needed
2019-11-14 00:48:46 +03:00
Vladimir-csp
14baee8f70
space class and double escapes in unit file 2019-11-14 00:42:26 +03:00
Vladimir-csp
5891767a88
\s does not work inside brackets 2019-11-14 00:41:38 +03:00
Phillip Berndt
2a121899d4
Merge pull request #170 from Vladimir-csp/patch-2
regexp and shell
2019-11-13 22:22:20 +01:00
Vladimir-csp
72c208a520
account for occasional dash prefix, use sh 2019-11-13 22:40:27 +03:00