Window Manager Startup

From Openmoko

Jump to: navigation, search

Describes the scripts and programs used to bring up the X Windows Server and the Matchbox Window Manager. The series of events that occur when the window manager starts follows the order of the table of contents.


X Server Init Script

A standard init script:


To start the X Server:

/etc/init.d/xserver-nodm start

To stop the X Server

/etc/init.d/xserver-nodm stop

Using the stop parameter currently causes an error. ps is being called with an invalid parameter. (Bug #605)

When using the start parameter, it eventually calls Xserver.

X Server Environment Setup

A script at:


Called as:

/etc/X11/Xserver &

Configures system and sets up environment variables. Especially important are the environment variables XSERVER, DISPLAY, and ARGS. It finishes by calling and transferring control to xinit.

X Window System Initializer

A script at:


Called as:

xinit /etc/X11/Xsession -- /usr/bin/Xfbdev :0 -br -pn -fp \
  built-ins,/usr/share/fonts/ttf,/usr/share/fonts/truetype \
  -screen 480x640x16

Executes Linux framebuffer generic X server (Xfbdev) and the scripts in /etc/X11/Xsession.d. The scripts are described in the next section of subtopics.

Screen Calibration

A script at:


Checks to see if the pointer is calibrated (existence of /etc/pointercal). If not, then executes xtscal to calibrate it:


What program(s) eventually open and use the data in /etc/pointercal?


A script at:


This script sets the GTK_MODULES environment variable to point to a shared object with:

It makes no attempt to append this shared object to the end of an already existing GTK_MODULES environment variable. Is this correct?

This module provides a possibility to send a right click to applications by holding the stylus down for a while. This method works only in GTK applications.


A script at:


This script appends a shared object to the end of the GTK_MODULES environment variable. This seems to be more correct than the above (and indeed, if this was not appended, you would lose the previous value).

It accomplishes this task with:


(Please elaborate about the purpose of this shared object)

X Server Resource Database Load

A script at:


Loads the X server preferences from $HOME/.Xdefaults if it exists. The command is:

xdb -merge -nocpp < $HOME/.Xdefaults

There is currently not an .Xdefaults file in the Openmoko image, therefore this script does nothing.

Gnome Configuration Server

A script at:


This script executes:

/usr/libexec/gconfd-2 &

More information about gconfd can be found in the GConf Implementation Overview.

Settings Daemon

A script at:


This script executes:

/usr/bin/settings-daemon &

The current description in the Openmoko repository says that the "settings-daemon provides a bridge between gconf and xsettings".

Window Manager Startup

A script at:


Calls the window manager with:

exec /usr/bin/x-window-manager

X Window Manager

A soft link at:


This soft link points to:


This script simply adds a level indirection so one can easily change the window manager being used.

Matchbox Session

A script at:


Test for the existence of:


In the case of Openmoko, this test is positive and session is exec'ed.

Taking a quick look at the script shows that one can override the use of /etc/matchbox/session with their own $HOME/.matchbox/session if they wish to experiment without touching the rest of the system.

Matchbox Window Manager Setup

A script at:


This is where the key ingredients of the Matchbox Window Manager are mixed together and executed. Because these elements are key to the user interface, this script is described in detail here.

It is interesting that after the setting of GTK_MODULES in the X Window System Initializer phase (scripts in /etc/X11/Xsession.d) that it is all overwritten by a single statement here:


This loses an old value for GTK_MODULES that also contained Perhaps this was something that was overlooked?

Matchbox Top Panel

A binary at:


Called as:

matchbox-panel-2 --start-applets=openmoko-panel-mainmenu,systray,startup \
  openmoko-panel-clock &

The Matchbox Top Panel dynamically links in a series of shared objects that are called applets. If any of these shared objects has a problem that causes abnormal termination, the whole Top Panel goes down. Many users have already observed this when using the GSM & GPRS Connection Status (openmoko-panel-gsm) applet. Turning it off and on repeatedly will eventually cause the code in the shared object to crash, bringing down the whole Top Panel.

The best methods for bring the Top Panel back up (besides rebooting) are to run the Top Panel from the command line, as above) or to restart the X Server:

/etc/init.d/xserver-nodm restart

Note that with the above, the X Server will fail to stop because of the bug described with the script above.

Because the Top Panel seems to be essential to normal operation of the phone, execution of the panel should be wrapped in a loop to restart it in the event of a failure. Take into account this program runs in the background and it may not be wise to keep restarting it in tight loop, using up CPU, etc.

Matchbox Input Manager

A binary at:


Called as:

mbinputmgr &

This program is described as "A tray application for managing software input methods". It seems to be the white Matchbox Panel applet that brings up the software keyboard. This needs to be verified.

ALSA Control

A binary at:


Called as:

alsactl restore 0 -f /etc/alsa/stereoout.state

Initializes the audio system state. More information for ALSA can be found on the ALSA Project home page.

Openmoko Footer

A binary at:


Called as:

openmoko-footer &

More about Footer.

Openmoko Today

A binary at:


Called as:

openmoko-today --desktop &

More about Today.

Openmoko Dialer

A binary at:


Called as:

openmoko-dialer &

More about Dialer.

Matchbox Window Manager

An binary at:


Called as:

matchbox-window-manager -use_titlebar no -use_cursor no

The Matchbox Window Manager home page.


At this point, the user interface is up and ready for service.

Personal tools