diff options
-rw-r--r-- | README | 11 | ||||
-rw-r--r-- | browser.c | 13 |
2 files changed, 16 insertions, 8 deletions
@@ -96,8 +96,8 @@ Main windows Close the current window. Mod1 + w - Go to your "homepage" which is the first URI specified on - the command line. + Go to your "homepage". See the environment variable + $LARIZA_HOME_URI. Mod1 + e Open a new window. @@ -196,7 +196,7 @@ following options: Disables automatic launching of suckless' tabbed. After these options there can be any number of URIs. If no URIs are -given, about:blank will be opened. +given, $LARIZA_HOME_URI will be opened. ===================== @@ -225,6 +225,11 @@ following environment variables: "main". If you change this variable, you can launch several independent cooperative instances of lariza. + LARIZA_HOME_URI + This URI will be opened by pressing the appropriate hotkeys + ("homepage" or "new window") and if no URIs are specified on the + command line. Defaults to "about:blank". + LARIZA_ZOOM Zoom level for WebKit viewports. Defaults to 1.0. @@ -76,8 +76,8 @@ static gchar *download_dir = "/tmp"; static gint downloads_indicated = 0; static Window embed = 0; static gchar *fifo_suffix = "main"; -static gchar *first_uri = "about:blank"; static gdouble global_zoom = 1.0; +static gchar *home_uri = "about:blank"; static GHashTable *keywords = NULL; static gboolean language_is_set = FALSE; static gchar *search_text = NULL; @@ -565,6 +565,10 @@ grab_environment_configuration(void) if (e != NULL) fifo_suffix = g_strdup(e); + e = g_getenv(__NAME_UPPERCASE__"_HOME_URI"); + if (e != NULL) + home_uri = g_strdup(e); + e = g_getenv(__NAME_UPPERCASE__"_ZOOM"); if (e != NULL) global_zoom = atof(e); @@ -688,14 +692,14 @@ key_web_view(GtkWidget *widget, GdkEvent *event, gpointer data) gtk_widget_destroy(c->win); return TRUE; case GDK_KEY_w: /* home (left hand) */ - f = ensure_uri_scheme(first_uri); + f = ensure_uri_scheme(home_uri); if (show_all_requests) fprintf(stderr, "====> %s\n", f); webkit_web_view_load_uri(WEBKIT_WEB_VIEW(c->web_view), f); g_free(f); return TRUE; case GDK_KEY_e: /* new tab (left hand) */ - f = ensure_uri_scheme(first_uri); + f = ensure_uri_scheme(home_uri); if (show_all_requests) fprintf(stderr, "====> %s\n", f); client_new(f); @@ -970,10 +974,9 @@ main(int argc, char **argv) embed = tabbed_launch(); if (optind >= argc) - client_new(first_uri); + client_new(home_uri); else { - first_uri = g_strdup(argv[optind]); for (i = optind; i < argc; i++) client_new(argv[i]); } |