From f77ad2b41d84baf975ceef81eda0c20b1f6c479d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 14 Dec 2018 23:01:49 +0530 Subject: [PATCH] Add a couple of extra lib names for libstartup-notification.so Fixes #1235 --- kitty/desktop.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kitty/desktop.c b/kitty/desktop.c index 2cba987c5..5681ae4b4 100644 --- a/kitty/desktop.c +++ b/kitty/desktop.c @@ -31,10 +31,15 @@ static PyObject* init_x11_startup_notification(PyObject UNUSED *self, PyObject *args) { static bool done = false; static const char* libname = "libstartup-notification-1.so"; + // some installs are missing the .so symlink, so try the full name + static const char* libname2 = "libstartup-notification-1.so.0"; + static const char* libname3 = "libstartup-notification-1.so.0.0.0"; if (!done) { done = true; libsn_handle = dlopen(libname, RTLD_LAZY); + if (libsn_handle == NULL) libsn_handle = dlopen(libname2, RTLD_LAZY); + if (libsn_handle == NULL) libsn_handle = dlopen(libname3, RTLD_LAZY); if (libsn_handle == NULL) { PyErr_Format(PyExc_OSError, "Failed to load %s with error: %s", libname, dlerror()); return NULL;