aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CHECKLIST17
-rw-r--r--README2
-rw-r--r--TODO4
-rw-r--r--examples/configs/sampleconfig17
-rw-r--r--examples/configs/sampleconfig-dev13
-rwxr-xr-xmisc/cleanprocs-files.sh10
-rwxr-xr-xmisc/fifotest.sh20
-rw-r--r--uzbl.c78
-rw-r--r--uzbl.h2
9 files changed, 117 insertions, 46 deletions
diff --git a/CHECKLIST b/CHECKLIST
index 26f733f..2b33d12 100644
--- a/CHECKLIST
+++ b/CHECKLIST
@@ -4,28 +4,29 @@ Also, when you finish a new feature, add it to this list so that everyone knows
Also testers and interested people can use this list to see what uzbl is about, and report problems if they find items listed here that do not work.
-* commandline switches --uri "http://.." and --config should behave as expected
+* commandline switches --uri "http://.." and --config behave as expected
* --help and -? should show help
* config loading: loading of settings, bindings and all behavior settings (including handlers) from config file
* fifo: type this in your shell after starting uzbl:
echo 'uri http://www...' > <fifo path here>'
where <fifo path> is printed on stdout during program startup. Also "back" , "forward", "refresh" (basically all actions defined in `static Command commands` should behave as expected)
- -> temporarily changed to socket io with uzblctrl. see examples in scripts
+ On one of Dieter's pc's, using the fifo only works once. Please report issues with the fifo if you find any.
+* socket: uzblctrl -s <socketname> -c <command> (same commands as with fifo)
* history logging: the script as defined in sample config should write history entries (date,time, url) into the file defined in the script (by default ./extra/history.sh and /tmp/uzbl.history)
* invocations of external commands: you'll see it on stdout everytime uzbl calls an external script/program. the invocations should work and none of the arguments passed should be null/garbage/.. .
all should be valid strings and contain things like the pid, fifo file, config file,.. (see README for details).
* XDG_CONFIG_HOME and XDG_CONFIG_DIRS (+ default values) fully supported and working (looks for a config file called 'uzbl/config').
* --uri can be specified without http:// -- if missing will be prepended.
* Downloading of files with handler script
-* Open in new window partially finished: target _new works, from popup meny does not work yet
-* Home command working (home_page variable in config)
-* Page Up / Page Down / Up / Down / Left / Right for page navigation work in command mode.
-* Open in new window completely finished with --config forwarding between instances
+* Open in new window. all (valid) args passed to your uzbl instance are passed also to the new instance, with the obvious exception of --uri.
* internal keybinds to change things work (as loaded by config)
* vimlike command and insert modes behave as expected
* always_insert_mode and modkey work too
* status bar can be toggled on and off, if off, some info (mode) will be put in title bar. position of statusbar (top/bottom) also works
-* backspace erases last edit character
-* commands with parameters: any key sequence that ends with underscore _ expects parameter. Undersore marks exact location where parameter begins. Command part can have %s that will be replaced with parameter.
+* backspace erases last edit character. esc erases entire command buffer (if in comand mode)
+* commands with parameters (keywords): any key sequence that ends with underscore _ expects parameter. Undersore marks exact location where parameter begins. Command part can have %s that will be replaced with parameter.
:o _ = uri %s - user needs to type :o www.google.com
:O_ = uri %s - user needs to type :Owww.google.com
+* when typing command, press insert (paste X cliboard) or shift insert (paste primary selection buffer)
+* proxy, user agent and other network settings can be set in config
+* scrolling works, with configurable keys (vi-like in sample config)
diff --git a/README b/README
index 6c1b23f..2087b2a 100644
--- a/README
+++ b/README
@@ -121,3 +121,5 @@ The script specific arguments are this:
KNOWN BUGS
- Segfaults when using zoom commands (happens when max zoom already reached?).
- Something in the FIFO code causes CPU usage to jump.
+
+Report new issues @ uzbl.org/bugs
diff --git a/TODO b/TODO
index 0a812c1..0546009 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,3 @@
-ASAP
-* fix bug that causes hang after first fifo command
-
* implement all the ideas from README
* get a logo
* when launching new instance, don't just try 'uzbl' and then './uzbl', rather launch a new uzbl in the same way the current uzbl instance was started. (same command, same arguments, except --uri)
@@ -15,7 +12,6 @@ ASAP
* select/fork based instead of the pthread stuff -> drops dependency, more lightweight.
* scrolling: make page up and page down configurable.
* show % of location in statusbar/title if page doesn't fit entirely on view.
-* put on uzbl.org that you can use http://github.com/Dieterbe/uzbl/issues after registering
* make default size configurable, and optional
* on uzbl.org commits overview: add date+time and repository
* how to handle different content types? (text-plain, image/png, application/pdf,... maybe a map of content-type to uzbl/command
diff --git a/examples/configs/sampleconfig b/examples/configs/sampleconfig
index 3fddc89..6496dbd 100644
--- a/examples/configs/sampleconfig
+++ b/examples/configs/sampleconfig
@@ -22,33 +22,36 @@ status_top = 0
[bindings]
# scroll down/up/left/right
-j = scroll_vert 20
-k = scroll_vert -20
-h = scroll_horz -20
-l = scroll_horz 20
+j = scroll_vert 20
+k = scroll_vert -20
+h = scroll_horz -20
+l = scroll_horz 20
b = back
m = forward
s = stop
r = reload
R = reload_ign_cache
-gh = uri http://www.uzbl.org
f = follow_link_here
F = follow_link_new_tab
w = follow_link_new_window
+ = zoom_in
- = zoom_out
t = toggle_status
-ZZ = exit
+gh = uri http://www.uzbl.org
+o _ = uri %s
+:wiki _ = uri http://wiki.archlinux.org/index.php/Special:Search?search=%s&go=Go
+gg _ = uri http://www.google.com/search?q=%s
i = insert_mode
B = spawn /usr/share/uzbl/examples/scripts/insert_bookmark.sh
u = spawn /usr/share/uzbl/examples/scripts/load_url_from_history.sh
U = spawn /usr/share/uzbl/examples/scripts/load_url_from_bookmarks.sh
+ZZ = exit
[network]
proxy_server =
#values 0-3
-http_debug = 1
+http_debug = 0
user-agent = uzbl
max_conns =
max_conns_per_host =
diff --git a/examples/configs/sampleconfig-dev b/examples/configs/sampleconfig-dev
index b151e92..967d9e5 100644
--- a/examples/configs/sampleconfig-dev
+++ b/examples/configs/sampleconfig-dev
@@ -21,7 +21,7 @@ show_status = 1
status_top = 0
[bindings]
-## scroll down/up/left/right
+# scroll down/up/left/right
j = scroll_vert 20
k = scroll_vert -20
h = scroll_horz -20
@@ -31,22 +31,21 @@ m = forward
s = stop
r = reload
R = reload_ign_cache
-gh = uri http://www.uzbl.org
f = follow_link_here
F = follow_link_new_tab
w = follow_link_new_window
+ = zoom_in
- = zoom_out
t = toggle_status
-ZZ = exit
+gh = uri http://www.uzbl.org
+o _ = uri %s
+:wiki _ = uri http://wiki.archlinux.org/index.php/Special:Search?search=%s&go=Go
+gg _ = uri http://www.google.com/search?q=%s
i = insert_mode
B = spawn ./examples/scripts/insert_bookmark.sh
u = spawn ./examples/scripts/load_url_from_history.sh
U = spawn ./examples/scripts/load_url_from_bookmarks.sh
-#parameter command examples (all need space but can be removed from individual commands). underscore is important.
-o _ = uri %s
-:wiki _ = uri http://wiki.archlinux.org/index.php/Special:Search?search=%s&go=Go
-gg _ = uri http://www.google.com/search?q=%s
+ZZ = exit
[network]
# to start a local socks server, do : ssh -fND localhost:8118 localhost
diff --git a/misc/cleanprocs-files.sh b/misc/cleanprocs-files.sh
new file mode 100755
index 0000000..463d1fb
--- /dev/null
+++ b/misc/cleanprocs-files.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+killall uzbl; killall strace;
+killall -9 uzbl; killall -9 strace
+
+rm -rf /tmp/uzbl_*
+
+echo "Uzbl processes:"
+ps aux | grep uzbl | grep -v grep
+echo "Uzbl /tmp entries:"
+ls -alh /tmp/uzbl* 2>/dev/null
diff --git a/misc/fifotest.sh b/misc/fifotest.sh
new file mode 100755
index 0000000..8ad0593
--- /dev/null
+++ b/misc/fifotest.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+if [ -z "$1" ]
+then
+ echo "Need fifo filename!" >&2
+ exit 2
+fi
+while :
+do
+ echo 'uri dns.be'
+ echo 'uri dns.be' > $1
+ sleep 2
+ echo 'uri www.archlinux.org'
+ echo 'uri www.archlinux.org' > $1
+ sleep 2
+ echo 'uri icanhascheezburger.com'
+ echo 'uri icanhascheezburger.com' > $1
+ sleep 2
+ echo 'back'
+ echo 'back' > $1
+done
diff --git a/uzbl.c b/uzbl.c
index b1220f0..6d0d680 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -477,28 +477,54 @@ build_stream_name(int type) {
}
static void
-control_fifo(GIOChannel *fd) {
+control_fifo(GIOChannel *gio, GIOCondition condition) {
+ printf("triggered\n");
gchar *ctl_line;
- if(!fd)
- return;
- g_io_channel_read_line(fd, &ctl_line, NULL, NULL, NULL);
+ GIOStatus ret;
+ GError *err = NULL;
+
+ if (condition & G_IO_HUP)
+ g_error ("Fifo: Read end of pipe died!\n");
+
+ if(!gio)
+ g_error ("Fifo: GIOChannel broke\n");
+
+ ret = g_io_channel_read_line(gio, &ctl_line, NULL, NULL, &err);
+ if (ret == G_IO_STATUS_ERROR)
+ g_error ("Fifo: Error reading: %s\n", err->message);
+
+
parse_line(ctl_line);
g_free(ctl_line);
+ printf("...done\n");
return;
}
static void
create_fifo() {
GIOChannel *chan = NULL;
+ GError *error = NULL;
build_stream_name(FIFO);
- printf ("Control fifo opened in %s\n", fifo_path);
+ if (file_exists(fifo_path)) {
+ g_error ("Fifo: Error when creating %s: File exists\n", fifo_path);
+ return;
+ }
if (mkfifo (fifo_path, 0666) == -1) {
- printf ("Possible error creating fifo\n");
+ g_error ("Fifo: Error when creating %s: %s\n", fifo_path, strerror(errno));
+ } else {
+ // we don't really need to write to the file, but if we open the file as 'r' we will block here, waiting for a writer to open the file.
+ chan = g_io_channel_new_file((gchar *) fifo_path, "r+", &error);
+ if (chan) {
+ if (!g_io_add_watch(chan, G_IO_IN|G_IO_HUP, (GIOFunc) control_fifo, NULL)) {
+ g_error ("Fifo: could not add watch on %s\n", fifo_path);
+ } else {
+ printf ("Fifo: created successfully as %s\n", fifo_path);
+ }
+ } else {
+ g_error ("Fifo: Error while opening: %s\n", error->message);
+ }
}
-
- if( (chan = g_io_channel_new_file((gchar *) fifo_path, "r+", NULL)) )
- g_io_add_watch(chan, G_IO_IN|G_IO_HUP, (GIOFunc) control_fifo, chan);
return;
}
@@ -573,16 +599,14 @@ create_socket() {
bind (sock, (struct sockaddr *) &local, len);
if (errno == -1) {
- printf ("Socket: Could not open in %s\n", socket_path);
+ printf ("Socket: Could not open in %s: %s\n", socket_path, strerror(errno));
} else {
printf ("Socket: Opened in %s\n", socket_path);
- }
+ listen (sock, 5);
- listen (sock, 5);
-
- if( (chan = g_io_channel_unix_new(sock)) )
- g_io_add_watch(chan, G_IO_IN|G_IO_HUP, (GIOFunc) control_socket, chan);
-
+ if( (chan = g_io_channel_unix_new(sock)) )
+ g_io_add_watch(chan, G_IO_IN|G_IO_HUP, (GIOFunc) control_socket, chan);
+ }
}
static void
@@ -631,7 +655,7 @@ update_title (void) {
g_free (title_long);
g_free (title_short);
}
-
+
static gboolean
key_press_cb (WebKitWebView* page, GdkEventKey* event)
{
@@ -651,7 +675,7 @@ key_press_cb (WebKitWebView* page, GdkEventKey* event)
return TRUE;
}
- if (insert_mode && event->state != modmask)
+ if (insert_mode && ((event->state & modmask) != modmask))
return FALSE;
if (event->keyval == GDK_Escape) {
@@ -660,6 +684,22 @@ key_press_cb (WebKitWebView* page, GdkEventKey* event)
return TRUE;
}
+ //Insert without shift - insert from clipboard; Insert with shift - insert from primary
+ if (event->keyval == GDK_Insert) {
+ gchar * str;
+ if ((event->state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK) {
+ str = gtk_clipboard_wait_for_text (gtk_clipboard_get (GDK_SELECTION_PRIMARY));
+ } else {
+ str = gtk_clipboard_wait_for_text (gtk_clipboard_get (GDK_SELECTION_CLIPBOARD));
+ }
+ if (str) {
+ g_string_append_printf (keycmd, "%s", str);
+ update_title ();
+ free (str);
+ }
+ return TRUE;
+ }
+
if ((event->keyval == GDK_BackSpace) && (keycmd->len > 0)) {
g_string_truncate(keycmd, keycmd->len - 1);
update_title();
@@ -759,7 +799,7 @@ add_binding (const gchar *key, const gchar *act) {
return;
//Debug:
- printf ("@%s@ @%s@ @%s@\n", key, parts[0], parts[1]);
+ printf ("Binding %-10s : %s\n", key, act);
action = new_action(parts[0], parts[1]);
g_hash_table_insert(bindings, g_strdup(key), action);
diff --git a/uzbl.h b/uzbl.h
index 652f2f0..d0d6ec7 100644
--- a/uzbl.h
+++ b/uzbl.h
@@ -83,7 +83,7 @@ void
build_stream_name(int type);
static void
-control_fifo(GIOChannel *fd);
+control_fifo(GIOChannel *gio, GIOCondition condition);
static void
create_fifo();