How do I change window managers with Yocto Project tools?

7.8k views Asked by At

My Intent

I have an image generated by BitBake on which I'm interested in changing the window manager to metacity or maybe something similar.

My Process

I've added require recipes-graphics/images/core-image-x11.bb into my core recipe, which provides a simple Matchbox terminal window but seemingly no other functionality. If I add matchbox-desktop and matchbox-session-sato, it adds a bit more usability but not what I'm looking for.

I've included the default package from the metacity_2.34.13.bb recipe from the meta-gnome layer from the OpenEmbedded Metadata Index in the IMAGE_INSTALL variable of my core image. This installs several components including a metacity command in /usr/bin. If I run that command, I get the following message:

GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications

(metacity:1124): GLib-GIO-ERROR **: Settings schema 'org.gnome.metacity' is not installed

Trace/breakpoint trap

I've navigated to /usr/share/glib-2.0/schemas and run glib-compile-schemas ., then run:

startx
metacity --replace

again. Now, the output is:

Window manager error: Unable to open X display

I haven't found a clear solution to this error which applies to my specific situation.

Update (2/29):

I may have now found a solution to this error, using these commands:

X&
export DISPLAY=:0
metacity&

At this point, I seem to be running something on one of my VTs. I can run demos like glxgears in that VT (glxgears is included in the mesa-demos recipe), but I don't know how to actually create a usable environment.

My question(s)

  1. I'm not using much from meta-openembedded/meta-gnome (just metacity) or meta/recipes-gnome (adwaita-icon-theme, gnome-desktop3, gsettings-desktop-schemas and gtk+3), so am I missing some recipe which automates the addition of metacity?
  2. (if not Question 1) How can I solve the error Window manager error: Unable to open X display?
1

There are 1 answers

0
Jussi Kukkonen On BEST ANSWER

The x11-common recipe adds a X session script that will run /usr/bin/x-session-manager: that is responsible for starting your desktop environment.

The way to implement a new session/DE in OE-Core is to use update-alternatives for "x-session-manager": see the matchbox-session recipe for the default implementation and mini-x-session recipe for an alternative.

mini-x-session might be modifiable for your needs so you don't need to write a new one: A /etc/mini_x/session file like this might do the trick:

# start any apps here, e.g. "my-desktop &"
exec metacity

Going from this (a running window manager) to "usable environment" might still be lots and lots of work, depending on your definition of usable.