#!/bin/sh

module_id() {
    awk 'BEGIN { FS=": " } /Hardware/ { print $2 } ' </proc/cpuinfo
}

SHOWCURSOR="no"

## Start up machine specific input devices. Really needs to go in its own session
case `module_id` in
	# On Zaurus models, zaurusd takes care of mbinputmgr for us in its hinge scripts
	"Generic OMAP1510/1610/1710")
		matchbox-keyboard --daemon &
		;;
	"SHARP Shepherd" | "SHARP Husky" | "SHARP Corgi" | \
	"SHARP Spitz" | "SHARP Akita" | "SHARP Borzoi")
		matchbox-keyboard --daemon --orientation portrait &
		;;
        # qemu machines.. likely need better detection 
	"ARM-IntegratorCP" | "ARM-Versatile PB")
		#SHOWCURSOR="yes"
		;;
esac

## All this should be done by themeing/xsettings.. ## 
matchbox-desktop &

# mb-applet-startup-monitor &                 

matchbox-panel --titlebar --start-applets showdesktop,windowselector --end-applets clock,battery,systray &

exec matchbox-window-manager -theme Sato -use_desktop_mode decorated -use_cursor $SHOWCURSOR $@
