diff --git a/src/porting.cpp b/src/porting.cpp index 6686a65..a1e6fd0 100644 --- a/src/porting.cpp +++ b/src/porting.cpp @@ -143,9 +143,17 @@ void initializePaths() #elif defined(linux) #include - path_userdata = std::string(getenv("HOME")) + "/." + APPNAME; - path_data = std::string(INSTALL_PREFIX) + "/share/" + APPNAME; + char buf[BUFSIZ]; + // Get path to executable + readlink("/proc/self/exe", buf, BUFSIZ); + pathRemoveFile(buf, '/'); + + path_data = std::string(buf) + "/../share/" + APPNAME; + //path_data = std::string(INSTALL_PREFIX) + "/share/" + APPNAME; + + path_userdata = std::string(getenv("HOME")) + "/." + APPNAME; + /* OS X */