leftovers:
1) config file path. Has to implement compatibility functionalities before
we can change it.
2) links in man pages. Has to migrate the repo first.
3) _COMPTON_SHADOW, it has become a defacto standard, so we have to keep
supporting it.
4) dbus names, undecided whether we should/could change it.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
compton-convgen: Misc: Clean up. The commit brings no change to the
functionality of the script.
- Partially fix PEP 8 compliance:
- Place imports on separate lines.
- Replace leading tabs with 4 spaces.
- Add docstrings to classes and functions.
- Surround top-level function and class definitions with two blank
lines.
- Remove spaces around keyword arguments.
- Move all statements to separate lines.
- Break some long lines into several lines.
- Remove trailing semicolons after statements.
- CGError: Use functionality from the base class Exception to store the
description, instead of the custom logic.
- CGInternal: Remove, as it is unused.
- Hide the internal function gen_invalid() and args_readfactors() by
prefixing their names with an underscore.
- Move the module-level command-line handling code to two new
functions, _main() and _parse_args(), and only execute if running in
the main scope.
The pipeline used to retrieve the WID of the active window returns a bad WID because xprop returns several hex numbers and ".*" in the sed regex is greedy. For instance, running "xprop -root -notype _NET_ACTIVE_WINDOW" gives me:
_NET_ACTIVE_WINDOW: window id # 0x1a0003d, 0x0
Filtering this output with the sed substitution then gives "0x0", since the first ".*" matches everything up to *the last* hex number.
The fix is simply to grep hex numbers instead of using a sed substitution, and then choose the first one.
- compton-trans: Allow reading opacity value from positional arguments,
like the version in master branch.
- compton-trans: Quit when meeting an unrecognized option.
Rewrite a part of compton-trans in order to provide more friendly
error messages, to support window title that contains spaces, and to
limit the number of xwininfo calls to a constant. Not much tests are
done, and I don't know bash well, so bugs could very well exist.