1

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 running, but I'm not sure which.

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

1

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.

  • So are you suggesting that I use Xcompmgr instead of Compton and Mutter? – wxyz Apr 13 at 18:53
  • 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. – mosvy Apr 14 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
  • pgrep compton seems to work, but when using Gnome pgrep mutter doesn't return anything – wxyz Apr 13 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) – mosvy Apr 14 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.