insert mode: keystrokes are not interpreted so you can enter text into html forms
Press ESC/i to toggle command/insert mode
But if you don't like modal interfaces, you can set `always_insert_mode` and configure a modkey to execute the commands. (emacs style).
-* 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 (from scripts etc) to uzbl.
+ There is also support for "chained" commands (multiple characters long) (with backspace/esc shortcuts), and keyworded commands.
+ Also you can have incremental matching on commands or match after pressing return. (see sampleconfig for more info)
+ Also, copy paste works when typing commands:
+ * insert (paste X cliboard)
+ * 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)
+ 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>`
### COMMAND SYNTAX
TODO
### VARIABLE REPLACEMENT
Some of the variables are interpreted:
-* title bar: variable replacement (not yet actually)
+* title bar: variable replacement (long and short version, depending if statusbar is visible or not)
* user agent: variable replacement
* statusbar: variable replacement + pango markup
$11 cookie (only with PUT requests)
+### COMMAND LINE ARGUMENTS
+
+ -u, --uri=URI Uri to load (equivalent to 'set uri = URI')
+ -v, --verbose Whether to print all messages or just errors.
+ -n, --name=NAME Name of the current instance (defaults to Xorg window id)
+ -c, --config=FILE Config file (this is pretty much equivalent to uzbl < FILE )
+ --display=DISPLAY X display to use
+ --help Help
+
+
### BUGS
known bugs:
+++ /dev/null
-THIS FILE IS DEPRECATED.
-TODO: make sure that all this gets merged into the documentation
-
-This file contains all things that are/should be working.
-When you have been working on something, use this list to verify that you did not cause any regressions (things that worked before, but got broken).
-Also, when you finish a new feature, add it to this list so that everyone knows about it, can play with it, and can test it.
-
-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 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)
- 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. 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. 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, 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
-* run javascript on curent page through "script" command.
-* variable replacement in user agent.
-* basic keyboard link hilighting (numbering) and following. will be improved more
-* support overriding background color of statusbar and pango markup format to customize the statusbar in terms of which variables, separators, colors, fonts, etc
* implement getting feedback from socket
* scrolling: make page up and page down configurable.
* show % of location in statusbar/title if page doesn't fit entirely on view.
+* conditionals in format strings: eg if(SELECTED_URI) { "-> SELECTED_URI" } or another smart way to achieve the same.
* make default window 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
* improve DCOMMIT macro. what if WC is dirty? what if user downloaded tarball without .git?
* DARCH is not correct (should be at runtime)
* keybinds to open "next" or "previous" by looking for next/prev links and/or looking for numbers in the uri we can inc/decrement
-* variable replacing for title bar in "statusbar_visible" and statusbar_invisible states
* settings iterating "state generator" so we can "open in new window" again.
* handler for (broken) ssl certs.
* handlers for mailto: and maybe other thingies?
set show_status = 1
# you can optionally use this setting to override the background color of the statusbar from your GTK theme.
set status_background = #303030
-set status_format = <span font_family="monospace"><span background="khaki" foreground="black">MODE</span> [<span weight="bold" foreground="red">KEYCMD</span>] <span foreground="#606060"> LOAD_PROGRESSBAR </span><span foreground="#99FF66">URI</span> <span foreground="khaki">NAME</span> <span foreground="orange">MSG</span></span>
+set status_format = <span font_family="monospace"><span background="khaki" foreground="black">MODE</span> [<span weight="bold" foreground="red">KEYCMD</span>] <span foreground="#606060"> LOAD_PROGRESSBAR </span><span foreground="#99FF66">URI</span> <span foreground="khaki">NAME</span> <span foreground="orange">MSG</span><span foreground="#606060">SELECTED_URI</span></span>
set status_top = 0
+# define how your titlebar should look like. (short = statusbar is also shown, long = show everything you must see if statusbar is off)
+set title_format_short = TITLE - Uzbl browser <NAME>
+set title_format_long = KEYCMD MODE TITLE - Uzbl browser <NAME> > SELECTED_URI
set modkey = Mod1
# reset to command mode when new page is loaded
bind F= script for (var i=0; i < document.links.length; i++) {var uzblid = 'uzbl_link_hint_';var li = document.links[i];var pre = document.getElementById(uzblid+i);if (pre) {li.removeChild(pre);} else {var hint = document.createElement('div');hint.setAttribute('id',uzblid+i);hint.innerHTML = i;hint.style.display='inline';hint.style.lineHeight='90%';hint.style.backgroundColor='red';hint.style.color='white';hint.style.fontSize='small-xx';hint.style.fontWeight='light';hint.style.margin='0px';hint.style.padding='2px';hint.style.position='absolute';hint.style.textDecoration='none';hint.style.left=li.style.left;hint.style.top=li.style.top;li.insertAdjacentElement('afterBegin',hint);}}
#hit f followed by linknumber and ENTER to follow that link
bind f_ = script window.location = document.links[%s].href;
+
+# "home" page if you will
+set uri = uzbl.org
[ -f $XDG_DATA_HOME/uzbl/bookmarks ] && file=$XDG_DATA_HOME/uzbl/bookmarks
[ -f ./examples/data/bookmarks ] && file=./examples/data/bookmarks #useful when developing
[ -z "$file" ] && exit 1
-
+COLORS=" -nb #303030 -nf khaki -sb #CCFFAA -sf #303030"
if dmenu --help 2>&1 | grep -q '\[-rs\] \[-ni\] \[-nl\] \[-xs\]'
then
DMENU="dmenu -i -xs -rs -l 10" # vertical patch
# show tags as well
- goto=`$DMENU < $file | awk '{print $1}'`
+ goto=`$DMENU $COLORS < $file | awk '{print $1}'`
else
DMENU="dmenu -i"
# because they are all after each other, just show the url, not their tags.
- goto=`awk '{print $1}' $file | $DMENU`
+ goto=`awk '{print $1}' $file | $DMENU $COLORS`
fi
#[ -n "$goto" ] && echo "act uri $goto" > $4
# choose from all entries, sorted and uniqued
# goto=`awk '{print $3}' $history_file | sort -u | dmenu -i`
-
-
+COLORS=" -nb #303030 -nf khaki -sb #CCFFAA -sf #303030"
if dmenu --help 2>&1 | grep -q '\[-rs\] \[-ni\] \[-nl\] \[-xs\]'
then
DMENU="dmenu -i -xs -rs -l 10" # vertical patch
# choose an item in reverse order, showing also the date and page titles
# pick the last field from the first 3 fields. this way you can pick a url (prefixed with date & time) or type just a new url.
- goto=`tac $history_file | $DMENU | cut -d ' ' -f -3 | awk '{print $NF}'`
+ goto=`tac $history_file | $DMENU $COLORS | cut -d ' ' -f -3 | awk '{print $NF}'`
else
DMENU="dmenu -i"
# choose from all entries (no date or title), the first one being current url, and after that all others, sorted and uniqued, in ascending order
- current=`tail -n 1 $history_file | awk '{print $3}'`; goto=`(echo $current; awk '{print $3}' $history_file | grep -v "^$current\$" | sort -u) | $DMENU`
+ current=`tail -n 1 $history_file | awk '{print $3}'`; goto=`(echo $current; awk '{print $3}' $history_file | grep -v "^$current\$" | sort -u) | $DMENU $COLORS`
fi
#[ -n "$goto" ] && echo "act uri $goto" > $4
{ "status_top", (void *)&uzbl.behave.status_top },
{ "status_format", (void *)&uzbl.behave.status_format },
{ "status_background", (void *)&uzbl.behave.status_background },
+ { "title_format_long", (void *)&uzbl.behave.title_format_long },
+ { "title_format_short", (void *)&uzbl.behave.title_format_short },
{ "insert_mode", (void *)&uzbl.behave.insert_mode },
{ "always_insert_mode", (void *)&uzbl.behave.always_insert_mode },
{ "reset_command_mode", (void *)&uzbl.behave.reset_command_mode },
/* commandline arguments (set initial values for the state variables) */
static GOptionEntry entries[] =
{
- { "uri", 'u', 0, G_OPTION_ARG_STRING, &uzbl.state.uri, "Uri to load", "URI" },
+ { "uri", 'u', 0, G_OPTION_ARG_STRING, &uzbl.state.uri, "Uri to load at startup (equivalent to 'set uri = URI')", "URI" },
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &uzbl.state.verbose, "Whether to print all messages or just errors.", NULL },
{ "name", 'n', 0, G_OPTION_ARG_STRING, &uzbl.state.instance_name, "Name of the current instance (defaults to Xorg window id)", "NAME" },
- { "config", 'c', 0, G_OPTION_ARG_STRING, &uzbl.state.config_file, "Config file", "FILE" },
+ { "config", 'c', 0, G_OPTION_ARG_STRING, &uzbl.state.config_file, "Config file (this is pretty much equivalent to uzbl < FILE )", "FILE" },
{ NULL, 0, 0, 0, NULL, NULL, NULL }
};
(void) page;
(void) title;
(void) data;
- //ADD HOVER URL TO WINDOW TITLE
+ //Set selected_url state variable
uzbl.state.selected_url[0] = '\0';
if (link) {
strcpy (uzbl.state.selected_url, link);
uzbl.gui.main_title?
g_markup_printf_escaped("%s", uzbl.gui.main_title):"");
break;
+ case SYM_SELECTED_URI:
+ g_string_append(ret,
+ uzbl.state.selected_url?
+ g_markup_printf_escaped("%s", uzbl.state.selected_url):"");
+ break;
case SYM_NAME:
buf = itos(uzbl.xwin);
g_string_append(ret,
if( (p = g_hash_table_lookup(uzbl.comm.proto_var, name)) ) {
if(var_is("status_format", name)
- || var_is("useragent", name)) {
+ || var_is("useragent", name)
+ || var_is("title_format_short", name)
+ || var_is("title_format_long", name)) {
printf("VAR: %s VALUE: %s\n", name, (char *)*p);
} else printf("VAR: %s VALUE: %d\n", name, (int)*p);
}
if(var_is("status_message", name)
|| var_is("status_background", name)
|| var_is("status_format", name)
+ || var_is("title_format_long", name)
+ || var_is("title_format_short", name)
|| var_is("load_finish_handler", name)
|| var_is("history_handler", name)
|| var_is("download_handler", name)
static void
update_title (void) {
- GString* string_long = g_string_new ("");
- GString* string_short = g_string_new ("");
- char* iname = NULL;
- gchar *statln;
- int iname_len;
- State *s = &uzbl.state;
Behaviour *b = &uzbl.behave;
- if(s->instance_name) {
- iname_len = strlen(s->instance_name)+4;
- iname = malloc(iname_len);
- snprintf(iname, iname_len, "<%s> ", s->instance_name);
-
- g_string_prepend(string_long, iname);
- g_string_prepend(string_short, iname);
- free(iname);
- }
-
- g_string_append_printf(string_long, "%s ", s->keycmd->str);
- if (!b->always_insert_mode)
- g_string_append (string_long, (b->insert_mode ? "[I] " : "[C] "));
- if (uzbl.gui.main_title) {
- g_string_append (string_long, uzbl.gui.main_title);
- g_string_append (string_short, uzbl.gui.main_title);
- }
- g_string_append (string_long, " - Uzbl browser");
- g_string_append (string_short, " - Uzbl browser");
- if (s->selected_url[0]!=0) {
- g_string_append_printf (string_long, " -> (%s)", s->selected_url);
- }
-
- gchar* title_long = g_string_free (string_long, FALSE);
- gchar* title_short = g_string_free (string_short, FALSE);
-
if (b->show_status) {
- gtk_window_set_title (GTK_WINDOW(uzbl.gui.main_window), title_short);
+ gchar *statln;
+ gtk_window_set_title (GTK_WINDOW(uzbl.gui.main_window), expand_template(b->title_format_short));
// TODO: we should probably not do this every time we want to update the title..?
statln = expand_template(uzbl.behave.status_format);
gtk_label_set_markup(GTK_LABEL(uzbl.gui.mainbar_label), statln);
}
g_free(statln);
} else {
- gtk_window_set_title (GTK_WINDOW(uzbl.gui.main_window), title_long);
+ gtk_window_set_title (GTK_WINDOW(uzbl.gui.main_window), expand_template(b->title_format_long));
}
-
- g_free (title_long);
- g_free (title_short);
}
static gboolean
}
if (!uzbl.behave.status_format)
uzbl.behave.status_format = g_strdup(STATUS_DEFAULT);
+ if (!uzbl.behave.title_format_long)
+ uzbl.behave.title_format_long = g_strdup(TITLE_LONG_DEFAULT);
+ if (!uzbl.behave.title_format_short)
+ uzbl.behave.title_format_short = g_strdup(TITLE_SHORT_DEFAULT);
+
g_signal_connect(n->soup_session, "request-queued", G_CALLBACK(handle_cookies), NULL);
}
*/
#define STATUS_DEFAULT "<span background=\"darkblue\" foreground=\"white\"> MODE </span> <span background=\"red\" foreground=\"white\">KEYCMD</span> (LOAD_PROGRESS%) <b>TITLE</b> - Uzbl browser"
+#define TITLE_LONG_DEFAULT "KEYCMD MODE TITLE - Uzbl browser <NAME> > SELECTED_URI"
+#define TITLE_SHORT_DEFAULT "TITLE - Uzbl browser <NAME>"
+
enum {
/* statusbar symbols */
SYM_TITLE, SYM_URI, SYM_NAME,
SYM_LOADPRGS, SYM_LOADPRGSBAR,
SYM_KEYCMD, SYM_MODE, SYM_MSG,
+ SYM_SELECTED_URI,
/* useragent symbols */
SYM_WK_MAJ, SYM_WK_MIN, SYM_WK_MIC,
SYM_SYSNAME, SYM_NODENAME,
{"NAME", SYM_NAME},
{"URI", SYM_URI},
{"TITLE", SYM_TITLE},
+ {"SELECTED_URI", SYM_SELECTED_URI},
{"KEYCMD", SYM_KEYCMD},
{"MODE", SYM_MODE},
{"MSG", SYM_MSG},
typedef struct {
gchar* load_finish_handler;
gchar* status_format;
+ gchar* title_format_short;
+ gchar* title_format_long;
gchar* status_background;
gchar* history_handler;
gchar* fifo_dir;