aboutsummaryrefslogtreecommitdiffhomepage
path: root/uzbl.c
diff options
context:
space:
mode:
authorGravatar Robert Manea <gotmor@gmail.com>2009-05-05 23:54:05 +0200
committerGravatar Robert Manea <gotmor@gmail.com>2009-05-05 23:54:05 +0200
commit64c45f5d3bed18902f995b20447a88b3bd118c52 (patch)
tree13a1596b6ae3fd60de067e9817d9f52562a50395 /uzbl.c
parent95dbb08beef21b8d41c198edc5707c4fa0f07aa2 (diff)
added URI and NAME symbols to the statusbar template
Diffstat (limited to 'uzbl.c')
-rw-r--r--uzbl.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/uzbl.c b/uzbl.c
index f18899e..2f5d51c 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -58,7 +58,7 @@
/* status bar format
TODO: integrate with the config file
*/
-char *status_format = "LOAD_PROGRESS% <span font_family=\"monospace\">LOAD_PROGRESSBAR</span> on <span background=\"darkblue\" foreground=\"white\"> <b>TITLE</b> </span> - <span foreground=\"black\" background=\"red\"> Uzbl browser </span>";
+char *status_format = "<span background=\"darkblue\" foreground=\"white\"> <b>TITLE</b> </span> | LOAD_PROGRESS% <span font_family=\"monospace\">LOAD_PROGRESSBAR</span> | <span foreground=\"darkgreen\">URI</span> | NAME | <span foreground=\"black\" background=\"khaki\"> Uzbl browser </span>";
/* housekeeping / internal variables */
static gchar selected_url[500] = "\0";
@@ -432,7 +432,7 @@ build_progressbar_ascii(int percent) {
}
-enum { SYM_TITLE, SYM_LOADPRGS, SYM_LOADPRGSBAR};
+enum { SYM_TITLE, SYM_URI, SYM_NAME, SYM_LOADPRGS, SYM_LOADPRGSBAR};
static void
setup_scanner() {
const GScannerConfig scan_config = {
@@ -480,7 +480,11 @@ setup_scanner() {
};
uzbl.scan = g_scanner_new(&scan_config);
+
+ /* TODO: move this stuff to an array and use a loop to actually set it */
g_scanner_scope_add_symbol(uzbl.scan, 0, "TITLE", (gpointer)SYM_TITLE);
+ g_scanner_scope_add_symbol(uzbl.scan, 0, "URI", (gpointer)SYM_URI);
+ g_scanner_scope_add_symbol(uzbl.scan, 0, "NAME", (gpointer)SYM_NAME);
g_scanner_scope_add_symbol(uzbl.scan, 0, "LOAD_PROGRESS", (gpointer)SYM_LOADPRGS);
g_scanner_scope_add_symbol(uzbl.scan, 0, "LOAD_PROGRESSBAR", (gpointer)SYM_LOADPRGSBAR);
}
@@ -502,7 +506,7 @@ parse_status_template(const char *template) {
if(token == G_TOKEN_SYMBOL) {
sym = (int)g_scanner_cur_value(uzbl.scan).v_symbol;
switch(sym) {
- case SYM_TITLE:
+ case SYM_URI:
g_string_append(ret, uzbl.state.uri);
break;
case SYM_LOADPRGS:
@@ -513,6 +517,14 @@ parse_status_template(const char *template) {
g_string_append(ret, buf);
g_free(buf);
break;
+ case SYM_TITLE:
+ g_string_append(ret,
+ uzbl.gui.main_title?uzbl.gui.main_title:"");
+ break;
+ case SYM_NAME:
+ g_string_append(ret,
+ uzbl.state.instance_name?uzbl.state.instance_name:"" );
+ break;
default:
break;
}