aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Simon Lipp <sloonz@gmail.com>2009-12-13 16:18:38 +0100
committerGravatar Dieter Plaetinck <dieter@plaetinck.be>2010-01-01 22:54:49 +0100
commit827415529f71575c9423cb120083ec874b139ac7 (patch)
treeae85f0894d0b8a5d2ac357611fdea9921c4e6c30
parenta2ddc36070d9478d3a75e3aa80760e4016ba59d2 (diff)
Add a print_events option
-rw-r--r--README1
-rw-r--r--events.c4
-rwxr-xr-xuzbl-browser2
-rw-r--r--uzbl-core.c3
-rw-r--r--uzbl-core.h1
5 files changed, 8 insertions, 3 deletions
diff --git a/README b/README
index 0d6ed04..12bd998 100644
--- a/README
+++ b/README
@@ -206,6 +206,7 @@ Besides the builtin variables you can also define your own ones and use them in
- `scheme_handler`: handler to execute for each URI navigated to - the navigation request will be ignored if handler prints "USED\n"
- `fifo_dir`: location to store fifo's
- `socket_dir`: location to store sockets
+ - `print_events`: show events on stdout
- `http_debug`: http debug mode (value 0-3)
- `shell_cmd`: alias which will be expanded to use shell commands (eg sh -c)
- `proxy_url`: http traffic socks proxy (eg: http://<host>:<port>)
diff --git a/events.c b/events.c
index 719dc44..acb554c 100644
--- a/events.c
+++ b/events.c
@@ -169,8 +169,8 @@ send_event(int type, const gchar *details, const gchar *custom_event) {
}
if(event_message->str) {
- /* TODO: a means to select the interface to which events are sent */
- send_event_stdout(event_message);
+ if(uzbl.state.events_stdout)
+ send_event_stdout(event_message);
send_event_socket(event_message);
g_string_free(event_message, TRUE);
diff --git a/uzbl-browser b/uzbl-browser
index eebf9e3..57c5087 100755
--- a/uzbl-browser
+++ b/uzbl-browser
@@ -63,4 +63,4 @@ DAEMON_PID=${DAEMON_SOCKET}.pid
uzbl-event-manager -va start
#fi
-uzbl-core "$@" --connect-socket $DAEMON_SOCKET | grep -v ^EVENT
+uzbl-core "$@" --connect-socket $DAEMON_SOCKET
diff --git a/uzbl-core.c b/uzbl-core.c
index 9203fd0..9c8660e 100644
--- a/uzbl-core.c
+++ b/uzbl-core.c
@@ -53,6 +53,8 @@ GOptionEntry entries[] =
"Socket ID", "SOCKET" },
{ "connect-socket", 0, 0, G_OPTION_ARG_STRING_ARRAY, &uzbl.state.connect_socket_names,
"Connect to server socket", "CSOCKET" },
+ { "print-events", 'p', 0, G_OPTION_ARG_NONE, &uzbl.state.events_stdout,
+ "Whether to print events to stdout.", NULL },
{ "geometry", 'g', 0, G_OPTION_ARG_STRING, &uzbl.gui.geometry,
"Set window geometry (format: WIDTHxHEIGHT+-X+-Y or maximized)", "GEOMETRY" },
{ "version", 'V', 0, G_OPTION_ARG_NONE, &uzbl.behave.print_version,
@@ -85,6 +87,7 @@ const struct var_name_to_ptr_t {
/* ---------------------------------------------------------------------------------------------- */
{ "uri", PTR_V_STR(uzbl.state.uri, 1, cmd_load_uri)},
{ "verbose", PTR_V_INT(uzbl.state.verbose, 1, NULL)},
+ { "print_events", PTR_V_INT(uzbl.state.events_stdout, 1, NULL)},
{ "inject_html", PTR_V_STR(uzbl.behave.inject_html, 0, cmd_inject_html)},
{ "geometry", PTR_V_STR(uzbl.gui.geometry, 1, cmd_set_geometry)},
{ "keycmd", PTR_V_STR(uzbl.state.keycmd, 1, NULL)},
diff --git a/uzbl-core.h b/uzbl-core.h
index 83fa4b2..df9eb1a 100644
--- a/uzbl-core.h
+++ b/uzbl-core.h
@@ -93,6 +93,7 @@ typedef struct {
gchar* keycmd;
gchar* searchtx;
gboolean verbose;
+ gboolean events_stdout;
GPtrArray *event_buffer;
gchar** connect_socket_names;
GdkEventButton *last_button;