Skip to content

Commit

Permalink
rename: replace "compton" in the codebase
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
yshui committed Oct 23, 2019
1 parent ed6a96d commit 8ddbebb
Show file tree
Hide file tree
Showing 33 changed files with 172 additions and 139 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ jobs:
command: ninja -vC build test
- run:
name: test config file parsing
command: xvfb-run -s "-screen 0 640x480x24" build/src/compton --config compton.sample.conf --vsync=none --diagnostics
command: xvfb-run -s "-screen 0 640x480x24" build/src/picom --config picom.sample.conf --no-vsync --diagnostics
- run:
name: run testsuite
command: tests/run_tests.sh build/src/compton
command: tests/run_tests.sh build/src/picom
- run:
name: generate coverage reports
command: cd build; find -name '*.gcno' -exec gcov -pb {} +
Expand Down
14 changes: 7 additions & 7 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
### Environment
<!-- Tell us something about the desktop environment you are using, for example: i3-gaps, Gnome Shell, etc. -->

### Compton version
<!-- Put the output of `compton --version` here. -->
<!-- If you are running compton v4 or later, please also include the output of `compton --diagnostics` -->
### picom version
<!-- Put the output of `compton --version` or `picom --version` here. -->
<!-- If you are running compton v4 or later, please also include the output of `compton --diagnostics` or `picom --diagnostics` -->
<!-- Example: v1 -->

### Compton configuration:
### Configuration:
```
// Paste your configuration here
```
Expand All @@ -38,12 +38,12 @@

### Stack trace
<!--
If compton crashes, please make sure your compton is built with debug info, and provide a stack trace of compton when it crashed.
Note, when compton crashes in a debugger, your screen might look frozen. But gdb will likely still handle your input if it is focused.
If the compositor crashes, please make sure you built it with debug info, and provide a stack trace captured when it crashed.
Note, when the compositor crashes in a debugger, your screen might look frozen. But gdb will likely still handle your input if it is focused.
Often you can use 'bt' and press enter to get the stack trace, then 'q', enter, 'y', enter to quit gdb.
-->

<!-- Or, you can enable core dump, and upload the core file and the compton executable here. -->
<!-- Or, you can enable core dump, and upload the core file with the corresponding executable here. -->

### Other details
<!-- If your problem is visual, you are encouraged to record a short video when the problem occurs and link to it here. -->
28 changes: 16 additions & 12 deletions bin/compton-trans → bin/picom-trans
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
#!/bin/sh

#
# compton-trans
# picom-trans
# transset in a bash script
# Copyright (c) 2011-2012, Christopher Jeffrey
#

# Usage:
# $ compton-trans [options] [+|-]opacity
# $ picom-trans [options] [+|-]opacity
# By window id
# $ compton-trans -w "$WINDOWID" 75
# $ picom-trans -w "$WINDOWID" 75
# By name
# $ compton-trans -n "urxvt" 75
# $ picom-trans -n "urxvt" 75
# By current window
# $ compton-trans -c 75
# $ picom-trans -c 75
# By selection
# $ compton-trans 75
# $ compton-trans -s 75
# $ picom-trans 75
# $ picom-trans -s 75
# Increment current window 5%
# $ compton-trans -c +5
# $ picom-trans -c +5
# Delete current window's opacity
# $ compton-trans -c --delete
# $ picom-trans -c --delete
# Reset all windows
# $ compton-trans --reset
# $ picom-trans --reset

case "$0" in
*compton-trans*) echo "Warning: compton has been renamed, please use picom-trans instead" >& 2;;
esac

# "command" is a shell built-in, faster than "which"
if test -z "$(command -v xprop)" -o -z "$(command -v xwininfo)"; then
Expand Down Expand Up @@ -51,8 +55,8 @@ done

# This takes into account the fact that getopts stops on
# any argument it doesn't recognize or errors on. This
# allows for things like `compton-trans -5` as well
# as `compton-trans -c +5 -s` (contrived example).
# allows for things like `picom-trans -5` as well
# as `picom-trans -c +5 -s` (contrived example).
while test $# -gt 0; do
# Reset option index
OPTIND=1
Expand Down
4 changes: 2 additions & 2 deletions man/meson.build
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
mans = ['compton.1', 'compton-trans.1']
mans = ['picom.1', 'picom-trans.1']
if get_option('with_docs')
a2x = find_program('a2x')
foreach m : mans
custom_target(m, output: [m], input: [m+'.asciidoc'],
command: [a2x, '-a',
'compton-version='+version,
'picom-version='+version,
'--format', 'manpage', '@INPUT@', '-D',
meson.current_build_dir()],
install: true, install_dir: 'share/man/man1/')
Expand Down
26 changes: 13 additions & 13 deletions man/compton-trans.1.asciidoc → man/picom-trans.1.asciidoc
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
compton-trans(1)
picom-trans(1)
================
:doctype: manpage
:man source: compton
:man version: {compton-version}
:man source: picom
:man version: {picom-version}
:man manual: User Commands

NAME
----
compton-trans - an opacity setter tool
picom-trans - an opacity setter tool

SYNOPSIS
--------

*compton-trans* [-w 'WINDOW_ID'] [-n 'WINDOW_NAME'] [-c] [-s] 'OPACITY'
*picom-trans* [-w 'WINDOW_ID'] [-n 'WINDOW_NAME'] [-c] [-s] 'OPACITY'

DESCRIPTION
-----------

*compton-trans* is a bash script that sets '_NET_WM_WINDOW_OPACITY' attribute of a window using standard X11 command-line utilities, including *xprop*(1) and *xwininfo*(1). It is similar to *transset*(1) or *transset-df*(1).
*picom-trans* is a bash script that sets '_NET_WM_WINDOW_OPACITY' attribute of a window using standard X11 command-line utilities, including *xprop*(1) and *xwininfo*(1). It is similar to *transset*(1) or *transset-df*(1).

OPTIONS
-------
Expand All @@ -42,37 +42,37 @@ EXAMPLES
* Set the opacity of the window with specific window ID to 75%:
+
------------
compton-trans -w "$WINDOWID" 75
picom-trans -w "$WINDOWID" 75
------------
* Set the opacity of the window with the name "urxvt" to 75%:
+
------------
compton-trans -n "urxvt" 75
picom-trans -n "urxvt" 75
------------
* Set current window to opacity of 75%:
+
------------
compton-trans -c 75
picom-trans -c 75
------------
* Select target window and set opacity to 75%:
+
------------
compton-trans -s 75
picom-trans -s 75
------------
* Increment opacity of current active window by 5%:
+
------------
compton-trans -c +5
picom-trans -c +5
------------
* Decrement opacity of current active window by 5%:
+
------------
compton-trans -c -- -5
picom-trans -c -- -5
------------
BUGS
Expand All @@ -81,4 +81,4 @@ Please submit bug reports to <https://github.com/yshui/compton>.

SEE ALSO
--------
link:compton.1.html[*compton*(1)], *xprop*(1), *xwininfo*(1)
link:picom.1.html[*picom*(1)], *xprop*(1), *xwininfo*(1)
46 changes: 23 additions & 23 deletions man/compton.1.asciidoc → man/picom.1.asciidoc
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
compton(1)
picom(1)
==========
:doctype: manpage
:man source: compton
:man version: {compton-version}
:man source: picom
:man version: {picom-version}
:man manual: User Commands

NAME
----
compton - a compositor for X11
picom - a compositor for X11

SYNOPSIS
--------
*compton* ['OPTIONS']
*picom* ['OPTIONS']

DESCRIPTION
-----------
compton is a compositor based on Dana Jansens' version of xcompmgr (which itself was written by Keith Packard). It includes some improvements over the original xcompmgr, like window frame opacity and inactive window transparency.
picom is a compositor based on Dana Jansens' version of xcompmgr (which itself was written by Keith Packard). It includes some improvements over the original xcompmgr, like window frame opacity and inactive window transparency.

OPTIONS
-------
Expand Down Expand Up @@ -83,7 +83,7 @@ OPTIONS
Show all X errors (for debugging).

*--config* 'PATH'::
Look for configuration file at the path. See *CONFIGURATION FILES* section below for where compton looks for a configuration file by default. Use `/dev/null` to avoid loading configuration file.
Look for configuration file at the path. See *CONFIGURATION FILES* section below for where picom looks for a configuration file by default. Use `/dev/null` to avoid loading configuration file.

*--write-pid-path* 'PATH'::
Write process ID to a file.
Expand Down Expand Up @@ -128,13 +128,13 @@ OPTIONS
Detect '_NET_WM_OPACITY' on client windows, useful for window managers not passing '_NET_WM_OPACITY' of client windows to frame windows.

*--refresh-rate* 'REFRESH_RATE'::
Specify refresh rate of the screen. If not specified or 0, compton will try detecting this with X RandR extension.
Specify refresh rate of the screen. If not specified or 0, picom will try detecting this with X RandR extension.

*--vsync*, *--no-vsync*::
Enable/disable VSync.

*--sw-opti*::
Limit compton to repaint at most once every 1 / 'refresh_rate' second to boost performance. This should not be used with *--vsync* drm/opengl/opengl-oml as they essentially does *--sw-opti*'s job already, unless you wish to specify a lower refresh rate than the actual value.
Limit picom to repaint at most once every 1 / 'refresh_rate' second to boost performance. This should not be used with *--vsync* drm/opengl/opengl-oml as they essentially does *--sw-opti*'s job already, unless you wish to specify a lower refresh rate than the actual value.
*--use-ewmh-active-win*::
Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window, rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy, provided that the WM supports it.
Expand Down Expand Up @@ -209,7 +209,7 @@ May also be one of the predefined kernels: `3x3box` (default), `5x5box`, `7x7box
Specify a list of conditions of windows that should be painted with inverted color. Resource-hogging, and is not well tested.

*--opacity-rule* 'OPACITY':'CONDITION'::
Specify a list of opacity rules, in the format `PERCENT:PATTERN`, like `50:name *= "Firefox"`. compton-trans is recommended over this. Note we don't make any guarantee about possible conflicts with other programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows.
Specify a list of opacity rules, in the format `PERCENT:PATTERN`, like `50:name *= "Firefox"`. picom-trans is recommended over this. Note we don't make any guarantee about possible conflicts with other programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows.

*--shadow-exclude-reg* 'GEOMETRY'::
Specify a X geometry that describes the region in which shadow should not be painted in, such as a dock window region. Use `--shadow-exclude-reg x10+0-0`, for example, if the 10 pixels on the bottom of the screen should not have shadows painted on.
Expand All @@ -236,7 +236,7 @@ May also be one of the predefined kernels: `3x3box` (default), `5x5box`, `7x7box
Disable the use of damage information. This cause the whole screen to be redrawn everytime, instead of the part of the screen has actually changed. Potentially degrades the performance, but might fix some artifacts.

*--xrender-sync-fence*::
Use X Sync fence to sync clients' draw calls, to make sure all draw calls are finished before compton starts drawing. Needed on nvidia-drivers with GLX backend for some users.
Use X Sync fence to sync clients' draw calls, to make sure all draw calls are finished before picom starts drawing. Needed on nvidia-drivers with GLX backend for some users.

*--glx-fshader-win* 'SHADER'::
GLX backend: Use specified GLSL fragment shader for rendering window contents. See `compton-default-fshader-win.glsl` and `compton-fake-transparency-fshader-win.glsl` in the source tree for examples.
Expand Down Expand Up @@ -342,9 +342,9 @@ This is the old condition format we once used. Support of this format might be r
CONFIGURATION FILES
-------------------
compton could read from a configuration file if libconfig support is compiled in. If *--config* is not used, compton will seek for a configuration file in `$XDG_CONFIG_HOME/compton.conf` (`~/.config/compton.conf`, usually), then `~/.compton.conf`, then `compton.conf` under `$XDG_CONFIG_DIRS` (often `/etc/xdg/compton.conf`).
picom could read from a configuration file if libconfig support is compiled in. If *--config* is not used, picom will seek for a configuration file in `$XDG_CONFIG_HOME/compton.conf` (`~/.config/compton.conf`, usually), then `~/.compton.conf`, then `compton.conf` under `$XDG_CONFIG_DIRS` (often `/etc/xdg/compton.conf`).

compton uses general libconfig configuration file format. A sample configuration file is available as `compton.sample.conf` in the source tree. Most of commandline switches can be used as options in configuration file as well. For example, *--vsync* option documented above can be set in the configuration file using `vsync = `. Command line options will always overwrite the settings in the configuration file.
picom uses general libconfig configuration file format. A sample configuration file is available as `compton.sample.conf` in the source tree. Most of commandline switches can be used as options in configuration file as well. For example, *--vsync* option documented above can be set in the configuration file using `vsync = `. Command line options will always overwrite the settings in the configuration file.

Window-type-specific settings are exposed only in configuration file and has the following format:

Expand Down Expand Up @@ -406,12 +406,12 @@ Available options of the 'blur' section are: ::
SIGNALS
-------

* compton reinitializes itself upon receiving `SIGUSR1`.
* picom reinitializes itself upon receiving `SIGUSR1`.

D-BUS API
---------
It's possible to control compton via D-Bus messages, by running compton with *--dbus* and send messages to `com.github.chjj.compton.<DISPLAY>`. `<DISPLAY>` is the display used by compton, with all non-alphanumeric characters transformed to underscores. For `DISPLAY=:0.0` you should use `com.github.chjj.compton._0_0`, for example.
It's possible to control picom via D-Bus messages, by running picom with *--dbus* and send messages to `com.github.chjj.compton.<DISPLAY>`. `<DISPLAY>` is the display used by picom, with all non-alphanumeric characters transformed to underscores. For `DISPLAY=:0.0` you should use `com.github.chjj.compton._0_0`, for example.
The D-Bus methods and signals are not yet stable, thus undocumented right now.
Expand All @@ -421,37 +421,37 @@ EXAMPLES
* Disable configuration file parsing:
+
------------
$ compton --config /dev/null
$ picom --config /dev/null
------------

* Run compton with client-side shadow and fading, disable shadow on dock windows and drag-and-drop windows:
* Run picom with client-side shadow and fading, disable shadow on dock windows and drag-and-drop windows:
+
------------
$ compton -cCGf
$ picom -cCGf
------------

* Same thing as above, plus making inactive windows 80% transparent, making frame 80% transparent, don't fade on window open/close, enable software optimization, and fork to background:
+
------------
$ compton -bcCGf -i 0.8 -e 0.8 --no-fading-openclose --sw-opti
$ picom -bcCGf -i 0.8 -e 0.8 --no-fading-openclose --sw-opti
------------

* Draw white shadows:
+
------------
$ compton -c --shadow-red 1 --shadow-green 1 --shadow-blue 1
$ picom -c --shadow-red 1 --shadow-green 1 --shadow-blue 1
------------

* Avoid drawing shadows on wbar window:
+
------------
$ compton -c --shadow-exclude 'class_g = "wbar"'
$ picom -c --shadow-exclude 'class_g = "wbar"'
------------

* Enable VSync with GLX backend:
+
------------
$ compton --backend glx --vsync
$ picom --backend glx --vsync
------------

BUGS
Expand All @@ -466,4 +466,4 @@ Homepage: <https://github.com/yshui/compton>

SEE ALSO
--------
*xcompmgr*(1), link:compton-trans.html[*compton-trans*(1)]
*xcompmgr*(1), link:picom-trans.html[*picom-trans*(1)]
9 changes: 6 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project('compton', 'c', version: '7',
project('picom', 'c', version: '7',
default_options: ['c_std=c11'])

cc = meson.get_compiler('c')
Expand Down Expand Up @@ -43,7 +43,7 @@ if get_option('modularize')
add_global_arguments(['-fmodules',
'-fmodule-map-file='+
meson.current_source_dir()+
'/src/compton.modulemap'],
'/src/picom.modulemap'],
language: 'c')
endif

Expand All @@ -69,9 +69,12 @@ test_h_dep = subproject('test.h').get_variable('test_h_dep')
subdir('src')
subdir('man')

install_data('bin/compton-trans', install_dir: get_option('bindir'))
install_data('bin/picom-trans', install_dir: get_option('bindir'))
install_data('compton.desktop', install_dir: 'share/applications')
install_data('picom.desktop', install_dir: 'share/applications')
install_data('media/icons/48x48/compton.png',
install_dir: 'share/icons/hicolor/48x48/apps')
install_data('media/compton.svg',
install_dir: 'share/icons/hicolor/scalable/apps')

meson.add_install_script('meson/install.sh')
11 changes: 11 additions & 0 deletions meson/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

if [ ! -e "${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton" ]; then
echo "Linking picom to ${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton"
ln -s picom "${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton"
fi

if [ ! -e "${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton-trans" ]; then
echo "Linking picom-trans to ${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton-trans"
ln -s picom-trans "${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton-trans"
fi
2 changes: 1 addition & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
option('sanitize', type: 'boolean', value: false, description: 'Compile compton with sanitizers')
option('sanitize', type: 'boolean', value: false, description: 'Build with sanitizers enabled (deprecated)')
option('config_file', type: 'boolean', value: true, description: 'Enable config file support')
option('regex', type: 'boolean', value: true, description: 'Enable regex support in window conditions')

Expand Down
Loading

0 comments on commit 8ddbebb

Please sign in to comment.