diff --git a/meta-digi-dey/recipes-sato/matchbox-keyboard/files/80matchboxkeyboard.sh b/meta-digi-dey/recipes-sato/matchbox-keyboard/files/80matchboxkeyboard.sh new file mode 100644 index 000000000..3733a5f79 --- /dev/null +++ b/meta-digi-dey/recipes-sato/matchbox-keyboard/files/80matchboxkeyboard.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +. /etc/formfactor/config + +CMD="" + +# Group the commands in a function so they can be run in background +run_keyboard() { + # Delay to make sure the window manager is active + # by waiting for the desktop to say its finished loading + dbus-wait org.matchbox_project.desktop Loaded + exec $CMD +} + +if [ "$HAVE_KEYBOARD" = "0" ]; then + CMD="matchbox-keyboard -d" +elif [ "$DISPLAY_CAN_ROTATE" = "1" ]; then + if [ "$HAVE_KEYBOARD_PORTRAIT" = "1" -a "$HAVE_KEYBOARD_LANDSCAPE" = "0" ]; then + CMD="matchbox-keyboard -d -o landscape" + elif [ "$HAVE_KEYBOARD_LANDSCAPE" = "1" -a "$HAVE_KEYBOARD_PORTRAIT" = "0" ]; then + CMD="matchbox-keyboard -d -o portrait" + fi +fi + +if [ "$CMD" ]; then + run_keyboard & +fi diff --git a/meta-digi-dey/recipes-sato/matchbox-keyboard/matchbox-keyboard_git.bbappend b/meta-digi-dey/recipes-sato/matchbox-keyboard/matchbox-keyboard_git.bbappend new file mode 100644 index 000000000..65045a7ba --- /dev/null +++ b/meta-digi-dey/recipes-sato/matchbox-keyboard/matchbox-keyboard_git.bbappend @@ -0,0 +1,13 @@ +# Copyright (C) 2014 Digi International. + +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI += " \ + file://80matchboxkeyboard.sh \ +" + +do_install_append () { + # Remove upstream '80matchboxkeyboard.shbg' file and install ours + rm -f ${D}/${sysconfdir}/X11/Xsession.d/80matchboxkeyboard.shbg + install -m 0755 ${WORKDIR}/80matchboxkeyboard.sh ${D}/${sysconfdir}/X11/Xsession.d/ +}