Unity – Disable Compiz and Enable Metacity via Command-Line

command linecompizmetacityunity

I've installed some new drivers and restarted, and much to my amusement when I log in my screen goes black, then white, and it never draws properly. I switched to the command line using Ctrl + Alt + F1 but I'm not sure how to disable compiz and enable metacity as the default window manager. Using metacity --replace doesn't work since the command line appears to be a separate login instance altogether… Any tips?


I've done this for now:


Best Answer

Running metacity --replace from a virtual console doesn't work because it doesn't know which X11 display to attach to. The default behavior is to attach to the display it runs in...and a shell running in a virtual console isn't on any X11 display.

Instead, you must manually specify the display. It will be :0 unless you've configured your X11 display differently. (Even if you have multiple monitors, it will still be :0 unless you've changed your X11 configuration.)

To do that, use this command:

metacity --display=:0 --replace

If that does't work, then try manually killing the compiz process first. To do that:

  1. Run killall compiz. Wait a few seconds. Perhaps compiz will respond to this signal and terminate.

  2. Run killall -KILL compiz. This almost always ensures that compiz will be immediately terminated.

Step 1 is optional, but can help processes free some resources and finish up some kinds of important actions (like writing buffered data to files).

Related Question