aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile5
-rw-r--r--Makefile-new-test5
-rw-r--r--README7
-rw-r--r--docs/FAQ2
-rw-r--r--docs/INSTALL2
-rwxr-xr-xexamples/data/uzbl/scripts/load_url_from_bookmarks.sh2
-rwxr-xr-xexamples/data/uzbl/scripts/load_url_from_history.sh2
-rw-r--r--uzblctrl.c71
9 files changed, 9 insertions, 88 deletions
diff --git a/.gitignore b/.gitignore
index 1ee1e9e..bbc3d90 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,4 @@
uzbl
-uzblctrl
uzbl.o
*~
tags
diff --git a/Makefile b/Makefile
index fbc85a1..c5ddc60 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ CFLAGS!=echo -std=c99 `pkg-config --cflags gtk+-2.0 webkit-1.0 libsoup-2.4 gthre
LDFLAGS:=$(shell pkg-config --libs gtk+-2.0 webkit-1.0 libsoup-2.4 gthread-2.0) -pthread $(LDFLAGS)
LDFLAGS!=echo `pkg-config --libs gtk+-2.0 webkit-1.0 libsoup-2.4 gthread-2.0` -pthread $(LDFLAGS)
-all: uzbl uzblctrl
+all: uzbl
PREFIX?=$(DESTDIR)/usr
@@ -27,7 +27,6 @@ test-share: uzbl
clean:
rm -f uzbl
- rm -f uzblctrl
rm -f uzbl.o
cd ./tests/; $(MAKE) clean
@@ -36,7 +35,6 @@ install:
install -d $(PREFIX)/share/uzbl/docs
install -d $(PREFIX)/share/uzbl/examples
install -m755 uzbl $(PREFIX)/bin/uzbl
- install -m755 uzblctrl $(PREFIX)/bin/uzblctrl
cp -rp docs $(PREFIX)/share/uzbl/
cp -rp config.h $(PREFIX)/share/uzbl/docs/
cp -rp examples $(PREFIX)/share/uzbl/
@@ -46,5 +44,4 @@ install:
uninstall:
rm -rf $(PREFIX)/bin/uzbl
- rm -rf $(PREFIX)/bin/uzblctrl
rm -rf $(PREFIX)/share/uzbl
diff --git a/Makefile-new-test b/Makefile-new-test
index 9f85a4e..a1efa56 100644
--- a/Makefile-new-test
+++ b/Makefile-new-test
@@ -12,7 +12,7 @@ UZBLDATA ?= $(PREFIX)/share/uzbl
DOCSDIR ?= $(PREFIX)/share/uzbl/docs
EXMPLSDIR ?= $(PREFIX)/share/uzbl/examples
-all: uzbl uzblctrl
+all: uzbl
uzbl: uzbl.c uzbl.h config.h
@@ -30,14 +30,12 @@ test-config-real: uzbl
clean:
rm -f uzbl
- rm -f uzblctrl
install:
install -d $(BINDIR)
install -d $(DOCSDIR)
install -d $(EXMPLSDIR)
install -D -m755 uzbl $(BINDIR)/uzbl
- install -D -m755 uzblctrl $(BINDIR)/uzblctrl
cp -ax docs/* $(DOCSDIR)
cp -ax config.h $(DOCSDIR)
cp -ax examples/* $(EXMPLSDIR)
@@ -47,5 +45,4 @@ install:
uninstall:
rm -rf $(BINDIR)/uzbl
- rm -rf $(BINDIR)/uzblctrl
rm -rf $(UZBLDATA)
diff --git a/README b/README
index b36293c..fbb849f 100644
--- a/README
+++ b/README
@@ -44,7 +44,7 @@ Time to change that!
- privoxy looks cool and perfectly demonstrates the unix philosphy.
- same for http://bfilter.sourceforge.net
- /etc/hosts (not very good cause you need root and it affects the whole system)
- uzblctrl would need to support an option to list all images on a page, so you can easily pick the links to ads to add them to your /etc/hosts.
+ one can list all images on a page using the socket, so you can easily pick the links to ads to add them to your /etc/hosts.
* vimperator/konqueror-like hyperlink following.
* password management. maybe an encrypted store that unlocks with an ssh key?
* no messing in the users $HOME or in /etc: no writing of anything unless the user (or sysadmin) asks for it.
@@ -73,9 +73,8 @@ There are several interfaces to interact with uzbl:
* shift insert (paste primary selection buffer)
* FIFO & socket file: if enabled by setting their paths through one of the above means, you can have socket and fifo files available which are very useful to programatically control uzbl (from scripts etc).
The advantage of the fifo is you can write plaintxt commands to it, but it's half duplex only (uzbl cannot send a response to you).
- The socket is full duplex but you need a socket-compatible wrapper such as netcat to work with it, or uzblctrl of course,
- an utitly we include with uzbl made especially for writing commnands to the socket (and at some point, it will be able to tell you the response
- too): `uzblctrl -s <socketfile> -c <command>`
+ The socket is full duplex but you need a socket-compatible wrapper such as socat to work with it.
+ For example: echo <command> | socat - unix-connect:<socketfile>
When uzbl forks a new instance (eg "open in new window") it will use the same commandline arguments (eg the same --config <file>), except --uri and--name.
If you made changes to the configuration at runtime, these are not pased on to the child.
diff --git a/docs/FAQ b/docs/FAQ
index f8e6e8a..b5c4dcc 100644
--- a/docs/FAQ
+++ b/docs/FAQ
@@ -112,7 +112,7 @@ Yes, Webkit takes care of all of that. Not that we like all of these, but you c
They both have advantages and disadvantages:
* fifo's are _very_ easy to work with. You can write just plaintext commands into them, but they are unidirectional (you can only communicate in one direction)
- * Sockets are bidirectional but more complex. You cannot just write a plaintext string into them. In shellscripts you can use uzblctrl or netcat to work with sockets, when programming you need to use library functions.
+ * Sockets are bidirectional but more complex. You cannot just write a plaintext string into them. In shellscripts you can use socat to work with sockets, when programming you need to use library functions.
So, when writing scripts, using fifo's is usually the fastest method (because you do not need to fork another process), so fifo is preferred unless you need a response.
diff --git a/docs/INSTALL b/docs/INSTALL
index 9213cc3..41acff1 100644
--- a/docs/INSTALL
+++ b/docs/INSTALL
@@ -48,7 +48,7 @@ File locations
--------------
After installing - using either method - you will find:
-* /usr/bin : uzbl [and uzblctrl]
+* /usr/bin : uzbl
* /usr/share/uzbl/docs/ : documentation files included with uzbl. (readme, checklist, .. )
* /usr/share/uzbl/examples: sample scripts, config files and a sample data (boomarks, .. )
diff --git a/examples/data/uzbl/scripts/load_url_from_bookmarks.sh b/examples/data/uzbl/scripts/load_url_from_bookmarks.sh
index f57d7b3..1e9f9e7 100755
--- a/examples/data/uzbl/scripts/load_url_from_bookmarks.sh
+++ b/examples/data/uzbl/scripts/load_url_from_bookmarks.sh
@@ -17,4 +17,4 @@ else
fi
#[ -n "$goto" ] && echo "uri $goto" > $4
-[ -n "$goto" ] && uzblctrl -s $5 -c "uri $goto"
+[ -n "$goto" ] && echo "uri $goto" | socat - unix-connect:$5
diff --git a/examples/data/uzbl/scripts/load_url_from_history.sh b/examples/data/uzbl/scripts/load_url_from_history.sh
index 1eaf0f2..62e02ac 100755
--- a/examples/data/uzbl/scripts/load_url_from_history.sh
+++ b/examples/data/uzbl/scripts/load_url_from_history.sh
@@ -21,4 +21,4 @@ else
fi
[ -n "$goto" ] && echo "uri $goto" > $4
-#[ -n "$goto" ] && uzblctrl -s $5 -c "uri $goto"
+#[ -n "$goto" ] && echo "uri $goto" | socat - unix-connect:$5
diff --git a/uzblctrl.c b/uzblctrl.c
deleted file mode 100644
index 2547bc7..0000000
--- a/uzblctrl.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- c-basic-offset: 4; -*- */
-/* Socket code more or less completely copied from here: http://www.ecst.csuchico.edu/~beej/guide/ipc/usock.html */
-
-#include <gtk/gtk.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-
-static gchar* sockpath;
-static gchar* command;
-
-static GOptionEntry entries[] =
-{
- { "socket", 's', 0, G_OPTION_ARG_STRING, &sockpath, "Path to the uzbl socket", NULL },
- { "command", 'c', 0, G_OPTION_ARG_STRING, &command, "The uzbl command to execute", NULL },
- { NULL, 0, 0, 0, NULL, NULL, NULL }
-};
-
-int
-main(int argc, char* argv[]) {
- GError *error = NULL;
- GOptionContext* context = g_option_context_new ("- utility for controlling and interacting with uzbl through its socket file"); /* TODO: get stuff back from uzbl */
- g_option_context_add_main_entries (context, entries, NULL);
- g_option_context_add_group (context, gtk_get_option_group (TRUE));
- g_option_context_parse (context, &argc, &argv, &error);
-
-
- if (sockpath && command) {
- int s, len;
- struct sockaddr_un remote;
- char tmp;
-
- if ((s = socket (AF_UNIX, SOCK_STREAM, 0)) == -1) {
- perror ("socket");
- exit (EXIT_FAILURE);
- }
-
- remote.sun_family = AF_UNIX;
- strcpy (remote.sun_path, (char *) sockpath);
- len = strlen (remote.sun_path) + sizeof (remote.sun_family);
-
- if (connect (s, (struct sockaddr *) &remote, len) == -1) {
- perror ("connect");
- exit (EXIT_FAILURE);
- }
-
- if ((send (s, command, strlen (command), 0) == -1) ||
- (send (s, "\n", 1, 0) == -1)) {
- perror ("send");
- exit (EXIT_FAILURE);
- }
-
- while ((len = recv (s, &tmp, 1, 0))) {
- putchar(tmp);
- if (tmp == '\n')
- break;
- }
-
- close(s);
-
- return 0;
- } else {
- fprintf(stderr, "Usage: uzblctrl -s /path/to/socket -c \"command\"");
- return 1;
- }
-}
-/* vi: set et ts=4: */