Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeata committed Aug 10, 2008
0 parents commit eebb441
Show file tree
Hide file tree
Showing 8 changed files with 122 additions and 0 deletions.
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
zhone-session (0.1) UNRELEASED; urgency=low

* Initial release.

-- Joachim Breitner <nomeata@debian.org> Sun, 10 Aug 2008 19:17:55 -0300
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7
18 changes: 18 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Source: zhone-session
Section: misc
Priority: extra
Maintainer: Joachim Breitner <nomeata@debian.org>
Build-Depends: debhelper (>= 7)
Standards-Version: 3.8.0

Package: zhone-session
Architecture: all
Depends: frameworkd, zhone, matchbox-window-manager, matchbox-keyboard, python-dbus
Conflicts: gdm, kdm, x-display-manager
Description: starts zhone at system start
This packages prepares the system, which should be a smartphone, to
automatically start zhone at system start.
.
It should not be installed on a regular Debian system, as it would interfere
with an installed display manager.

3 changes: 3 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/make -f
%:
dh $@
3 changes: 3 additions & 0 deletions debian/zhone-session.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
zhone-session.init /etc/init.d
matchbox-keyboard-toggle /usr/bin
zhone-session /usr/bin/
31 changes: 31 additions & 0 deletions matchbox-keyboard-toggle
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/python

# Needs python-dbus and psmisc

import dbus
import dbus.glib
import gobject

import os

keyboard_shown=False

def signal_handler(name, action, seconds):
global keyboard_shown

if name == "AUX" and action == "pressed":
if keyboard_shown:
os.system("kill -s KILL `pidof /usr/bin/matchbox-keyboard`")
else:
os.system("matchbox-keyboard &")
keyboard_shown = not keyboard_shown


bus = dbus.SystemBus()
bus.add_signal_receiver(signal_handler,
dbus_interface="org.freesmartphone.Device.Input",
signal_name="Event")


loop = gobject.MainLoop()
loop.run()
5 changes: 5 additions & 0 deletions zhone-session
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

zhone &
matchbox-keyboard-toggle &
exec matchbox-window-manager -use_titlebar no
56 changes: 56 additions & 0 deletions zhone-session.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: openmoko-fso
# Required-Start: $remote_fs frameworkd
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Openmoko Framework Testing Image
### END INIT INFO


set -e

PATH=/bin:/usr/bin:/sbin:/usr/sbin
DESC="Openmoko Framework Testing Image"
NAME=openmoko-fso
PROG_FSO=/usr/bin/openmoko-fso-session
PROG_XSESSION=/etc/X11/Xsession
PROG_XINIT=/usr/bin/xinit
PIDDIR=/var/run/
PIDFILE=${PIDDIR}/${NAME}.pid


# Gracefully exit if the package has been removed (but not purged).
[ -x "$PROG_FSO" -o -x "$PROG_XINIT" ] || exit 0

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
. /lib/lsb/init-functions


case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
start-stop-daemon --start --pidfile ${PIDFILE} --make-pidfile --background --exec ${PROG_XINIT} -- ${PROG_XSESSION} ${PROG_FSO} -- vt4
[ "$VERBOSE" != no ] && log_end_msg $?
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
start-stop-daemon --stop --pidfile ${PIDFILE} --oknodo
[ "$VERBOSE" != no ] && log_end_msg $?
;;
restart|force-reload)
$0 stop
$0 start
;;
*)
log_success_msg "Usage: $0 {start|stop|restart|force-reload}" >&2
exit 1
;;
esac


exit 0

0 comments on commit eebb441

Please sign in to comment.