\b \? \+ \| are GNU extensions to sed
In BRE (Basic Regular Expressions) there is no \? \+ or \|
In ERE (Extended Regular Expressions) there is ? + and |
To specify sed to use ERE, specify the -E flag.
GNU grep does not distinguish between BRE and ERE, but other
implementations do. To make grep use ERE instead of BRE, specify
the -E flag.
The GNU extension \b has no equivalent in either BRE or ERE.
So, in line number 216, I used the whole initial expected output.
For quick reference (n/a means 'not available') -
GNU BRE | POSIX BRE | POSIX ERE
-------------------------------
\( | \( | (
\) | \) | )
\? | \{0,1\} | ? or {0,1}
\+ | \{1,\} | + or {1,}
\| | n/a | |
\b | n/a | n/a
Two problems:
1) the regex used to match the wid in the window tree can match the wid
appearing in window titles as well.
2) instead of picking the parent window of the target window to set
transparency, a random window which is listed just below the target
window will be chosen. not sure why was there a + 1.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
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.