diff options
-rw-r--r-- | INSTALLING | 1 | ||||
-rw-r--r-- | examples/configs/sampleconfig | 15 | ||||
-rw-r--r-- | examples/configs/sampleconfig-dev | 14 | ||||
-rwxr-xr-x | examples/scripts/load_url_from_history.sh | 6 | ||||
-rw-r--r-- | uzbl.c | 106 |
5 files changed, 72 insertions, 70 deletions
@@ -19,6 +19,7 @@ Dependencies * git (for building) * pkgconfig (for Make/gcc) * libwebkit 1.1.4 or higher +* libsoup 2.24 or higher (dep for webkit/gtk+) * gtk 2 something something Optional/Recommended diff --git a/examples/configs/sampleconfig b/examples/configs/sampleconfig index 0f2fa5f..7b88682 100644 --- a/examples/configs/sampleconfig +++ b/examples/configs/sampleconfig @@ -21,10 +21,11 @@ show_status = 1 status_top = 0 [bindings] -j = scroll_down -k = scroll_up -h = scroll_left -l = scroll_right +# scroll down/up/left/right +j = scroll_vert 20 +k = scroll_vert -20 +h = scroll_horz -20 +l = scroll_horz 20 b = back m = forward s = stop @@ -45,3 +46,9 @@ U = spawn /usr/share/uzbl/examples/scripts/load_url_from_bookmarks.sh [network] +proxy_server = +#values 0-3 +http_debug = 1 +user-agent = uzbl +max_conns = +max_conns_per_host = diff --git a/examples/configs/sampleconfig-dev b/examples/configs/sampleconfig-dev index 2d2c5f6..a1ba48d 100644 --- a/examples/configs/sampleconfig-dev +++ b/examples/configs/sampleconfig-dev @@ -21,10 +21,11 @@ show_status = 1 status_top = 0 [bindings] -j = scroll_down -k = scroll_up -h = scroll_left -l = scroll_right +## scroll down/up/left/right +j = scroll_vert 20 +k = scroll_vert -20 +h = scroll_horz -20 +l = scroll_horz 20 b = back m = forward s = stop @@ -44,9 +45,10 @@ u = spawn ./examples/scripts/load_url_from_history.sh U = spawn ./examples/scripts/load_url_from_bookmarks.sh [network] -proxy_server = http://192.168.1.10:8118 +# to start a local socks server, do : ssh -fND localhost:8118 localhost +#proxy_server = http://127.0.0.1:8118 #values 0-3 -http_debug = 1 +http_debug = 0 user-agent = uzbl max_conns = max_conns_per_host = diff --git a/examples/scripts/load_url_from_history.sh b/examples/scripts/load_url_from_history.sh index 81a220a..3e2e2ee 100755 --- a/examples/scripts/load_url_from_history.sh +++ b/examples/scripts/load_url_from_history.sh @@ -2,6 +2,10 @@ # you probably really want this in your $XDG_DATA_HOME (eg $HOME/.local/share/uzbl/history) history_file=/tmp/uzbl.history -goto=`awk '{print $3}' $history_file | sort | uniq | dmenu -i` +# choose from all entries, sorted and uniqued +# goto=`awk '{print $3}' $history_file | sort -u | dmenu -i` + +# choose from all entries, the first one being current url, and after that all others, sorted and uniqued. +current=`tail -n 1 $history_file | awk '{print $3}'`; goto=`(echo $current; awk '{print $3}' $history_file | grep -v "^$current\$" | sort -u) | dmenu -i` #[ -n "$goto" ] && echo "uri $goto" > $4 [ -n "$goto" ] && uzblctrl -s $5 -c "uri $goto" @@ -90,8 +90,6 @@ static gboolean status_top = FALSE; static gchar* modkey = NULL; static guint modmask = 0; static guint http_debug = 0; -static gdouble hscroll = 20; -static gdouble vscroll = 20; /* settings from config: group bindings, key -> action */ static GHashTable* bindings; @@ -165,36 +163,28 @@ download_cb (WebKitWebView *web_view, GObject *download, gpointer user_data) { /* scroll a bar in a given direction */ static void -scroll (double i, GtkAdjustment* bar) { - gtk_adjustment_set_value (bar, gtk_adjustment_get_value(bar)+i); -} +scroll (GtkAdjustment* bar, const char *param) { + gdouble amount; + gchar *end; -static void scroll_up (WebKitWebView* page, const char *param) { - (void) page; - (void) param; + amount = g_ascii_strtod(param, &end); - scroll (-vscroll, bar_v); -} + if (*end) + fprintf(stderr, "found something after double: %s\n", end); -static void scroll_left (WebKitWebView* page, const char *param) { - (void) page; - (void) param; - - scroll (-hscroll, bar_h); + gtk_adjustment_set_value (bar, gtk_adjustment_get_value(bar)+amount); } -static void scroll_down (WebKitWebView* page, const char *param) { +static void scroll_vert(WebKitWebView* page, const char *param) { (void) page; - (void) param; - scroll (vscroll, bar_v); + scroll(bar_v, param); } -static void scroll_right (WebKitWebView* page, const char *param) { +static void scroll_horz(WebKitWebView* page, const char *param) { (void) page; - (void) param; - scroll (hscroll, bar_h); + scroll(bar_h, param); } static void @@ -293,10 +283,8 @@ static struct {char *name; Command command;} cmdlist[] = { { "back", view_go_back }, { "forward", view_go_forward }, - { "scroll_down", scroll_down }, - { "scroll_up", scroll_up }, - { "scroll_left", scroll_left }, - { "scroll_right", scroll_right }, + { "scroll_vert", scroll_vert }, + { "scroll_horz", scroll_horz }, { "reload", view_reload, }, //Buggy { "refresh", view_reload, }, /* for convenience, will change */ { "stop", view_stop_loading, }, @@ -802,42 +790,42 @@ settings_init () { g_strfreev(keys); } - /* networking options */ - proxy_url = g_key_file_get_value(config, "network", "proxy_server", NULL); - http_debug = g_key_file_get_integer(config, "network", "http_debug", NULL); - useragent = g_key_file_get_value(config, "network", "user-agent", NULL); - max_conns = g_key_file_get_integer(config, "network", "max_conns", NULL); - max_conns_host = g_key_file_get_integer(config, "network", "max_conns_per_host", NULL); - - if(proxy_url){ - g_object_set(G_OBJECT(soup_session), SOUP_SESSION_PROXY_URI, soup_uri_new(proxy_url), NULL); - printf("Proxy configured: %s\n", proxy_url ? proxy_url : "none"); - } + /* networking options */ + proxy_url = g_key_file_get_value (config, "network", "proxy_server", NULL); + http_debug = g_key_file_get_integer (config, "network", "http_debug", NULL); + useragent = g_key_file_get_value (config, "network", "user-agent", NULL); + max_conns = g_key_file_get_integer (config, "network", "max_conns", NULL); + max_conns_host = g_key_file_get_integer (config, "network", "max_conns_per_host", NULL); + + if(proxy_url){ + g_object_set(G_OBJECT(soup_session), SOUP_SESSION_PROXY_URI, soup_uri_new(proxy_url), NULL); + } - if(!(http_debug <= 3)){ - http_debug = 0; - fprintf(stderr, "Wrong http_debug level, ignoring.\n"); - } else { - soup_logger = soup_logger_new(http_debug, -1); - soup_session_add_feature(soup_session, SOUP_SESSION_FEATURE(soup_logger)); - printf("HTTP logging level: %d\n", http_debug); - } + if(!(http_debug <= 3)){ + http_debug = 0; + fprintf(stderr, "Wrong http_debug level, ignoring.\n"); + } else if (http_debug > 0) { + soup_logger = soup_logger_new(http_debug, -1); + soup_session_add_feature(soup_session, SOUP_SESSION_FEATURE(soup_logger)); + } - if(useragent){ - g_object_set(G_OBJECT(soup_session), SOUP_SESSION_USER_AGENT, useragent, NULL); - printf("User-agent: %s\n", useragent); - } else { - printf("User-agent: webkit default\n"); - } - - if(max_conns >= 1){ - g_object_set(G_OBJECT(soup_session), SOUP_SESSION_MAX_CONNS, max_conns, NULL); - printf("Maximum connections set to: %d\n", max_conns); - } - if(max_conns_host >= 1){ - g_object_set(G_OBJECT(soup_session), SOUP_SESSION_MAX_CONNS_PER_HOST, max_conns_host, NULL); - printf("Maximum connections per host set to: %d\n", max_conns_host); - } + if(useragent){ + g_object_set(G_OBJECT(soup_session), SOUP_SESSION_USER_AGENT, useragent, NULL); + } + + if(max_conns >= 1){ + g_object_set(G_OBJECT(soup_session), SOUP_SESSION_MAX_CONNS, max_conns, NULL); + } + + if(max_conns_host >= 1){ + g_object_set(G_OBJECT(soup_session), SOUP_SESSION_MAX_CONNS_PER_HOST, max_conns_host, NULL); + } + + printf("Proxy configured: %s\n", proxy_url ? proxy_url : "none"); + printf("HTTP logging level: %d\n", http_debug); + printf("User-agent: %s\n", useragent? useragent : "default"); + printf("Maximum connections: %d\n", max_conns ? max_conns : 0); + printf("Maximum connections per host: %d\n", max_conns_host ? max_conns_host: 0); } |