41 Commits

Author SHA1 Message Date
Subhaditya Nath
24b4450726 picom-trans: Added SPDX-License-Identifier 2021-07-23 21:15:53 +01:00
Subhaditya Nath
084b670f6a Rewrite picom-trans
Rewrite picom-trans (#634)

Notable changes:

* Support arguments like `--arg=val`
* Allow trailing %-signs in opacity
* Improve error message
* Improve compatibility across different shells
2021-07-22 21:26:17 +01:00
Subhaditya Nath
5394b2c2bc picom-trans: remove a no-longer-needed workaround 2021-05-31 12:32:15 +05:30
Subhaditya Nath
df1c6159fc picom-trans: Use POSIX-compatible getopts 2021-05-31 12:27:20 +05:30
Subhaditya Nath
7b4af3aef6 picom-trans: Use POSIX-compatible sed, grep
\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
2021-05-31 12:14:19 +05:30
Bernd Busse
a854acc2d0 picom-trans: add --toggle action to toggle between set opacity and unset.
Fixes: #472
2020-10-22 23:06:17 +02:00
Bernd Busse
c9ccd8fb71 picom-trans: Add inline --help output and update manpage
Fixes: #513
2020-10-22 22:53:02 +02:00
Yuxuan Shui
5207996232 picom-trans: fixes when setting transparency with window id
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>
2020-08-25 19:21:31 +01:00
Yuxuan Shui
8ddbebb5d1 rename: replace "compton" in the codebase
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>
2019-10-23 20:24:20 +01:00
Yuxuan Shui
cdcdda8ed8 Remove compton-convgen.py
We have better blur configuration built into the compositor by now.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-10-22 20:32:43 +01:00
Antonin Décimo
8366310daf Fix small misspellings 2019-01-28 10:58:14 +01:00
Scott Leggett
d458369f1d Replace "bashism" with POSIX syntax. 2018-04-16 10:13:55 -04:00
Richard Grenville
f1cd308cde compton-convgen: Misc: Clean up
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.
2016-08-10 23:53:41 +08:00
Corax26
e4c0b8301d Fix compton-trans -c
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.
2015-03-26 01:31:00 +01:00
Richard Grenville
d717411687 Misc #177: Clarify the message about missing xwininfo/xprop
Clarify the message about missing xwininfo/xprop. (#177)
2014-02-25 22:13:43 +08:00
Richard Grenville
9a45338254 Misc: Small fix for regex in compton-trans 2013-05-11 08:13:06 +08:00
Richard Grenville
1cb6058732 Merge pull request #108 from chjj/compton_trans
compton-trans improvements
2013-05-10 16:58:20 -07:00
Christopher Jeffrey
a9a3b015e1 compton-trans: ensure wid format. misc.
xwininfo falls back to cursor selection if the window ID is formatted
improperly.
2013-05-04 21:07:42 -05:00
Christopher Jeffrey
216441c7b0 compton-trans: add reset option. 2013-05-04 20:40:01 -05:00
Christopher Jeffrey
7c451c10f7 compton-trans: allow long option names. 2013-05-04 20:39:08 -05:00
Christopher Jeffrey
b0db9f4f07 Revert "compton-trans: use getopt instead of getopts."
This reverts commit 80a3c80561.
2013-05-04 18:14:41 -05:00
Christopher Jeffrey
80a3c80561 compton-trans: use getopt instead of getopts. 2013-05-04 17:51:00 -05:00
Christopher Jeffrey
c9bf88cc89 compton-trans: use a different workaround with getopts. 2013-05-04 17:50:31 -05:00
Christopher Jeffrey
e6b973fe2f compton-trans: minor. consistency. 2013-05-04 16:54:18 -05:00
Christopher Jeffrey
ad23872801 compton-trans: add a 'get' option. 2013-05-04 16:51:24 -05:00
Christopher Jeffrey
86b20e0a08 compton-trans: improve option parsing. 2013-05-04 16:20:18 -05:00
Christopher Jeffrey
25d31a1f5e compton-trans: cleanup. add remove-prop option. 2013-05-04 13:50:36 -05:00
Christopher Jeffrey
054d343622 compton-trans: more consistency. 2013-05-04 13:36:24 -05:00
Christopher Jeffrey
9a4d202f5d compton-trans: consistency, better bash practices, refactor. 2013-05-04 13:18:04 -05:00
Richard Grenville
a3f6f4442b Improvement: Add predefined blur kernels
- Add a few predefined blur kernels, requested by jerri in #104.

- Add compton-convgen.py to generate blur kernels.
2013-04-29 22:42:46 +08:00
hasufell
85e561283e don't depend on bash, our script is POSIX anyway 2013-01-28 17:31:16 +01:00
Richard Grenville
62ea373ee5 Merge branch 'master' into richardgv-dev
Conflicts:
	bin/compton-trans
	man/compton-trans.1

- Add some explaination in README.md.

- Rename CMakeLists.txt to _CMakeLists.txt to avoid confusion.
2012-11-14 18:46:26 +08:00
Richard Grenville
fd9c9ba38d Misc: compton-trans: Allow reading opacity from positional arguments
- compton-trans: Allow reading opacity value from positional arguments,
  like the version in master branch.

- compton-trans: Quit when meeting an unrecognized option.
2012-11-14 18:17:32 +08:00
Richard Grenville
ce7f686f9e Misc: compton-trans: Performance optimization
Reduce abundant calls to xwininfo in compton-trans further. Helpful for
performance but you can't expect too much from a bash script anyway.
2012-11-11 13:02:14 +08:00
Richard Grenville
59d6979612 Bug fix: compton-trans -s does not work
My silly mistake. :-)
2012-11-09 00:03:22 +08:00
Christopher Jeffrey
c883cdec3e compton-trans: add error handling. better option parsing. 2012-11-08 09:21:57 -06:00
Richard Grenville
08ca5b4d1e Bug fix #62: Rewrite a part of compton-trans
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.
2012-11-08 22:37:31 +08:00
Christopher Jeffrey
2a566e83a7 rename settrans to compton-trans, add manpage. 2012-06-23 17:39:49 -05:00
Christopher Jeffrey
84b7c3e65d minor settrans changes 2012-05-27 19:21:14 -05:00
Christopher Jeffrey
d52f7a06db refactor settrans 2012-04-01 00:01:31 -05:00
Christopher Jeffrey
8f4eafaf79 reorganize tree 2012-02-27 05:22:33 -06:00