diff options
| author | Huang Peng <shawn.p.huang@gmail.com> | 2008-07-08 17:24:31 +0800 |
|---|---|---|
| committer | Huang Peng <shawn.p.huang@gmail.com> | 2008-07-08 17:24:31 +0800 |
| commit | 2b00952f26f2915cc2ff07d0140d51c492a6fda2 (patch) | |
| tree | f78b8e66ecfbedc398492b502b88e8bdf3b02b88 /launcher | |
| parent | 5175a113e99a86085d754ebc44e68bb8167d0df9 (diff) | |
| download | ibus-2b00952f26f2915cc2ff07d0140d51c492a6fda2.tar.gz ibus-2b00952f26f2915cc2ff07d0140d51c492a6fda2.tar.xz ibus-2b00952f26f2915cc2ff07d0140d51c492a6fda2.zip | |
Add ibus launcher program.
Diffstat (limited to 'launcher')
| -rw-r--r-- | launcher/Makefile.am | 30 | ||||
| -rw-r--r-- | launcher/ibus.in | 42 |
2 files changed, 72 insertions, 0 deletions
diff --git a/launcher/Makefile.am b/launcher/Makefile.am new file mode 100644 index 0000000..eaf3167 --- /dev/null +++ b/launcher/Makefile.am @@ -0,0 +1,30 @@ +# vim:set noet ts=4: +# +# ibus - The Input Bus +# +# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the +# Free Software Foundation, Inc., 59 Temple Place, Suite 330, +# Boston, MA 02111-1307 USA + +bin_SCRIPTS = ibus + +CLEANFILES = \ + $(NULL) + +EXTRA_DIST = \ + ibus.in \ + $(NULL) + diff --git a/launcher/ibus.in b/launcher/ibus.in new file mode 100644 index 0000000..82c1ac4 --- /dev/null +++ b/launcher/ibus.in @@ -0,0 +1,42 @@ +#!/usr/bin/env python +# +# ibus - The Input Bus +# +# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the +# Free Software Foundation, Inc., 59 Temple Place, Suite 330, +# Boston, MA 02111-1307 USA +import os +import sys +import time + +daemon = "@prefix@/libexec/ibus-daemon" +panel = "@prefix@/libexec/ibus-panel" + +pid = os.fork () +if pid > 0: # parent + print "start ibus-daemon" + os.execv (daemon, [daemon]) + print >> sys.stderr, "start ibus-daemon failed" + sys.exit (1) +elif pid == 0: + time.sleep (1) + print "start ibus-panel" + os.execv (panel, [panel]) + print >> sys.stderr, "start ibus-panel failed" + sys.exit (1) +else: + print >> sys.stderr, "can not start ibus" + sys.exit (1) |
