From 1026413b3f2ca3ebb0f2604ef34b0b6094d14c8d Mon Sep 17 00:00:00 2001 From: Jean-Yves Monnier Date: Tue, 9 Jul 2019 05:17:37 +0200 Subject: open multiple URLs Tested and validated on FreeBSD --- badwolf.1 | 2 +- badwolf.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/badwolf.1 b/badwolf.1 index 8f13795..27cd6b3 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -9,7 +9,7 @@ .Sh SYNOPSIS .Nm .Op Ar webkit/gtk options -.Op Ar url or path +.Op Ar URLs or paths .Sh DESCRIPTION .Nm is a minimalist browser that care about privacy, it is based on WebKitGTK and thus also accepts WebKitGTK (and depdendencies) flags and environment variables, unfortunately there doesn't seems to be manpages for theses. diff --git a/badwolf.c b/badwolf.c index ca1b302..68a9c23 100644 --- a/badwolf.c +++ b/badwolf.c @@ -701,7 +701,6 @@ main(int argc, char *argv[]) { // getting an abort if this one fails to alloc struct Window *window = g_malloc(sizeof(struct Window)); - gchar *target_url = NULL; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, DATADIR "/locale"); @@ -722,8 +721,6 @@ main(int argc, char *argv[]) gtk_init(&argc, &argv); - if(argv[1]) target_url = argv[1]; - window->main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); window->notebook = gtk_notebook_new(); window->new_tab = gtk_button_new_from_icon_name("tab-new-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); @@ -741,7 +738,11 @@ main(int argc, char *argv[]) gtk_container_add(GTK_CONTAINER(window->main_window), window->notebook); - badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, target_url, NULL)); + if(argc == 1) + badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, NULL, NULL)); + else + for(int i = 1; i < argc; ++i) + badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, argv[i], NULL)); g_signal_connect( window->main_window, "key-press-event", G_CALLBACK(main_windowCb_key_press_event), window); -- cgit v1.3.1-23-gd82d