aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Barrucadu <mike@barrucadu.co.uk>2009-05-03 17:57:00 +0100
committerGravatar Barrucadu <mike@barrucadu.co.uk>2009-05-03 17:57:00 +0100
commit8b88ac0b6c9623789ae808444d8453bcf7c1326c (patch)
tree855dbeffe030ca7b210c02fa9b93d00d30d17cd7
parent8f9c1fbc0aa1cf4f848c859573b71390b058f5af (diff)
parent070aab904c4da8d64fbb02b5a2bdc79750fb16d6 (diff)
Merge branch 'dieter/experimental' into experimental
Conflicts: examples/configs/sampleconfig examples/configs/sampleconfig-dev uzbl.c
-rw-r--r--CHECKLIST20
-rw-r--r--README2
-rw-r--r--TODO5
-rw-r--r--examples/configs/sampleconfig25
-rw-r--r--examples/configs/sampleconfig-dev22
-rw-r--r--uzbl.c47
-rw-r--r--uzbl.h3
7 files changed, 78 insertions, 46 deletions
diff --git a/CHECKLIST b/CHECKLIST
index 292306c..9a9bfbf 100644
--- a/CHECKLIST
+++ b/CHECKLIST
@@ -4,13 +4,13 @@ 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 BROKEN
+ 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/.. .
@@ -18,17 +18,19 @@ Also testers and interested people can use this list to see what uzbl is about,
* 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.
+ This only works for internal commands. not when spawning external scripts.
: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 and other network settings can be set in config \ No newline at end of file
+* proxy, user agent and other network settings can be set in config
+* scrolling works, with configurable keys (vi-like in sample config)
+* searching:
+ /_ = search %s <-- hilight all
+ ; = search <-- jump over all hits
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..f44308b 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
@@ -45,3 +41,4 @@ check if we can make the settings loading less hard coded. eg( keep a list of al
figure out caching with webkit and in general how we can speed up everything
figure out how webkit intercepts key input
make "disable insert mode" (esc key) configurable
+keywords don't work for external commands. is this a problem?
diff --git a/examples/configs/sampleconfig b/examples/configs/sampleconfig
index 3fddc89..6f4d8d9 100644
--- a/examples/configs/sampleconfig
+++ b/examples/configs/sampleconfig
@@ -22,33 +22,40 @@ 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
+r = refresh
+R = reload
f = follow_link_here
F = follow_link_new_tab
w = follow_link_new_window
+ = zoom_in
- = zoom_out
t = toggle_status
-ZZ = exit
+#hilight matches
+/_ = search %s
+#jump to next
+; = search
+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..7e1e31d 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
@@ -29,24 +29,27 @@ l = scroll_horz 20
b = back
m = forward
s = stop
-r = reload
-R = reload_ign_cache
-gh = uri http://www.uzbl.org
+r = refresh
+R = reload
f = follow_link_here
F = follow_link_new_tab
w = follow_link_new_window
+ = zoom_in
- = zoom_out
t = toggle_status
-ZZ = exit
+#hilight matches
+/_ = search %s
+#jump to next
+; = search
+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
@@ -56,3 +59,4 @@ http_debug = 0
user-agent = uzbl
max_conns =
max_conns_per_host =
+
diff --git a/uzbl.c b/uzbl.c
index 1730377..ce80aa1 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -70,6 +70,7 @@ static char fifo_path[64];
static char socket_path[108];
static char executable_path[500];
static GString* keycmd;
+static gchar searchtx[500] = "\0";
/* state variables (initial values coming from command line arguments but may be changed later) */
static gchar* uri = NULL;
@@ -293,20 +294,21 @@ VIEWFUNC(go_forward)
static struct {char *name; Command command;} cmdlist[] =
{
- { "back", view_go_back },
- { "forward", view_go_forward },
- { "scroll_vert", scroll_vert },
- { "scroll_horz", scroll_horz },
- { "reload", view_reload, },
- { "reload_ign_cache", view_reload_bypass_cache},
- { "stop", view_stop_loading, },
- { "zoom_in", view_zoom_in, }, //Can crash (when max zoom reached?).
- { "zoom_out", view_zoom_out, },
- { "uri", load_uri },
- { "toggle_status", toggle_status_cb },
- { "spawn", spawn },
- { "exit", close_uzbl },
- { "insert_mode", set_insert_mode }
+ { "back", view_go_back },
+ { "forward", view_go_forward },
+ { "scroll_vert", scroll_vert },
+ { "scroll_horz", scroll_horz },
+ { "reload", view_reload, }, //Buggy
+ { "refresh", view_reload, }, /* for convenience, will change */
+ { "stop", view_stop_loading, },
+ { "zoom_in", view_zoom_in, }, //Can crash (when max zoom reached?).
+ { "zoom_out", view_zoom_out, },
+ { "uri", load_uri },
+ { "toggle_status", toggle_status_cb },
+ { "spawn", spawn },
+ { "exit", close_uzbl },
+ { "search", search_text },
+ { "insert_mode", set_insert_mode }
};
static void
@@ -374,6 +376,20 @@ load_uri (WebKitWebView * web_view, const gchar *param) {
}
static void
+search_text (WebKitWebView *page, const char *param) {
+ if ((param) && (param[0] != '\0')) {
+ strcpy(searchtx, param);
+ }
+ if (searchtx[0] != '\0') {
+ printf ("Searching: %s\n", searchtx);
+ webkit_web_view_unmark_text_matches (page);
+ webkit_web_view_mark_text_matches (page, searchtx, FALSE, 0);
+ webkit_web_view_set_highlight_text_matches (page, TRUE);
+ webkit_web_view_search_text (page, searchtx, FALSE, TRUE, TRUE);
+ }
+}
+
+static void
new_window_load_uri (const gchar * uri) {
GString* to_execute = g_string_new ("");
g_string_append_printf (to_execute, "%s --uri '%s'", executable_path, uri);
@@ -675,7 +691,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) {
@@ -729,6 +745,7 @@ key_press_cb (WebKitWebView* page, GdkEventKey* event)
g_string_free (actionparam, TRUE);
g_string_free (parampart, TRUE);
g_string_truncate(keycmd, 0);
+ update_title();
}
g_string_truncate(short_keys, short_keys->len - 1);
diff --git a/uzbl.h b/uzbl.h
index d0d6ec7..f9e3053 100644
--- a/uzbl.h
+++ b/uzbl.h
@@ -116,4 +116,7 @@ add_binding (const gchar *key, const gchar *act);
static void
settings_init ();
+static void
+search_text (WebKitWebView *page, const char *param);
+
/* vi: set et ts=4: */