From 4d646d4abb62e2d894569e13f4901aa68319d24b Mon Sep 17 00:00:00 2001 From: Gobinath Date: Sat, 14 Oct 2017 10:03:39 -0400 Subject: [PATCH] Use XDG env variables --- safeeyes/Utility.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/safeeyes/Utility.py b/safeeyes/Utility.py index bd8da1f..9e8cb9c 100644 --- a/safeeyes/Utility.py +++ b/safeeyes/Utility.py @@ -41,8 +41,8 @@ from gi.repository import GLib gi.require_version('Gdk', '3.0') BIN_DIRECTORY = os.path.dirname(os.path.realpath(__file__)) -HOME_DIRECTORY = os.path.expanduser('~') -CONFIG_DIRECTORY = os.path.join(HOME_DIRECTORY, '.config/safeeyes') +HOME_DIRECTORY = os.environ.get('HOME') or os.path.expanduser('~') +CONFIG_DIRECTORY = os.path.join(os.environ.get('XDG_CONFIG_HOME') or os.path.join(HOME_DIRECTORY, '.config'), 'safeeyes') CONFIG_FILE_PATH = os.path.join(CONFIG_DIRECTORY, 'safeeyes.json') CONFIG_RESOURCE = os.path.join(CONFIG_DIRECTORY, 'resource') SESSION_FILE_PATH = os.path.join(CONFIG_DIRECTORY, 'session.json') @@ -55,7 +55,6 @@ USER_PLUGINS_DIR = os.path.join(CONFIG_DIRECTORY, 'plugins') LOCALE_PATH = os.path.join(BIN_DIRECTORY, 'config/locale') DESKTOP_ENVIRONMENT = None - def get_resource_path(resource_name): """ Return the user-defined resource if a system resource is overridden by the user.