Moblin: desktop customisation

Notes for adapting the Moblin desktop: starting X, the panel and uxlaunch, gnome-terminal for logs, notifications via DBUS and devilspie.

Translation of the original in Spanish. Read it in: CatalàCastellano

Part 4 of 5Moblin notes
  1. moblin: Why do I use Fedora Core 10?
  2. Moblin: system installation and configuration
  3. Moblin + digital signage: features, roadmap and hardware
  4. Moblin: desktop customisation
  5. Developing with Moblin

This page was on the oriolrius.cat wiki (2009–2012). I'm recovering it here as it was.

X-Windows

Boot sequence:

inittab:5 -> /usr/sbin/moblin-dm (shell script) -> /etc/sysconfig/desktop (DISPLAYMANAGER=uxlaunch)

Modify the top panel (detailed version further down, in Moblin panel customisation):

mnb_toolbar.c -> mutter-moblin
/etc/xdg/xinitrc moblin_panel_people &
[hora/data] [player] [status] [config] [sched] [apps]   [bt][audio][net]

Configuration files:

/etc/xdg/autostart/*.desktop
/home/*/.config/autostart
/etc/X11/xinit/xinit.d/*  ->   borrar fitxer zzzzz*
/etc/sysconfig/*
Xvnc <- vncconnect -> vncreflect <- vncviewer
xsetroot -cursor-name left_ptr -solid steelblue

VideoWalls: DMX uses several X servers to set up a video Wall

xdmx pg.249 X PowerTools
xdmxconfig

x11vnc -> turns an X server into a VNC server, in the style of VINO

Moblin panel customisation

There are 2 modules that affect the customisation of the panel:

  • uxlaunch
  • mutter-moblin

The modules are at http://repo.moblin.org/moblin/releases/2.1/source/

uxlaunch

  • It takes care of launching X, the graphical environment, etc.
  • In uxlaunch.c you can see the complete boot sequence
  • The code associated with the panel is available in desktop.c
    • The panels are only launched when the window manager is mutter
    • in the autostart_panels function you can see the panel elements that are loaded by default
    • besides the default ones, it loads all the ones in $HOME/.config/autostart and /etc/xdg/autostart
  • In addition, it runs all the scripts available in /etc/X11/xinit/xinitrc.d

The entry points are the ones mentioned above. Since there are a number of applications it loads by default, and they are not the ones we are interested in, we can tackle the problem in two ways:

  1. Modify the uxlaunch code so that it doesn't launch them.
  2. Override the libraries it loads.

That is, we either deploy a modified version of the uxlaunch executable or a modified version of the panels (that is, of mutter-moblin). The solution to deploy will be determined by the evaluation of mutter-moblin.

Compiling a custom uxlaunch

We have a customised version of uxlaunch, it's in the subversion repository. To install a modified version we need to:

  1. Download the player module with subversion
  2. In trunk/uxlaunch/ is the uxlaunch code. We modify it to taste
  3. We run make (configure is not needed).
  4. If we want to safeguard the original uxlaunch, we copy it somewhere safe (it will be in /usr/sbin/uxlaunch)
  5. We run sudo make install

The dependencies I had to install at the time were:

$ yum install libXau-devel ConsoleKit-devel pam-devel

gnome-terminal configuration

This console program included as standard and integrated in moblin lets us launch different consoles with the player-linux logs.

CLI

Through the CLI we can launch several TABs with several commands associated with each TAB in the following way:

gnome-terminal --maximize --tab -e "tail -f /var/log/messages" -t "messages" --tab -e "tail -f /var/log/Xorg.0.log" -t "Xorg"

profiles

We can also create files of the profile type and open different TABs with the profile files assigned to each TAB.

A profile file is an XML in which an infinite number of settings can be defined regarding the appearance and functionality of a terminal (or a TAB of a terminal), the most important one for the case we are interested in is that we can launch a command associated with the profile so that we won't get a shell to work in but the output of the command.

By default the profile files are saved in:

/home/oriol/.gconf/apps/gnome-terminal/profiles

The most convenient way to generate 'profile' files is to do it from the gnome-terminal interface itself and then save the profile if we want it to be saved in the directory specified above.

The solution for the logs

The best idea is to create different profiles, one for each log we want to monitor, and then on the command line launch gnome-terminal with the profiles we are interested in.

In addition, in the parameters we can specify that it is launched in full-screen, maximised, without a menu bar, etc.

Notification system

If we want to launch alerts on the Desktop via DBUS and fully integrated with the moblin look we can do it through the notification-daemon daemon.

Installation

  • Install the package: notification-daemon
yum install notification-daemon

Launching the daemon

Once the DBUS session has started, that is once mutter has booted, we must launch:

/usr/libexec/notification-daemon

Launching an alert from the CLI

  • Command notify-send
  • example:
notify-send titulo contenido

Launching an alert from python using DBUS

#!/usr/bin/env python

import dbus
import sys

# Use session bus
session_bus = dbus.SessionBus()

# Use notifications object
notifications_object = session_bus.get_object('org.freedesktop.Notifications', '/org/freedesktop/Notifications')
notifications_interface = dbus.Interface(notifications_object, 'org.freedesktop.Notifications')

# Sample empty notification
notification_id = notifications_interface.Notify(sys.argv[0], 0, '', 'Sample summary', 'Sample body', dbus.Array([], signature='s'), dbus.Array([], signature='(sv)'), -1)

# Sample notification with actions and hints
notification_id = notifications_interface.Notify(sys.argv[0], 0, '', 'Sample summary', 'Sample body', ['sample', 'Sample action'], {'x': 100, 'y': 100}, -1)

References

devilspie

Having installed the devilspie application, which allows you to play with the open windows and the ones that are going to open, being able to adjust them in the window and also adjust whether they should appear on top of the rest of the applications, etc.

More information: devilspie