1*eb8dc403SDave Cobbley#!/bin/sh
2*eb8dc403SDave Cobbley
3*eb8dc403SDave Cobbley. /etc/formfactor/config
4*eb8dc403SDave Cobbley
5*eb8dc403SDave CobbleyCMD=""
6*eb8dc403SDave Cobbley
7*eb8dc403SDave Cobbleyif [ "$HAVE_KEYBOARD" = "0" ]; then
8*eb8dc403SDave Cobbley    CMD="matchbox-keyboard -d"
9*eb8dc403SDave Cobbleyelif [ "$DISPLAY_CAN_ROTATE" = "1" ]; then
10*eb8dc403SDave Cobbley    if [ "$HAVE_KEYBOARD_PORTRAIT" = "1" -a "$HAVE_KEYBOARD_LANDSCAPE" = "0" ]; then
11*eb8dc403SDave Cobbley        CMD="matchbox-keyboard -d -o landscape"
12*eb8dc403SDave Cobbley    elif [ "$HAVE_KEYBOARD_LANDSCAPE" = "1" -a "$HAVE_KEYBOARD_PORTRAIT" = "0" ]; then
13*eb8dc403SDave Cobbley        CMD="matchbox-keyboard -d -o portrait"
14*eb8dc403SDave Cobbley    fi
15*eb8dc403SDave Cobbleyfi
16*eb8dc403SDave Cobbley
17*eb8dc403SDave Cobbleyif [ "$CMD" ]; then
18*eb8dc403SDave Cobbley    # Delay to make sure the window manager is active
19*eb8dc403SDave Cobbley    # by waiting for the desktop to say its finished loading
20*eb8dc403SDave Cobbley    dbus-wait org.matchbox_project.desktop Loaded && $CMD &
21*eb8dc403SDave Cobbleyfi
22