diff options
-rw-r--r-- | Makefile | 1 | ||||
-rwxr-xr-x | examples/data/uzbl/scripts/event_manager.py | 9 | ||||
-rwxr-xr-x | uzbl-browser | 2 |
3 files changed, 10 insertions, 2 deletions
@@ -99,6 +99,7 @@ install-uzbl-browser: all install -m755 examples/data/uzbl/scripts/cookie_daemon.py $(PREFIX)/bin/cookie_daemon.py install -m755 examples/data/uzbl/scripts/event_manager.py $(PREFIX)/bin/event_manager.py sed -i 's#^PREFIX=.*#PREFIX=$(PREFIX)#' $(PREFIX)/bin/uzbl-browser + sed -i "s#^PREFIX = None#PREFIX = '$(PREFIX)'#" $(PREFIX)/bin/event_manager.py install-uzbl-tabbed: all install -d $(PREFIX)/bin diff --git a/examples/data/uzbl/scripts/event_manager.py b/examples/data/uzbl/scripts/event_manager.py index 391fb84..aaf3295 100755 --- a/examples/data/uzbl/scripts/event_manager.py +++ b/examples/data/uzbl/scripts/event_manager.py @@ -45,6 +45,12 @@ from traceback import print_exc # ::: Default configuration section :::::::::::::::::::::::::::::::::::::::::: # ============================================================================ +# Automagically set during `make install` +PREFIX = None + +# Check if PREFIX not set and set to default /usr/local/ +if not PREFIX: + PREFIX = '/usr/local/' def xdghome(key, default): '''Attempts to use the environ XDG_*_HOME paths if they exist otherwise @@ -60,6 +66,7 @@ def xdghome(key, default): DATA_DIR = os.path.join(xdghome('DATA', '.local/share/'), 'uzbl/') CACHE_DIR = os.path.join(xdghome('CACHE', '.cache/'), 'uzbl/') + # Config dict (NOT the same as the uzbl.config). config = { 'verbose': False, @@ -69,7 +76,7 @@ config = { 'plugins_ignore': [], 'plugin_dirs': [os.path.join(DATA_DIR, 'plugins/'), - '/usr/local/share/uzbl/examples/data/uzbl/plugins/'], + os.path.join(PREFIX, 'share/uzbl/examples/data/uzbl/plugins/')], 'server_socket': os.path.join(CACHE_DIR, 'event_daemon'), 'pid_file': os.path.join(CACHE_DIR, 'event_daemon.pid'), diff --git a/uzbl-browser b/uzbl-browser index 1084291..94c2c2a 100755 --- a/uzbl-browser +++ b/uzbl-browser @@ -54,7 +54,7 @@ then fi DAEMON_SOCKET=$XDG_CACHE_HOME/uzbl/event_daemon -DAEMON_PID=$XDG_CACHE_HOME/uzbl/event_daemon.pid +DAEMON_PID=${DAEMON_SOCKET}.pid #if [ -f "$DAEMON_PID" ] #then |