From da0122fa104e6bae61824e49b6f1007b9989b9c7 Mon Sep 17 00:00:00 2001 From: martinZuther Date: Fri, 15 Oct 2010 20:18:11 +0000 Subject: OSDneo2: Skript sucht sich jetzt die richtige Library heraus git-svn-id: https://svn.neo-layout.org@2352 b9310e46-f624-0410-8ea1-cfbb3a30dc96 --- linux/osd/SimpleXkbWrapper.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'linux/osd/SimpleXkbWrapper.py') diff --git a/linux/osd/SimpleXkbWrapper.py b/linux/osd/SimpleXkbWrapper.py index 9ce9572..12870c3 100755 --- a/linux/osd/SimpleXkbWrapper.py +++ b/linux/osd/SimpleXkbWrapper.py @@ -5,7 +5,7 @@ ======== On screen display for learning the keyboard layout Neo2 - Copyright (c) 2009 Martin Zuther (http://www.mzuther.de/) + Copyright (c) 2009-2010 Martin Zuther (http://www.mzuther.de/) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -139,13 +139,18 @@ class SimpleXkbWrapper: def __init__(self): - # dynamically link to "X Keyboard Extension" library - library_xf86misc = ctypes.CDLL(ctypes.util.find_library('Xxf86misc')) + # dynamically link to "X Keyboard Extension" library while at + # the same time checking which library to use + xkbd_library_location = ctypes.util.find_library('Xxf86misc') + if not xkbd_library_location: + xkbd_library_location = ctypes.util.find_library('X11') + + xkbd_library = ctypes.CDLL(xkbd_library_location) # print debugging information if requested if self.DEBUG_XKB: print - print ' %s' % library_xf86misc + print ' %s' % xkbd_library @@ -181,7 +186,7 @@ class SimpleXkbWrapper: # set-up function (low-level) self.__XkbOpenDisplay__ = prototype_xkbopendisplay( \ - ('XkbOpenDisplay', library_xf86misc), \ + ('XkbOpenDisplay', xkbd_library), \ paramflags_xkbopendisplay \ ) @@ -253,7 +258,7 @@ class SimpleXkbWrapper: # set-up function (low-level) self.__XkbGetState__ = prototype_xkbgetstate( \ - ('XkbGetState', library_xf86misc), \ + ('XkbGetState', xkbd_library), \ paramflags_xkbgetstate \ ) -- cgit v1.2.3