summaryrefslogtreecommitdiff
path: root/bin/caribou-preferences.in
diff options
context:
space:
mode:
authorEitan Isaacson <eitan@monotonous.org>2011-04-29 23:22:45 -0700
committerEitan Isaacson <eitan@monotonous.org>2011-05-02 10:22:25 -0700
commit18c12607e1412702053132862e08070b0278b0a6 (patch)
tree1c0d2d7bc28f5e3c15f01bb98103da8e75490fbe /bin/caribou-preferences.in
parent72f755f6e1ea89bee617fb6faafa1868b07c0268 (diff)
downloadcaribou-18c12607e1412702053132862e08070b0278b0a6.tar.gz
Updated executables to be shell scripts.
Hopefully we set the right env variables.
Diffstat (limited to 'bin/caribou-preferences.in')
-rw-r--r--bin/caribou-preferences.in61
1 files changed, 41 insertions, 20 deletions
diff --git a/bin/caribou-preferences.in b/bin/caribou-preferences.in
index a745bab..13948c8 100644
--- a/bin/caribou-preferences.in
+++ b/bin/caribou-preferences.in
@@ -1,27 +1,48 @@
-#!/usr/bin/python
-
-import sys, os
-
-libs = os.path.join('@prefix@', 'lib', 'python@PYTHON_VERSION@', 'site-packages')
-
-# This might be run from the build dir.
-_dirname = os.path.dirname(__file__)
-if _dirname != "@prefix@/bin":
- libs = os.path.normpath(os.path.join(_dirname, '..'))
-
-sys.path.insert(1, libs)
-
-from gi.repository import Gtk
-from caribou.settings.settings_manager import SettingsManager
-from caribou.settings import CaribouSettings
-from caribou.settings.preferences_window import PreferencesWindow
-
+#!/bin/bash
+#
+# Antler - a Caribou keyboard implementation
+#
+# Copyright (C) 2011 Eitan Isaacson <eitan@monotonous.org>
+#
+# This program 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.1 of the License, or (at your
+# option) any later version.
+#
+# This program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+script_dir="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
+
+if [ $script_dir == "@prefix@@libexecdir@" ]
+then
+ export PYTHONPATH="@prefix@/lib/python@PYTHON_VERSION@/site-packages:${PYTHONPATH}"
+ export GI_TYPELIB_PATH="@libdir@/girepository-1.0:${GI_TYPELIB_PATH}"
+ export LD_LIBRARY_PATH="@libdir@:${LD_LIBRARY_PATH}"
+ export XDG_DATA_DIRS="@prefix@@datadir@:${XDG_DATA_DIRS}"
+else
+ export PYTHONPATH="$(dirname $script_dir):${PYTHONPATH}"
+ export GI_TYPELIB_PATH="$(dirname $script_dir)/licaribou:${GI_TYPELIB_PATH}"
+ export LD_LIBRARY_PATH="$(dirname $script_dir)/licaribou/.lib:${LD_LIBRARY_PATH}"
+fi
+
+@PYTHON@ -c "
import signal
signal.signal(signal.SIGINT, signal.SIG_DFL)
+from caribou.settings.preferences_window import PreferencesWindow
+from caribou.settings import CaribouSettings
+from gi.repository import Gtk
+
w = PreferencesWindow(CaribouSettings())
-w.connect("delete-event", lambda x, y: Gtk.main_quit())
+w.connect('delete-event', lambda x, y: Gtk.main_quit())
w.show_all()
@@ -29,4 +50,4 @@ try:
Gtk.main()
except KeyboardInterrupt:
Gtk.main_quit()
-
+"