12

I'm using Arch Linux, and have both Gnome and the i3 window manager installed. When running i3, I'm trying to initiate the composite manager Compton. But trying to do so results in the following error:

$ compton
[ 04/11/2019 22:32:36.443 register_cm FATAL ERROR ] Another composite manager is already running

I think this means that Compton is already running, or Mutter is running, but I'm not sure which.

Is there a command I can use to determine which composite manager is currently running?

3 Answers 3

14

You can use inxi.

inxi -Gxx | grep compositor

The output looks like this

           alternate: ati,fbdev compositor: compton resolution: <xdpyinfo missing> 

and you can see that Compton is currently being used as a compositor. With no compositor, there is no grep match.

Switches:

  • -G Show graphics info (card(s), driver, display protocol (if available), display server, resolution, renderer, OpenGL version).
  • -xx Show extra, extra data. (with -G, show chip vendor:product ID for each video card; OpenGL compatibility version; compositor (experimental); alternate Xorg drivers.
3
  • 1
    On Arch, install the AUR inxi package
    – Codebling
    Oct 8, 2019 at 19:42
  • 2
    Take note, for some reasons not all *actual* compositors are going to be shown there. inxi -Sxx should do it instead (even though, at least without wmctrl installed, it is simply a lookup table checking running processes AFAICT)
    – mirh
    Jan 11, 2020 at 13:07
  • 1
    @mirh -S only shows system info, I don't think that will show any additional compositors. I think you're right that inxi does not heuristically/canonically detect compositors, it can only detect compositors that it knows about. I noticed that picom is missing since the rename of the fork, so I added it. Let me know if you noticed any other missing compositors.
    – Codebling
    Feb 24, 2020 at 18:46
3

I don't have either Compton or Mutter installed, but the xcompmgr sample X composition manager doesn't bother to determine if another composition manager is running, but goes on and just calls XCompositeRedirectSubwindows() and handles the error that may be generated by it in the handler installed with XSetErrorHandler:

static int
error (Display *dpy, XErrorEvent *ev)
{
    ...
    if (ev->request_code == composite_opcode &&
        ev->minor_code == X_CompositeRedirectSubwindows)
    {
        fprintf (stderr, "Another composite manager is already running\n");
        exit (1);

This seems to be the only possible way to do it: XCompositeGetOverlayWindow() will always succeed and map the overlay window, whether it's already in use or not:

CompositeGetOverlayWindow

This request indicates that the client wishes to use the Composite Overlay Window of this screen. If this Composite Overlay Window has not yet been mapped, it is mapped by this request.

Note:

Mutter is implemented as a dynamic library (usually loaded by gnome-shell), not as a separate process.

grep -sl mutter /proc/*/maps

on Linux will find all the processes that are using it.

2
  • So are you suggesting that I use Xcompmgr instead of Compton and Mutter?
    – Trevor
    Apr 13, 2019 at 18:53
  • 1
    No, I had just misinterpreted your question into something more complex like "how to determine if any composite manager is running on a display?" or "find the clients which had called XCompositeGetOverlayWindow". Sorry.
    – user313992
    Apr 14, 2019 at 8:20
0

There is no command to know if any compositor is currently running, as far as I know. But you can use pgrep to know if a given compositor is currently running:

$ pgrep compton
18169

pgrep will give you the PID so you can terminate the process using kill:

$ kill 18169

Alternatively, pkill can terminate the process by feeding it the process name instead of the PID:

$ pkill compton

Some compositors (like Xfce's) may need a different approach to be deactivated:

$ xfwm4 --compositor=off --replace
2
  • pgrep compton seems to work, but when using Gnome pgrep mutter doesn't return anything
    – Trevor
    Apr 13, 2019 at 19:01
  • pgrep mutter doesn't return anything because mutter is implemented as a dynamic lib loaded by gnome-shell, not as a separate process. grep -sl mutter /proc/*/maps to find the pid of any process that may using mutter (or something using lsof, but I was never able to learn how to use lsof)
    – user313992
    Apr 14, 2019 at 8:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.