aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Rob <rob.manea@gmail.com>2009-10-27 00:11:39 +0100
committerGravatar Rob <rob.manea@gmail.com>2009-10-27 00:11:39 +0100
commit9d7ae1b21aefac2cf5418667bd150c110bf8932e (patch)
treec9dd626c1e9a16dc81ffa1f138d56d8320c68d1d
parent9fd31dd90cce684ca91e97137d902806af1f59f9 (diff)
parent7dd0b2b4ce792274d6e2e0e8b1059b510a6e7caf (diff)
Merge branch 'experimental' of git://github.com/Dieterbe/uzbl into experimental
-rw-r--r--Makefile51
-rw-r--r--examples/data/uzbl/plugins/keycmd.py1
-rwxr-xr-xexamples/data/uzbl/scripts/event_manager.py31
-rwxr-xr-xuzbl-browser4
4 files changed, 53 insertions, 34 deletions
diff --git a/Makefile b/Makefile
index 99affde..93e70e8 100644
--- a/Makefile
+++ b/Makefile
@@ -39,7 +39,9 @@ uzbl-core: ${OBJ}
uzbl-browser: uzbl-core
-PREFIX?=$(DESTDIR)/usr/local
+# packagers, set DESTDIR to your "package directory" and PREFIX to the prefix you want to have on the end-user system
+PREFIX?=/usr/local
+INSTALLDIR?=$(DESTDIR)$(PREFIX)
# the 'tests' target can never be up to date
.PHONY: tests
@@ -62,15 +64,15 @@ test-dev: uzbl-core
test-dev-browser: uzbl-browser
XDG_DATA_HOME=./examples/data XDG_CACHE_HOME=./examples/cache XDG_CONFIG_HOME=./examples/config PATH="`pwd`:$$PATH" ./examples/data/uzbl/scripts/cookie_daemon.py start -nv &
XDG_DATA_HOME=./examples/data XDG_CACHE_HOME=./examples/cache XDG_CONFIG_HOME=./examples/config PATH="`pwd`:$$PATH" ./examples/data/uzbl/scripts/event_manager.py start -nv &
- XDG_DATA_HOME=./examples/data XDG_CACHE_HOME=./examples/cache XDG_CONFIG_HOME=./examples/config PATH="`pwd`:$$PATH:`pwd`/examples/data/uzbl/scripts/" ./uzbl-browser --uri http://www.uzbl.org --verbose
+ XDG_DATA_HOME=./examples/data XDG_CACHE_HOME=./examples/cache XDG_CONFIG_HOME=./examples/config PATH="`pwd`:`pwd`/examples/data/uzbl/scripts/:$$PATH" ./uzbl-browser --uri http://www.uzbl.org --verbose
XDG_DATA_HOME=./examples/data XDG_CACHE_HOME=./examples/cache XDG_CONFIG_HOME=./examples/config PATH="`pwd`:$$PATH" ./examples/data/uzbl/scripts/cookie_daemon.py stop -v
XDG_DATA_HOME=./examples/data XDG_CACHE_HOME=./examples/cache XDG_CONFIG_HOME=./examples/config PATH="`pwd`:$$PATH" ./examples/data/uzbl/scripts/event_manager.py stop -v
test-share: uzbl-core
- XDG_DATA_HOME=${PREFIX}/share/uzbl/examples/data XDG_CONFIG_HOME=${PREFIX}/share/uzbl/examples/config ./uzbl-core --uri http://www.uzbl.org --verbose
+ XDG_DATA_HOME=${INSTALLDIR}/share/uzbl/examples/data XDG_CONFIG_HOME=${INSTALLDIR}/share/uzbl/examples/config ./uzbl-core --uri http://www.uzbl.org --verbose
test-share-browser: uzbl-browser
- XDG_DATA_HOME=${PREFIX}/share/uzbl/examples/data XDG_CONFIG_HOME=${PREFIX}/share/uzbl/examples/config PATH="`pwd`:$$PATH" ./uzbl-browser --uri http://www.uzbl.org --verbose
+ XDG_DATA_HOME=${INSTALLDIR}/share/uzbl/examples/data XDG_CONFIG_HOME=${INSTALLDIR}/share/uzbl/examples/config PATH="`pwd`:$$PATH" ./uzbl-browser --uri http://www.uzbl.org --verbose
clean:
rm -f uzbl-core
@@ -83,29 +85,30 @@ clean:
install: install-uzbl-core install-uzbl-browser install-uzbl-tabbed
install-uzbl-core: all
- install -d $(PREFIX)/bin
- install -d $(PREFIX)/share/uzbl/docs
- install -d $(PREFIX)/share/uzbl/examples
- cp -rp docs $(PREFIX)/share/uzbl/
- cp -rp config.h $(PREFIX)/share/uzbl/docs/
- cp -rp examples $(PREFIX)/share/uzbl/
- install -m755 uzbl-core $(PREFIX)/bin/uzbl-core
- install -m644 AUTHORS $(PREFIX)/share/uzbl/docs
- install -m644 README $(PREFIX)/share/uzbl/docs
+ install -d $(INSTALLDIR)/bin
+ install -d $(INSTALLDIR)/share/uzbl/docs
+ install -d $(INSTALLDIR)/share/uzbl/examples
+ cp -rp docs $(INSTALLDIR)/share/uzbl/
+ cp -rp config.h $(INSTALLDIR)/share/uzbl/docs/
+ cp -rp examples $(INSTALLDIR)/share/uzbl/
+ install -m755 uzbl-core $(INSTALLDIR)/bin/uzbl-core
+ install -m644 AUTHORS $(INSTALLDIR)/share/uzbl/docs
+ install -m644 README $(INSTALLDIR)/share/uzbl/docs
install-uzbl-browser: all
- install -d $(PREFIX)/bin
- install -m755 uzbl-browser $(PREFIX)/bin/uzbl-browser
- 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
+ install -d $(INSTALLDIR)/bin
+ install -m755 uzbl-browser $(INSTALLDIR)/bin/uzbl-browser
+ install -m755 examples/data/uzbl/scripts/cookie_daemon.py $(INSTALLDIR)/bin/cookie_daemon.py
+ install -m755 examples/data/uzbl/scripts/event_manager.py $(INSTALLDIR)/bin/event_manager.py
+ sed -i 's#^PREFIX=.*#PREFIX=$(PREFIX)#' $(INSTALLDIR)/bin/uzbl-browser
+ sed -i "s#^PREFIX = None#PREFIX = '$(PREFIX)'#" $(INSTALLDIR)/bin/event_manager.py
install-uzbl-tabbed: all
- install -d $(PREFIX)/bin
- install -m755 examples/data/uzbl/scripts/uzbl_tabbed.py $(PREFIX)/bin/uzbl-tabbed
+ install -d $(INSTALLDIR)/bin
+ install -m755 examples/data/uzbl/scripts/uzbl_tabbed.py $(INSTALLDIR)/bin/uzbl-tabbed
uninstall:
- rm -rf $(PREFIX)/bin/uzbl-*
- rm -rf $(PREFIX)/bin/cookie_daemon.py
- rm -rf $(PREFIX)/bin/event_manager.py
- rm -rf $(PREFIX)/share/uzbl
+ rm -rf $(INSTALLDIR)/bin/uzbl-*
+ rm -rf $(INSTALLDIR)/bin/cookie_daemon.py
+ rm -rf $(INSTALLDIR)/bin/event_manager.py
+ rm -rf $(INSTALLDIR)/share/uzbl
diff --git a/examples/data/uzbl/plugins/keycmd.py b/examples/data/uzbl/plugins/keycmd.py
index 9696521..d01d2ac 100644
--- a/examples/data/uzbl/plugins/keycmd.py
+++ b/examples/data/uzbl/plugins/keycmd.py
@@ -249,7 +249,6 @@ def key_press(uzbl, key):
k = get_keylet(uzbl)
key = k.key_modmap(key.strip())
- print 'KEY', key
if key.startswith("ISO_"):
return
diff --git a/examples/data/uzbl/scripts/event_manager.py b/examples/data/uzbl/scripts/event_manager.py
index 391fb84..9c269c7 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,16 +66,18 @@ 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,
'daemon_mode': True,
+ 'auto_close': False,
'plugins_load': [],
'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'),
@@ -657,16 +665,18 @@ class UzblEventDaemon(dict):
'''Clean up after instance close.'''
try:
- if client not in self['uzbls']:
- return
-
- uzbl = self['uzbls'][client]
- uzbl.close()
- del self['uzbls'][client]
+ if client in self['uzbls']:
+ uzbl = self['uzbls'][client]
+ uzbl.close()
+ del self['uzbls'][client]
except:
print_exc()
+ if not len(self['uzbls']) and config['auto_close']:
+ echo('auto closing event manager.')
+ self.running = False
+
def quit(self):
'''Close all instance socket objects, server socket and delete the
@@ -776,6 +786,9 @@ if __name__ == "__main__":
parser.add_option('-n', '--no-daemon', dest="daemon",
action="store_true", help="don't enter daemon mode.")
+ parser.add_option('-a', '--auto-close', dest='autoclose',
+ action='store_true', help='auto close after all instances disconnect.')
+
(options, args) = parser.parse_args()
# init like {start|stop|..} daemon control section.
@@ -824,6 +837,10 @@ if __name__ == "__main__":
echo('ignoring plugin(s): %s' % ', '.join(plugins_ignore))
+ if options.autoclose:
+ config['auto_close'] = True
+ echo('will auto close.')
+
if options.pid:
config['pid_file'] = options.pid
echo("pid file location: %r" % config['pid_file'])
diff --git a/uzbl-browser b/uzbl-browser
index 1084291..7cc8002 100755
--- a/uzbl-browser
+++ b/uzbl-browser
@@ -54,11 +54,11 @@ 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
- event_manager.py -v start
+ event_manager.py -va start
#fi
uzbl-core "$@" --connect-socket $DAEMON_SOCKET | grep -v ^EVENT