Make commands independent of location on system
It helps running autorandr_nitrogen_wallpaper on systems without
/bin/bash, /usr/bin/unlink, /bin/cp and /bin/mv. E.g. NixOS, which
doesn't have /bin/bash.
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.
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.
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.
On ZSH the easiest approach to get bash completions running is to use
`bashcompinit`. Unfortunately it seems as there are slight differences
between ZSH and bash which cause problems when using that feature.
I had to change the following things:
* Replace the `-n` check with a length check of the AR directory array:
ZSH adds an empty string at first if no system directory for autorandr
was found. Checking if there's at least a single element works around
this problem.
* Silence errors from `find`. The empty string at first causes a
`directory not found error` during the completion.
It can be tested on ZSH after running the following command:
```
$ autoload -U +X bashcompinit && bashcompinit && source ./contrib/bash_completion/autorandr
```
Tested with zsh 5.7.1 (x86_64-pc-linux-gnu).
This prevents the udev rule to run autorandr once per monitor added or
removed, instead of once per change -- this is relevant, e.g., if a
notebook is (dis-)connected to/from a docking station.