summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.mk5
-rw-r--r--doc/dwb.1200
-rw-r--r--src/adblock.c2
-rw-r--r--src/adblock.h2
-rw-r--r--src/callback.c8
-rw-r--r--src/commands.c60
-rw-r--r--src/commands.h5
-rw-r--r--src/config.h212
-rw-r--r--src/domain.c2
-rw-r--r--src/domain.h2
-rw-r--r--src/download.c4
-rw-r--r--src/dwb.c160
-rw-r--r--src/dwb.h8
-rw-r--r--src/soup.c4
-rw-r--r--src/view.c7
-rw-r--r--util/keys.in94
-rw-r--r--util/settings.in1
17 files changed, 346 insertions, 430 deletions
diff --git a/config.mk b/config.mk
index 9e0d86f2..608da047 100644
--- a/config.mk
+++ b/config.mk
@@ -119,11 +119,6 @@ CFLAGS += -DERROR_FILE=\"$(ERROR_FILE)\"
CFLAGS += -DLOCAL_FILE=\"$(LOCAL_FILE)\"
CFLAGS += -DSYSTEM_DATA_DIR=\"$(DATADIR)\"
-ifneq (${DISABLE_ADBLOCKER}, 1)
-CFLAGS += -DDWB_ADBLOCKER
-CFLAGS += -DDWB_DOMAIN_SERVICE
-endif
-
ifeq (USEGTK3, 1)
CFLAGS+=-DGTK_DISABLE_SINGLE_INCLUDES
CFLAGS+=-DGTK_DISABLE_DEPRECATED
diff --git a/doc/dwb.1 b/doc/dwb.1
index 5fb4eea3..61394b24 100644
--- a/doc/dwb.1
+++ b/doc/dwb.1
@@ -22,6 +22,9 @@ New instance, overrides property "single-instance".
.B \-e <wid>
Embed dwb into <wid>.
.TP
+.B \-x <commands>
+Execute semicolon seperated list of dwb commands.
+.TP
.B \-v
Show version information and exit.
.TP
@@ -110,33 +113,36 @@ aliases:
Enter Commandmode.
.TP
.BR o
-Open new url in the focused view (command
+Open new url in the focused tab (command
.BR open ,
aliases:
.BR o ).
.TP
.BR go
-Open url in the focused view, set the current url in the navigation bar.
+Open url in the focused tab, set the current url in the navigation bar (comand
+.BR open_url ).
.TP
.BR O
-Open url in a new view (command
-.BR open_nv ,
+Open url in a new tab (command
+.BR tabopen ,
aliases:
-.BR tabopen ,
+.BR topen ,
.BR t ).
.TP
.BR gO
-Open url in a new view, set the current url in the navigation bar.
+Open url in a new tab, set the current url in the navigation bar (command
+.IR tabopen_url ).
.TP
.BR wo
Open url in a new instance (command
-.BR open_nw ,
-aliases:
.BR winopen ,
+aliases:
+.BR wopen ,
.BR w ).
.TP
.BR wO
-Open url in a new window, set the current url in the navigation bar.
+Open url in a new window, set the current url in the navigation bar (command
+.BR winopen_url ).
.TP
.BR i
Enter Insertmode (command
@@ -146,12 +152,12 @@ aliases:
.BR insert ).
.TP
.BR ga
-Add a new blank view (command
-.BR add_view ).
+Add a new blank tab (command
+.BR tab_new ).
.TP
.BR d
-Close current view (command
-.BR remove_view ,
+Close current tab (command
+.BR close_tab ,
aliases:
.BR close ).
.TP
@@ -166,14 +172,14 @@ aliases:
.BR q ).
.TP
.BR u
-Undo closing last view (command
+Undo closing last tab (command
.BR undo ,
aliases:
.BR u ).
.TP
.BR C-h
Open the default startpage (command
-.BR open_start_page ,
+.BR start_page ,
aliases:
.BR home ).
.TP
@@ -193,28 +199,28 @@ aliases:
.TP
.BR th
Go back in a new tab (command
-.BR history_back_nv ,
+.BR tab_hist_back,
aliases:
.BR tabback ,
.BR tba ).
.TP
.BR tl
Go forward in a new tab (command
-.BR history_forward_nv ,
+.BR tab_hist_forward ,
aliases:
.BR tabforward ,
.BR tfo ).
.TP
.BR wh
Go back in a new window (command
-.BR history_back_nw ,
+.BR win_hist_back ,
aliases:
.BR winback ,
.BR wba ).
.TP
.BR wl
Go forward in a new window (command
-.BR history_forward_nw ,
+.BR win_hist_forward ,
aliases:
.BR winforward ,
.BR wfo ).
@@ -234,14 +240,14 @@ aliases:
.BR bmas ).
.TP
.B gB
-Show Bookmarks, open bookmark in a new view (command
-.BR bookmarks_nv ,
+Show Bookmarks, open bookmark in a new tab (command
+.BR tab_bookmarks ,
aliases:
.BR tabmarks ).
.TP
.B wB
Show Bookmarks, open bookmark in a new window (command
-.BR bookmarks_nw ,
+.BR win_bookmarks ,
aliases:
.BR winmarks ).
.TP
@@ -254,36 +260,36 @@ aliases:
.TP
.BR b
Open quickmark (command
-.BR open_quickmark ,
+.BR quickmark ,
aliases:
.BR qmarks ).
.TP
.BR B
-Open quickmark in a new view (command
-.BR open_quickmark_nv ,
+Open quickmark in a new tab (command
+.BR tab_quickmark ,
aliases:
.BR tabqmarks ).
.TP
.BR wb[:graph:]
Open quickmark in a new window (command
-.BR open_quickmark_nw ,
+.BR win_quickmark ,
aliases:
.BR winqmarks ).
.TP
-.BR r
-Reload focused view (command
+.BR [n]r
+Reload tab n or current tab if n is omitted (command
.BR reload ,
aliases:
.BR re ).
.TP
-.BR R
-Reload focused view without using any cached data (command
+.BR [n]R
+Reload tab n or current tab if n is omitted without using any cached data (command
.BR reload_bypass_cache ,
aliases:
.BR refull ).
.TP
-.BR C-s
-Stop loading current page (command
+.BR [n]C-s
+Stop loading of tab n or of current tab is [n] is omitted (command
.BR stop_loading ,
aliases:
.BR stop ,
@@ -324,21 +330,21 @@ aliases:
.BR wqn ).
.TP
.BR [n]J
-Cycle focus [n views] forwards. (command
+Cycle focus [n tab] forwards. (command
.BR focus_next ,
aliases:
.BR tabnext ).
.TP
.BR [n]K
-Cycle focus [n views] backwards. (command
+Cycle focus [n tab] backwards. (command
.BR focus_prev ,
aliases:
.BR tabprev ).
.TP
.BR [n]T
-Focus nth view or first, if n is ommitted.
+Focus nth tab or first, if n is ommitted.
(command
-.BR focus_nth_view ,
+.BR focus_tab ,
aliases:
.BR tab ).
.TP
@@ -370,90 +376,90 @@ aliases:
.TP
.BR f
Show hints (command
-.BR hint_mode ,
+.BR hints ,
aliases:
.BR hints ,
.BR hi ).
.TP
.BR F
-Show hints, open link in a new view. (command
-.BR hint_mode_nv ,
+Show hints, open link in a new tab. (command
+.BR hints_tab ,
aliases:
.BR tabhints ,
.BR thi ).
.TP
.BR wf
-Show hints, open link in a new view. (command
-.BR hint_mode_nw ,
+Show hints, open link in a new tab. (command
+.BR hints_win ,
aliases:
.BR winhints ,
.BR whi ).
.TP
.BR ;i
Follow image (command
-.BR hint_mode_images ,
+.BR hints_images ,
aliases:
.BR ihints ,
ihi ).
.TP
.BR ;I
Follow image in a new tab (command
-.BR hint_mode_images_nv ,
+.BR hints_images_tab ,
aliases:
.BR itabhints ,
.BR ithi ).
.TP
.BR ;e
Focus editable elements via hints (command
-.BR hint_mode_editable ,
+.BR hints_editable ,
aliases:
.BR ehints ,
.BR ehi ).
.TP
.BR ;o
Set hint\'s url in commandline (command
-.BR hint_mode_url ,
+.BR hints_url ,
aliases:
.BR uhints ,
.BR uhi ).
.TP
.BR ;O
Set hint\'s url in commandline, open in a new tab (command
-.BR hint_mode_url_nv ,
+.BR hints_url_tab ,
aliases:
.BR utabhints ,
.BR uthi ).
.TP
.BR ;d
Download via hints (command
-.BR hint_mode_download ,
+.BR hints_download ,
aliases:
.BR dhints ).
.TP
.BR ;y
Save link location to clipboard (command
-.BR hint_mode_clipboard ,
+.BR hints_clipboard ,
aliases:
.BR chints ,
.BR chi ).
.TP
.BR ;Y
Save link location to primary selection (command
-.BR hint_mode_primary ,
+.BR hints_primary ,
aliases:
.BR phints ,
.BR phi ).
.TP
.BR ;r
Rapid hint mode, each matching hint opens a new tab in background. (command
-.BR hint_mode_rapid ,
+.BR hints_rapid ,
aliases:
.BR rhints ,
.BR rhi ).
.TP
.BR ;R
Rapid hint mode, each matching hint opens a new window. (command
-.BR hint_mode_rapid ,
+.BR hints_rapid_win ,
aliases:
.BR wrhints ,
.BR wrhi ).
@@ -491,27 +497,27 @@ not be saved persitently. (command
aliases:
.BR tcookie ).
.TP
-.BR yy
-Yank the current url to clipboard
+.BR [n]yy
+Yank the url of tab n or of current tab is n omitted to clipboard
(command
.BR yank ).
.TP
.BR yY
-Yank the current url to primary
+Yank the url of tab n or of current tab is n omitted to primary
selection (command
.BR yank_primary ,
aliases:
.BR pyank ).
.TP
.BR yt
-Yank the current title to clipboard
+Yank the title of tab n or of current tab is n omitted to clipboard
(command
.BR yank_title ,
aliases:
.BR tyank ).
.TP
.BR yT
-Yank the current title to primary
+Yank the title of tab n or of current tab is n omitted to primary
selection (command
.BR yank_title_primary ,
aliases:
@@ -528,16 +534,16 @@ aliases:
.BR ppaste ).
.TP
.BR Pp
-Paste from clipboard and load in a new view (command
-.BR paste_nv ,
+Paste from clipboard and load in a new tab (command
+.BR tab_paste ,
aliases:
-.BR tabpaste ).
+.BR tpaste ).
.TP
.BR PP
-Paste from primary selection and load in a new view (command
-.BR paste_primary_nv ,
+Paste from primary selection and load in a new tab (command
+.BR tab_paste_primary ,
aliases:
-.BR tabppaste ).
+.BR tppaste ).
.TP
.BR wp
Paste from clipboard and load in a new window (command
@@ -634,16 +640,18 @@ aliases:
.BR tuplugin ).
.TP
.BR V
-Next navigation action will be opened in a new view.
+Next navigation action will be opened in a new tab (command
+.BR new_tab ).
.TP
.BR W
-Next navigation action will be opened in a new window.
+Next navigation action will be opened in a new window (command
+.BR new_win ).
.TP
.BR eu
Show userscripts (command
.TP
-.BR wi
-Show the webinspector. Note that 'enable-developer-extras' has to be set.
+.BR [n]wi
+Show the webinspector of tab n or of current tab if n is omitted. Note that 'enable-developer-extras' has to be set.
(commmand
.BR web_inspector ,
aliases:
@@ -687,16 +695,16 @@ aliases:
.BR xt
Toggle visibility of tabbar.
(command
-.BR toggle_bars ,
+.BR toggle_tabbar ,
aliases:
.BR tbar ).
.TP
.BR xb
Toggle visibility of statusbar.
(command
-.BR toggle_bottombar ,
+.BR toggle_statusbar ,
aliases:
-.BR bbar ).
+.BR sbar ).
.TP
.BR xv
Toggle visibility of a tab.
@@ -705,8 +713,8 @@ Toggle visibility of a tab.
aliases:
.BR vis ).
.TP
-.BR C-M-p
-Print focused frame.
+.BR [n]C-M-p
+Print focused frame of tab n or of current tab if n is ommitted.
(command
.BR print ,
aliases:
@@ -733,8 +741,8 @@ Load a html string. This command is mainly intended for use in userscripts (comm
.BR load_html ).
.TP
.BR unbound
-Load a html string in a new view. This command is mainly intended for use in userscripts (command
-.BR load_html_nv ).
+Load a html string in a new tab. This command is mainly intended for use in userscripts (command
+.BR load_html_tab ).
.TP
.B Tab (S-Tab)
In Normal mode Tab shows the next (previous) shortcut, that matches the
@@ -1168,7 +1176,7 @@ default value:
.IR true .
.TP
.BR background-tabs
-Open new views in background.
+Open new tabs in background.
Possible values: true/false,
default value:
.IR false .
@@ -1257,8 +1265,6 @@ will be replaced with the download-uri,
will be replaced with the fullpath of the destination,
.IR dwb_cookies
will be replaced with the path to the cookie-file,
-.IR dwb_fifo
-will be replaced with the fifo-path if "use-fifo" is enabled,
default value:
.IR xterm\ -e\ wget\ 'dwb_uri'\ -O\ 'dwb_output'\ --load-cookies\ 'dwb_cookies' .
.TP
@@ -1307,7 +1313,7 @@ string,
default value:
.TP
.BR font-inactive
-The font used for inactive views. Possible values: a font description
+The font used for inactive tabs. Possible values: a font description
string,
default value:
.TP
@@ -1423,13 +1429,13 @@ default value:
.IR #eeeeee .
.TP
.BR normal-bg-color
-The background color of a not focused view. Possible values: an rgb
+The background color of a not focused tab. Possible values: an rgb
color-string,
default value:
.IR #505050 .
.TP
.BR normal-fg-color
-The foreground color of a not focused view. Possible values: an rgb
+The foreground color of a not focused tab. Possible values: an rgb
color-string,
default value:
.IR #cccccc .
@@ -1462,29 +1468,11 @@ Wether scrollbars should be enabled.
default value:
.IR false .
.TP
-.BR settings-bg-color
-The background color of a the settings view. Possible values: an rgb
-color-string,
-default value:
-.IR #151515 .
-.TP
-.BR settings-border
-The border for used for seperating lines in the settings view. Possible values: A
-css-border-description,
-default value:
-.IR 1px\ dotted\ black .
-.TP
-.BR settings-fg-color
-The foreground color of a the settings view. Possible values: an rgb
-color-string,
-default value:
-.IR #ffffff .
-.TP
.BR single-instance
Only one instance of dwb per user. This option will be overridden by the
commandlineoption -n. Possible values: true/false,
default value:
-.IR false .
+.IR true .
.TP
.BR ssl-strict
Whether to allow only save ssl-certificates.
@@ -1513,31 +1501,31 @@ default value:
.IR about:blank .
.TP
.BR tab-active-bg-color
-The background color the tab of the focused view. Possible values: an rgb
+The background color the tab of the focused tab. Possible values: an rgb
color-string,
default value:
.IR #000000 .
.TP
.BR tab-active-fg-color
-The foreground color of the tab of the focused view. Possible values: an rgb
+The foreground color of the tab of the focused tab. Possible values: an rgb
color-string,
default value:
.IR #ffffff .
.TP
.BR tab-normal-bg-color
-The background color the tab of a not focused view. Possible values: an rgb
+The background color the tab of a not focused tab. Possible values: an rgb
color-string,
default value:
.IR #505050 .
.TP
.BR tab-normal-fg-color
-The foreground color of the tab of a not focused view. Possible values: an rgb
+The foreground color of the tab of a not focused tab. Possible values: an rgb
color-string,
default value:
.IR #cccccc .
.TP
.BR tab-normal-fg-color
-The foreground color of the tab of a not focused view. Possible values: an rgb
+The foreground color of the tab of a not focused tab. Possible values: an rgb
color-string,
default value:
.IR #cccccc .
@@ -1558,12 +1546,6 @@ opened in a new window.
default value:
.IR true .
.TP
-.BR use-fifo
-Use a fifo to communicate with dwb, e.g. sending "open <url>" to the fifo would
-load the url in the current view,
-default value:
-.IR false .
-.TP
.BR widget-packing
A string consisting of 4 characters, where possible characters are:
.BR d ,
diff --git a/src/adblock.c b/src/adblock.c
index ee7f036f..0f1b9135 100644
--- a/src/adblock.c
+++ b/src/adblock.c
@@ -16,7 +16,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifdef DWB_ADBLOCKER
#include <string.h>
#include <JavaScriptCore/JavaScript.h>
#include "dwb.h"
@@ -932,4 +931,3 @@ adblock_init() {
_init = true;
return true;
}/*}}}*//*}}}*/
-#endif
diff --git a/src/adblock.h b/src/adblock.h
index eab61f74..ab121d84 100644
--- a/src/adblock.h
+++ b/src/adblock.h
@@ -16,7 +16,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifdef DWB_ADBLOCKER
#ifndef ADBLOCK_H
#define ADBLOCK_H
@@ -28,4 +27,3 @@ void adblock_disconnect(GList *gl);
void adblock_set_user_stylesheet(const char *file);
#endif // ADBLOCK_H
-#endif // DWB_ADBLOCKER
diff --git a/src/callback.c b/src/callback.c
index 7ed7d911..653f86fc 100644
--- a/src/callback.c
+++ b/src/callback.c
@@ -125,15 +125,9 @@ callback_key_press(GtkWidget *w, GdkEventKey *e) {
dwb_change_mode(NORMAL_MODE, true);
ret = false;
}
- else if (mode & PASS_THROUGH) {
+ else if (mode & INSERT_MODE) {
ret = false;
}
- else if (mode == INSERT_MODE) {
- if (CLEAN_STATE(e) & GDK_MODIFIER_MASK) {
- dwb_eval_key(e);
- ret = false;
- }
- }
else if (gtk_widget_has_focus(dwb.gui.entry) || mode & COMPLETION_MODE) {
ret = false;
}
diff --git a/src/commands.c b/src/commands.c
index 32ae007c..cee003ff 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -26,10 +26,7 @@
#include "commands.h"
#include "local.h"
#include "entry.h"
-#ifdef DWB_ADBLOCKER
#include "adblock.h"
-#endif
-
static int inline dwb_floor(double x) {
return x >= 0 ? (int) x : (int) x - 1;
@@ -72,6 +69,13 @@ commands_simple_command(KeyMap *km) {
km->map->arg.p = NULL;
dwb_clean_key_buffer();
}/*}}}*/
+static WebKitWebView *
+commands_get_webview_with_nummod() {
+ if (dwb.state.nummod > 0 && dwb.state.nummod <= g_list_length(dwb.state.views))
+ return WEBVIEW(g_list_nth(dwb.state.views, NUMMOD - 1));
+ else
+ return CURRENT_WEBVIEW();
+}
/* commands_add_view(KeyMap *, Arg *) {{{*/
DwbStatus
@@ -171,10 +175,9 @@ commands_find(KeyMap *km, Arg *arg) {
DwbStatus
commands_search(KeyMap *km, Arg *arg) {
- DwbStatus ret = STATUS_OK;
if (!dwb_search(arg))
- ret = STATUS_ERROR;
- return ret;
+ return STATUS_ERROR;
+ return STATUS_OK;
}
/* commands_show_hints {{{*/
@@ -240,14 +243,17 @@ commands_quickmark(KeyMap *km, Arg *arg) {
/* commands_reload(KeyMap *km, Arg *){{{*/
DwbStatus
commands_reload(KeyMap *km, Arg *arg) {
- dwb_reload();
+ GList *gl = dwb.state.nummod > 0 && dwb.state.nummod <= g_list_length(dwb.state.views)
+ ? g_list_nth(dwb.state.views, dwb.state.nummod-1)
+ : dwb.state.fview;
+ dwb_reload(gl);
return STATUS_OK;
}/*}}}*/
/* commands_reload_bypass_cache {{{*/
DwbStatus
commands_reload_bypass_cache(KeyMap *km, Arg *arg) {
- webkit_web_view_reload_bypass_cache(WEBVIEW_FROM_ARG(arg));
+ webkit_web_view_reload_bypass_cache(commands_get_webview_with_nummod());
return STATUS_OK;
}
/*}}}*/
@@ -255,7 +261,7 @@ commands_reload_bypass_cache(KeyMap *km, Arg *arg) {
/* commands_stop_loading {{{*/
DwbStatus
commands_stop_loading(KeyMap *km, Arg *arg) {
- webkit_web_view_stop_loading(WEBVIEW_FROM_ARG(arg));
+ webkit_web_view_stop_loading(commands_get_webview_with_nummod());
return STATUS_OK;
}
/*}}}*/
@@ -274,16 +280,14 @@ DwbStatus
commands_zoom_in(KeyMap *km, Arg *arg) {
View *v = dwb.state.fview->data;
WebKitWebView *web = WEBKIT_WEB_VIEW(v->web);
- DwbStatus ret = STATUS_OK;
for (int i=0; i<NUMMOD; i++) {
if ((webkit_web_view_get_zoom_level(web) > 4.0)) {
- ret = STATUS_ERROR;
- break;
+ return STATUS_ERROR;
}
webkit_web_view_zoom_in(web);
}
- return ret;
+ return STATUS_OK;
}/*}}}*/
/* commands_zoom_out(void *arg) {{{*/
@@ -291,16 +295,14 @@ DwbStatus
commands_zoom_out(KeyMap *km, Arg *arg) {
View *v = dwb.state.fview->data;
WebKitWebView *web = WEBKIT_WEB_VIEW(v->web);
- DwbStatus ret = STATUS_OK;
for (int i=0; i<NUMMOD; i++) {
if ((webkit_web_view_get_zoom_level(web) < 0.25)) {
- ret = STATUS_ERROR;
- break;
+ return STATUS_ERROR;
}
webkit_web_view_zoom_out(web);
}
- return ret;
+ return STATUS_OK;
}/*}}}*/
/* commands_scroll {{{*/
@@ -410,10 +412,11 @@ DwbStatus
commands_yank(KeyMap *km, Arg *arg) {
GdkAtom atom = GDK_POINTER_TO_ATOM(arg->p);
const char *text = NULL;
+ WebKitWebView *wv = commands_get_webview_with_nummod();
if (arg->n == CA_URI)
- text = webkit_web_view_get_uri(CURRENT_WEBVIEW());
+ text = webkit_web_view_get_uri(wv);
else if (arg->n == CA_TITLE)
- text = webkit_web_view_get_title(CURRENT_WEBVIEW());
+ text = webkit_web_view_get_title(wv);
return dwb_set_clipboard(text, atom);
}/*}}}*/
@@ -550,7 +553,6 @@ commands_toggle_scripts(KeyMap *km, Arg *arg) {
return STATUS_OK;
}/*}}}*/
-#ifdef DWB_ADBLOCKER
/* commands_toggle_adblocker {{{ */
DwbStatus
commands_toggle_adblocker(KeyMap *km, Arg *arg) {
@@ -562,7 +564,6 @@ commands_toggle_adblocker(KeyMap *km, Arg *arg) {
dwb_set_normal_message(dwb.state.fview, true, "Adblocker %s", running ? "disabled" : "enabled");
return STATUS_OK;
}/*}}}*/
-#endif
/* commands_new_window_or_view{{{*/
DwbStatus
@@ -606,8 +607,8 @@ commands_undo(KeyMap *km, Arg *arg) {
/* commands_print (Arg *) {{{*/
DwbStatus
commands_print(KeyMap *km, Arg *arg) {
- WebKitWebFrame *frame = webkit_web_view_get_focused_frame(CURRENT_WEBVIEW());
-
+ WebKitWebView *wv = commands_get_webview_with_nummod();
+ WebKitWebFrame *frame = webkit_web_view_get_focused_frame(wv);
if (frame) {
webkit_web_frame_print(frame);
return STATUS_OK;
@@ -619,7 +620,8 @@ commands_print(KeyMap *km, Arg *arg) {
DwbStatus
commands_web_inspector(KeyMap *km, Arg *arg) {
if (GET_BOOL("enable-developer-extras")) {
- webkit_web_inspector_show(webkit_web_view_get_inspector(CURRENT_WEBVIEW()));
+ WebKitWebView *wv = commands_get_webview_with_nummod();
+ webkit_web_inspector_show(webkit_web_view_get_inspector(wv));
return STATUS_OK;
}
return STATUS_ERROR;
@@ -649,7 +651,7 @@ commands_execute_userscript(KeyMap *km, Arg *arg) {
DwbStatus
commands_toggle_hidden_files(KeyMap *km, Arg *arg) {
dwb.state.hidden_files = !dwb.state.hidden_files;
- dwb_reload();
+ dwb_reload(dwb.state.fview);
return STATUS_OK;
}/*}}}*/
@@ -682,11 +684,6 @@ commands_fullscreen(KeyMap *km, Arg *arg) {
}/*}}}*/
/* commands_reload_scripts {{{*/
DwbStatus
-commands_pass_through(KeyMap *km, Arg *arg) {
- return dwb_change_mode(PASS_THROUGH);
-}/*}}}*/
-/* commands_reload_scripts {{{*/
-DwbStatus
commands_open_editor(KeyMap *km, Arg *arg) {
return dwb_open_in_editor();
}/*}}}*/
@@ -751,7 +748,8 @@ commands_execute_javascript(KeyMap *km, Arg *arg) {
FREE0(script);
script = g_strdup(arg->p);
}
- dwb_execute_script(webkit_web_view_get_focused_frame(CURRENT_WEBVIEW()), script, false);
+ WebKitWebView *wv = commands_get_webview_with_nummod();
+ dwb_execute_script(webkit_web_view_get_focused_frame(wv), script, false);
return STATUS_OK;
}/*}}}*/
/* commands_set {{{*/
diff --git a/src/commands.h b/src/commands.h
index 94ba3a89..841e4036 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -68,7 +68,6 @@ DwbStatus commands_view_source(KeyMap *, Arg *);
DwbStatus commands_yank(KeyMap *, Arg *);
DwbStatus commands_zoom_in(KeyMap *, Arg *);
DwbStatus commands_zoom_out(KeyMap *, Arg *);
-DwbStatus dwb_create_hints(Arg *);
DwbStatus commands_remove_view(KeyMap *, Arg *);
DwbStatus commands_set_zoom_level(KeyMap *, Arg *);
DwbStatus commands_toggle_hidden_files(KeyMap *, Arg *);
@@ -76,7 +75,6 @@ DwbStatus commands_web_inspector(KeyMap *, Arg *);
DwbStatus commands_quit(KeyMap *, Arg *);
DwbStatus commands_reload_scripts(KeyMap *, Arg *);
DwbStatus commands_fullscreen(KeyMap *, Arg *);
-DwbStatus commands_pass_through(KeyMap *, Arg *);
DwbStatus commands_open_editor(KeyMap *, Arg *);
DwbStatus commands_insert_mode(KeyMap *, Arg *);
DwbStatus commands_command_mode(KeyMap *, Arg *);
@@ -87,9 +85,6 @@ DwbStatus commands_toggle_lock_protect(KeyMap *, Arg *);
DwbStatus commands_execute_javascript(KeyMap *km, Arg *arg);
DwbStatus commands_set(KeyMap *km, Arg *arg);
DwbStatus commands_toggle_setting(KeyMap *km, Arg *arg);
-//DwbStatus commands_toggle_locked(KeyMap *, Arg *);
-#ifdef DWB_ADBLOCKER
DwbStatus commands_toggle_adblocker(KeyMap *, Arg *);
-#endif
#endif
diff --git a/src/config.h b/src/config.h
index a771b85e..951a1ddb 100644
--- a/src/config.h
+++ b/src/config.h
@@ -17,14 +17,14 @@
*/
static KeyValue KEYS[] = {
- { "add_view", { "ga", 0, }, },
+ { "tab_new", { "ga", 0, }, },
{ "allow_cookie", { "CC", 0, }, },
{ "allow_session_cookie", { "CS", 0, }, },
{ "allow_session_cookie_tmp", { "CT", 0, }, },
{ "bookmark", { "M", 0, }, },
{ "bookmarks", { "gb", 0, }, },
- { "bookmarks_nv", { "gB", 0, }, },
- { "bookmarks_nw", { "wB", 0, }, },
+ { "tab_bookmarks", { "gB", 0, }, },
+ { "win_bookmarks", { "wB", 0, }, },
{ "command_mode", { ":", 0, }, },
{ "only", { "co", 0, }, },
{ "find_forward", { "/", 0, }, },
@@ -33,41 +33,41 @@ static KeyValue KEYS[] = {
{ "find_backward", { "?", 0, }, },
{ "focus_next", { "J", 0, }, },
{ "focus_prev", { "K", 0, }, },
- { "focus_nth_view", { "T", 0, }, },
- { "hint_mode", { "f", 0, }, },
- { "hint_mode_links", { ";;", 0, }, },
- { "hint_mode_images", { ";i", 0, }, },
- { "hint_mode_images_nv", { ";I", 0, }, },
- { "hint_mode_editable", { ";e", 0, }, },
- { "hint_mode_url", { ";o", 0, }, },
- { "hint_mode_url_nv", { ";O", 0, }, },
- { "hint_mode_download", { ";d", 0 }, },
- { "hint_mode_nv", { "F", 0, }, },
- { "hint_mode_nw", { "wf", 0, }, },
- { "hint_mode_clipboard", { ";y", 0, }, },
- { "hint_mode_primary", { ";Y", 0, }, },
- { "hint_mode_rapid", { ";r", 0, }, },
- { "hint_mode_rapid_nw", { ";R", 0, }, },
+ { "focus_tab", { "T", 0, }, },
+ { "hints", { "f", 0, }, },
+ { "hints_links", { ";;", 0, }, },
+ { "hints_images", { ";i", 0, }, },
+ { "hints_images_tab", { ";I", 0, }, },
+ { "hints_editable", { ";e", 0, }, },
+ { "hints_url", { ";o", 0, }, },
+ { "hints_url_tab", { ";O", 0, }, },
+ { "hints_download", { ";d", 0 }, },
+ { "hints_tab", { "F", 0, }, },
+ { "hints_win", { "wf", 0, }, },
+ { "hints_clipboard", { ";y", 0, }, },
+ { "hints_primary", { ";Y", 0, }, },
+ { "hints_rapid", { ";r", 0, }, },
+ { "hints_rapid_win", { ";R", 0, }, },
{ "history_back", { "H", 0, }, },
{ "history_forward", { "L", 0, }, },
- { "history_back_nv", { "th", 0, }, },
- { "history_forward_nv", { "tl", 0, }, },
- { "history_back_nw", { "wh", 0, }, },
- { "history_forward_nw", { "wl", 0, }, },
+ { "tab_hist_back", { "th", 0, }, },
+ { "tab_hist_forward", { "tl", 0, }, },
+ { "win_hist_back", { "wh", 0, }, },
+ { "win_hist_forward", { "wl", 0, }, },
{ "insert_mode", { "i", 0, }, },
{ "open", { "o", 0, }, },
- { "Open", { "go", 0, }, },
- { "open_nv", { "O", 0, }, },
- { "Open_nv", { "gO", 0, }, },
- { "open_nw", { "wo", 0, }, },
- { "Open_nw", { "wO", 0, }, },
- { "open_start_page", { "h", GDK_CONTROL_MASK, }, },
- { "open_quickmark", { "b", 0, }, },
- { "open_quickmark_nv", { "B", 0, }, },
- { "open_quickmark_nw", { "wb", 0, }, },
+ { "open_url", { "go", 0, }, },
+ { "tabopen", { "O", 0, }, },
+ { "tabopen_url", { "gO", 0, }, },
+ { "winopen", { "wo", 0, }, },
+ { "winopen_url", { "wO", 0, }, },
+ { "start_page", { "h", GDK_CONTROL_MASK, }, },
+ { "quickmark", { "b", 0, }, },
+ { "tab_quickmark", { "B", 0, }, },
+ { "win_quickmark", { "wb", 0, }, },
{ "reload", { "r", 0, }, },
{ "reload_bypass_cache", { "R", 0, }, },
- { "remove_view", { "d", 0, }, },
+ { "close_tab", { "d", 0, }, },
{ "save_quickmark", { "m", 0, }, },
{ "scroll_bottom", { "G", 0, }, },
{ "scroll_down", { "j", 0, }, },
@@ -82,7 +82,6 @@ static KeyValue KEYS[] = {
{ "show_keys", { "Sk", 0, }, },
{ "show_settings", { "Ss", 0, }, },
{ "stop_loading", { "s", GDK_CONTROL_MASK, }, },
- { "toggle_bottomstack", { "tb", 0, }, },
{ "view_source", { "gf", 0, }, },
{ "zoom_in", { "+", 0, }, },
{ "zoom", { "=", 0, }, },
@@ -99,10 +98,10 @@ static KeyValue KEYS[] = {
{ "yank_title_primary", { "yT", 0, }, },
{ "paste", { "pp", 0, }, },
{ "paste_primary", { "pP", 0, }, },
- { "paste_nv", { "Pp", 0, }, },
- { "paste_primary_nv", { "PP", 0, }, },
- { "paste_nw", { "wp", 0, }, },
- { "paste_primary_nw", { "wP", 0, }, },
+ { "tab_paste", { "Pp", 0, }, },
+ { "tab_paste_primary", { "PP", 0, }, },
+ { "win_paste", { "wp", 0, }, },
+ { "win_paste_primary", { "wP", 0, }, },
/* entry shortcuts */
{ "entry_delete_word", { "w", GDK_CONTROL_MASK, }, },
{ "entry_delete_word_forward",{ "e", GDK_CONTROL_MASK, }, },
@@ -133,24 +132,24 @@ static KeyValue KEYS[] = {
{ "toggle_plugins_host", { "ph", 0 }, },
{ "toggle_plugins_uri_tmp", { "ptu", 0 }, },
{ "toggle_plugins_host_tmp", { "pth", 0 }, },
- { "new_view", { "V", 0 }, },
- { "new_window", { "W", 0 }, },
+ { "new_tab", { "V", 0 }, },
+ { "new_win", { "W", 0 }, },
{ "save", { "sf", 0 }, },
{ "undo", { "u", 0 }, },
{ "execute_userscript", { "eu", 0 }, },
{ "print", { "p", GDK_CONTROL_MASK | GDK_MOD1_MASK }, },
{ "load_html", { NULL, 0 }, },
- { "load_html_nv", { NULL, 0 }, },
+ { "load_html_tab", { NULL, 0 }, },
{ "toggle_hidden_files", { "g.", 0 }, },
{ "complete_path", { "p", GDK_CONTROL_MASK }, },
{ "quit", { "q", GDK_CONTROL_MASK }, },
- { "fullscreen", { "F11", GDK_CONTROL_MASK }, },
+ { "fullscreen", { "@F11@", 0 }, },
{ "pass_through", { "i", GDK_CONTROL_MASK }, },
{ "open_editor", { "e", GDK_CONTROL_MASK }, },
{ "toggle_bars", { "xx", 0 }, },
- { "toggle_topbar", { "xt", 0 }, },
- { "toggle_bottombar", { "xb", 0 }, },
- { "presentation_mode", { "F12", GDK_CONTROL_MASK }, },
+ { "toggle_tabbar", { "xt", 0 }, },
+ { "toggle_statusbar", { "xb", 0 }, },
+ { "presentation_mode", { "@F12@", 0 }, },
{ "protect", { "P", GDK_CONTROL_MASK }, },
{ "lock_uri", { "xu", 0 }, },
{ "lock_domain", { "xd", 0 }, },
@@ -163,7 +162,7 @@ static KeyValue KEYS[] = {
/* FUNCTION_MAP{{{*/
static FunctionMap FMAP [] = {
- { { "add_view", "Add a new view", }, 1,
+ { { "tab_new", "Add a new tab", }, 1,
(Func)commands_add_view, NULL, ALWAYS_SM,
{ .p = NULL }, EP_NONE, { NULL }, },
@@ -183,11 +182,11 @@ static FunctionMap FMAP [] = {
(Func) commands_toggle_bars, NULL, ALWAYS_SM,
{ .n = BAR_VIS_STATUS | BAR_VIS_TOP }, EP_NONE, { "bars", NULL }, },
- { { "toggle_topbar", "Toggle visibility of tabbar" }, 1,
+ { { "toggle_tabbar", "Toggle visibility of tabbar" }, 1,
(Func) commands_toggle_bars, NULL, ALWAYS_SM,
{ .n = BAR_VIS_TOP }, EP_NONE, { "tbar", NULL }, },
- { { "toggle_bottombar", "Toggle visibility of statusbar" }, 1,
+ { { "toggle_statusbar", "Toggle visibility of statusbar" }, 1,
(Func) commands_toggle_bars, NULL, ALWAYS_SM,
{ .n = BAR_VIS_STATUS }, EP_NONE, { NULL }, },
@@ -226,23 +225,23 @@ static FunctionMap FMAP [] = {
(Func)commands_bookmark, NO_URL, POST_SM,
{0}, EP_NONE, { "bmark", "bma", NULL }, },
- { { "bookmarks", "Bookmarks", }, CP_COMMANDLINE|CP_HAS_MODE,
+ { { "bookmarks", "bookmarks", }, CP_COMMANDLINE|CP_HAS_MODE,
(Func)commands_bookmarks, "No Bookmarks", NEVER_SM,
{ .n = OPEN_NORMAL }, EP_NONE, { "bmarks", "bmas", NULL }, },
- { { "bookmarks_nv", "Bookmarks new tab", }, CP_COMMANDLINE|CP_HAS_MODE,
+ { { "tab_bookmarks", "tabmarks", }, CP_COMMANDLINE|CP_HAS_MODE,
(Func)commands_bookmarks, "No Bookmarks", NEVER_SM,
{ .n = OPEN_NEW_VIEW }, EP_NONE, { "tabmarks", NULL }, },
- { { "bookmarks_nw", "Bookmarks new window", }, CP_COMMANDLINE|CP_HAS_MODE,
+ { { "win_bookmarks", "winmarks", }, CP_COMMANDLINE|CP_HAS_MODE,
(Func)commands_bookmarks, "No Bookmarks", NEVER_SM,
{ .n = OPEN_NEW_WINDOW}, EP_NONE, { "winmarks", NULL }, },
- { { "new_view", "New view for next navigation", }, 0,
+ { { "new_tab", "new_tab", }, 0,
(Func)commands_new_window_or_view, NULL, NEVER_SM,
{ .n = OPEN_NEW_VIEW }, EP_NONE, { NULL }, },
- { { "new_window", "New window for next navigation", }, 0,
+ { { "new_win", "new_win", }, 0,
(Func)commands_new_window_or_view, NULL, NEVER_SM,
{ .n = OPEN_NEW_WINDOW }, EP_NONE, { NULL }, },
@@ -270,71 +269,71 @@ static FunctionMap FMAP [] = {
(Func)commands_focus_input, "No input found in current context", ALWAYS_SM,
{0}, EP_NONE, { NULL }, },
- { { "focus_next", "Focus next view", }, CP_COMMANDLINE | CP_HAS_MODE,
- (Func)commands_focus, "No other view", ALWAYS_SM,
+ { { "focus_next", "Focus next tab", }, CP_COMMANDLINE | CP_HAS_MODE,
+ (Func)commands_focus, "No other tab", ALWAYS_SM,
{ .n = 1 }, EP_NONE, { "tabnext", NULL }, },
- { { "focus_prev", "Focus previous view", }, CP_COMMANDLINE | CP_HAS_MODE,
- (Func)commands_focus, "No other view", ALWAYS_SM,
+ { { "focus_prev", "Focus previous tab", }, CP_COMMANDLINE | CP_HAS_MODE,
+ (Func)commands_focus, "No other tab", ALWAYS_SM,
{ .n = -1 }, EP_NONE, { "tabprev", NULL }, },
-
- { { "focus_nth_view", "Focus nth view", }, CP_COMMANDLINE | CP_HAS_MODE,
- (Func)commands_focus_nth_view, "No such view", ALWAYS_SM,
+
+ { { "focus_tab", "Focus nth tab", }, CP_COMMANDLINE | CP_HAS_MODE,
+ (Func)commands_focus_nth_view, "No such tab", ALWAYS_SM,
{ 0 }, EP_NONE, { "tab", NULL }, },
- { { "hint_mode", "Follow hints", }, CP_COMMANDLINE | CP_HAS_MODE,
+ { { "hints", "Follow hints", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_show_hints, NO_HINTS, NEVER_SM,
{ .n = OPEN_NORMAL, .i = HINT_T_ALL }, EP_NONE, { "hints", "hi", NULL }, },
- { { "hint_mode_links", "Follow links", }, CP_COMMANDLINE | CP_HAS_MODE,
+ { { "hints_links", "Follow links", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_show_hints, "No links", NEVER_SM,
{ .n = OPEN_NORMAL, .i = HINT_T_LINKS }, EP_NONE, { "lhints", "lhi", NULL }, },
- { { "hint_mode_images", "Follow images", }, CP_COMMANDLINE | CP_HAS_MODE,
+ { { "hints_images", "Follow images", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_show_hints, "No images", NEVER_SM,
{ .n = OPEN_NORMAL, .i = HINT_T_IMAGES }, EP_NONE, { "ihints", "ihi", NULL }, },
- { { "hint_mode_images_nv", "Follow images in new tab", }, CP_COMMANDLINE | CP_HAS_MODE,
+ { { "hints_images_tab", "Follow images in new tab", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_show_hints, "No images", NEVER_SM,
{ .n = OPEN_NEW_VIEW, .i = HINT_T_IMAGES }, EP_NONE, { "itabhints", "ithi", NULL }, },
- { { "hint_mode_editable", "Follow editable", }, CP_COMMANDLINE | CP_HAS_MODE,
+ { { "hints_editable", "Follow editable", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_show_hints, "No editable elements", NEVER_SM,
{ .n = OPEN_NORMAL, .i = HINT_T_EDITABLE }, EP_NONE, { "ehints", "ehi", NULL }, },
- { { "hint_mode_url", "hintopen", }, CP_COMMANDLINE | CP_HAS_MODE,
+ { { "hints_url", "hintopen", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_show_hints, NO_HINTS, NEVER_SM,
{ .n = OPEN_NORMAL, .i = HINT_T_URL }, EP_NONE, { "uhints", "uhi", NULL }, },
- { { "hint_mode_url_nv", "hinttabopen", }, CP_COMMANDLINE | CP_HAS_MODE,
+ { { "hints_url_tab", "hinttabopen", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_show_hints, NO_HINTS, NEVER_SM,
{ .n = OPEN_NEW_VIEW, .i = HINT_T_URL }, EP_NONE, { "utabhints", "uthi", NULL }, },
- { { "hint_mode_nv", "Follow hints in new tab", }, CP_COMMANDLINE | CP_HAS_MODE,
+ { { "hints_tab", "Follow hints in new tab", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_show_hints, NO_HINTS, NEVER_SM,
{ .n = OPEN_NEW_VIEW, .i = HINT_T_ALL }, EP_NONE, { "tabhints", "thi", NULL }, },
- { { "hint_mode_nw", "Follow hints in new window", }, CP_COMMANDLINE | CP_HAS_MODE,
+ { { "hints_win", "Follow hints in new window", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_show_hints, NO_HINTS, NEVER_SM,
{ .n = OPEN_NEW_WINDOW, .i = HINT_T_ALL }, EP_NONE, { "winhints", "whi", NULL }, },
- { { "hint_mode_clipboard", "Copy to clipboard", }, CP_COMMANDLINE | CP_HAS_MODE,
+ { { "hints_clipboard", "Copy to clipboard", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_show_hints, NO_HINTS, NEVER_SM,
{ .n = OPEN_NORMAL, .i = HINT_T_CLIPBOARD }, EP_NONE, { "chints", "chi", NULL }, },
- { { "hint_mode_primary", "Copy to primary", }, CP_COMMANDLINE | CP_HAS_MODE,
+ { { "hints_primary", "Copy to primary", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_show_hints, NO_HINTS, NEVER_SM,
{ .n = OPEN_NORMAL, .i = HINT_T_PRIMARY }, EP_NONE, { "phints", "phi", NULL }, },
- { { "hint_mode_rapid", "Rapid hint mode", }, CP_COMMANDLINE | CP_HAS_MODE,
+ { { "hints_rapid", "Rapid hint mode", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_show_hints, NO_HINTS, NEVER_SM,
{ .n = OPEN_NORMAL, .i = HINT_T_RAPID }, EP_NONE, { "rhints", "rhi", NULL }, },
- { { "hint_mode_rapid_nw", "Rapid hint mode", }, CP_COMMANDLINE | CP_HAS_MODE,
+ { { "hints_rapid_win", "Rapid hint mode", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_show_hints, NO_HINTS, NEVER_SM,
{ .n = OPEN_NORMAL, .i = HINT_T_RAPID_NW }, EP_NONE, { "wrhints", "wrhi", NULL }, },
- { { "hint_mode_download", "Download", }, CP_COMMANDLINE | CP_HAS_MODE,
+ { { "hints_download", "Download", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_show_hints, NO_HINTS, NEVER_SM,
{ .n = OPEN_DOWNLOAD }, EP_NONE, { "dhints", }, },
@@ -346,19 +345,19 @@ static FunctionMap FMAP [] = {
(Func)commands_history, "End of History", ALWAYS_SM,
{ .n = OPEN_NORMAL, .i = 1 }, EP_NONE, { "forward", "fo", NULL }, },
- { { "history_back_nv", "Go Back", }, 1,
+ { { "tab_hist_back", "Go Back", }, 1,
(Func)commands_history, "Beginning of History", ALWAYS_SM,
{ .n = OPEN_NEW_VIEW, .i = -1 }, EP_NONE, { "tabback", "tba", NULL }, },
- { { "history_forward_nv", "Go Forward", }, 1,
+ { { "tab_hist_forward", "Go Forward", }, 1,
(Func)commands_history, "End of History", ALWAYS_SM,
{ .n = OPEN_NEW_VIEW, .i = 1 }, EP_NONE, { "tabforward", "tfo", NULL }, },
- { { "history_back_nw", "Go Back", }, 1,
+ { { "win_hist_back", "Go Back", }, 1,
(Func)commands_history, "Beginning of History", ALWAYS_SM,
{ .n = OPEN_NEW_WINDOW, .i = -1 }, EP_NONE, { "winback", "wba", NULL }, },
- { { "history_forward_nw", "Go Forward", }, 1,
+ { { "win_hist_forward", "Go Forward", }, 1,
(Func)commands_history, "End of History", ALWAYS_SM,
{ .n = OPEN_NEW_WINDOW, .i = 1 }, EP_NONE, { "winforward", "wfo", NULL }, },
@@ -370,7 +369,7 @@ static FunctionMap FMAP [] = {
(Func)commands_open, NULL, NEVER_SM,
{ .i = HTML_STRING, .n = OPEN_NORMAL, .p = NULL }, EP_NONE, { NULL }, },
- { { "load_html_nv", "Load html new view", }, 1,
+ { { "load_html_tab", "Load html new tab", }, 1,
(Func)commands_open, NULL, NEVER_SM,
{ .i = HTML_STRING, .n = OPEN_NEW_VIEW, .p = NULL }, EP_NONE, { NULL }, },
@@ -378,41 +377,41 @@ static FunctionMap FMAP [] = {
(Func)commands_open, NULL, NEVER_SM,
{ .n = OPEN_NORMAL, .p = NULL }, EP_COMP_DEFAULT, { "o", NULL }, },
- { { "Open", "open", }, CP_COMMANDLINE | CP_HAS_MODE,
+ { { "open_url", "open", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_open, NULL, NEVER_SM,
{ .n = OPEN_NORMAL | SET_URL, .p = NULL }, EP_COMP_DEFAULT, { NULL }, },
- { { "open_nv", "tabopen", }, 1,
+ { { "tabopen", "tabopen", }, 1,
(Func)commands_open, NULL, NEVER_SM,
- { .n = OPEN_NEW_VIEW, .p = NULL }, EP_COMP_DEFAULT, { "t", "tabopen", NULL }, },
+ { .n = OPEN_NEW_VIEW, .p = NULL }, EP_COMP_DEFAULT, { "t", "topen", NULL }, },
- { { "Open_nv", "tabopen", }, CP_COMMANDLINE | CP_HAS_MODE,
+ { { "tabopen_url", "tabopen", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_open, NULL, NEVER_SM,
{ .n = OPEN_NEW_VIEW | SET_URL, .p = NULL }, EP_COMP_DEFAULT, { NULL }, },
- { { "open_nw", "winopen", }, 1,
+ { { "winopen", "winopen", }, 1,
(Func)commands_open, NULL, NEVER_SM,
- { .n = OPEN_NEW_WINDOW, .p = NULL }, EP_COMP_DEFAULT, { "w", "winopen", NULL }, },
+ { .n = OPEN_NEW_WINDOW, .p = NULL }, EP_COMP_DEFAULT, { "w", "wopen", NULL }, },
- { { "Open_nw", "winopen", }, CP_COMMANDLINE | CP_HAS_MODE,
+ { { "winopen_url", "winopen", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_open, NULL, NEVER_SM,
{ .n = OPEN_NEW_WINDOW | SET_URL, .p = NULL }, EP_COMP_DEFAULT, { NULL }, },
- { { "open_quickmark", "Open quickmark", }, CP_COMMANDLINE | CP_HAS_MODE,
+ { { "quickmark", "Open quickmark", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_quickmark, NO_URL, NEVER_SM,
{ .n = QUICK_MARK_OPEN, .i=OPEN_NORMAL }, EP_NONE, { "qmarks", NULL }, },
- { { "open_quickmark_nv", "Open quickmark in a new tab", }, CP_COMMANDLINE | CP_HAS_MODE,
+ { { "tab_quickmark", "Open quickmark in a new tab", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_quickmark, NULL, NEVER_SM,
{ .n = QUICK_MARK_OPEN, .i=OPEN_NEW_VIEW }, EP_NONE, { "tabqmarks", NULL }, },
- { { "open_quickmark_nw", "Open quickmark in a new window", }, CP_COMMANDLINE | CP_HAS_MODE,
+ { { "win_quickmark", "Open quickmark in a new window", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_quickmark, NULL, NEVER_SM,
{ .n = QUICK_MARK_OPEN, .i=OPEN_NEW_WINDOW }, EP_NONE, { "winqmarks", NULL }, },
- { { "open_start_page", "Open startpage", }, 1,
+ { { "start_page", "Open startpage", }, 1,
(Func)commands_open_startpage, "No startpage set", ALWAYS_SM,
- { 0 }, EP_NONE, { "home", NULL }, },
+ { .p = "dwb://bookmarks" }, EP_NONE, { "home", NULL }, },
{ { "quit", "Quit dwb", }, 1,
(Func)commands_quit, NULL, ALWAYS_SM,
@@ -430,12 +429,12 @@ static FunctionMap FMAP [] = {
(Func)commands_stop_loading, NULL, ALWAYS_SM,
{ 0 }, EP_NONE, { "st", "stop", NULL }, },
- { { "remove_view", "Close view", }, 1,
+ { { "close_tab", "Close tab", }, 1,
(Func)commands_remove_view, NULL, ALWAYS_SM,
{ 0 }, EP_NONE, { "close", NULL }, },
{ { "only", "Close other tabs except for current", }, 1,
- (Func)commands_only, "No other view", ALWAYS_SM,
+ (Func)commands_only, "No other tab", ALWAYS_SM,
{ 0 }, EP_NONE, { NULL }, },
{ { "save_quickmark", "Save quickmark", }, CP_COMMANDLINE | CP_HAS_MODE,
@@ -488,7 +487,7 @@ static FunctionMap FMAP [] = {
{ { "set_setting", "Set setting", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_set_setting, NULL, NEVER_SM,
- { 0 }, EP_NONE, { "set", NULL }, },
+ { 0 }, EP_NONE, { NULL }, },
{ { "set_key", "Set keybinding", }, CP_COMMANDLINE | CP_HAS_MODE,
(Func)commands_set_key, NULL, NEVER_SM,
@@ -544,21 +543,21 @@ static FunctionMap FMAP [] = {
(Func)commands_paste, "No primary selection", ALWAYS_SM,
{ .n = OPEN_NORMAL, .p = GDK_SELECTION_PRIMARY, .ro = true }, EP_NONE, { "ppaste", NULL }, },
- { { "paste_nv", "Open url from clipboard in a new tab", }, 1,
+ { { "tab_paste", "Open url from clipboard in a new tab", }, 1,
(Func)commands_paste, "Clipboard is empty", ALWAYS_SM,
{ .n = OPEN_NEW_VIEW, .p = GDK_NONE, .ro = true }, EP_NONE, { "tabpaste", NULL }, },
- { { "paste_primary_nv", "Open url from primary selection in a new window", }, 1,
+ { { "tab_paste_primary", "Open url from primary selection in a new window", }, 1,
(Func)commands_paste, "No primary selection", ALWAYS_SM,
{ .n = OPEN_NEW_VIEW, .p = GDK_SELECTION_PRIMARY, .ro = true }, EP_NONE, { "tabppaste", NULL }, },
- { { "paste_nw", "Open url from clipboard in a new window", }, 1,
+ { { "win_paste", "Open url from clipboard in a new window", }, 1,
(Func)commands_paste, "Clipboard is empty", ALWAYS_SM,
- { .n = OPEN_NEW_WINDOW, .p = GDK_NONE, .ro = true }, EP_NONE, { "winpaste", NULL }, },
+ { .n = OPEN_NEW_WINDOW, .p = GDK_NONE, .ro = true }, EP_NONE, { "wpaste", NULL }, },
- { { "paste_primary_nw", "Open url from primary selection in a new window", }, 1,
+ { { "win_paste_primary", "Open url from primary selection in a new window", }, 1,
(Func)commands_paste, "No primary selection", ALWAYS_SM,
- { .n = OPEN_NEW_WINDOW, .p = GDK_SELECTION_PRIMARY, .ro = true }, EP_NONE, { "winppaste", NULL }, },
+ { .n = OPEN_NEW_WINDOW, .p = GDK_SELECTION_PRIMARY, .ro = true }, EP_NONE, { "wppaste", NULL }, },
{ { "save_session", "Save current session", }, 1,
@@ -713,10 +712,6 @@ static FunctionMap FMAP [] = {
(Func) commands_fullscreen, NULL, ALWAYS_SM,
{ 0 }, EP_NONE, { "fs", NULL }, },
- { { "pass_through", "Pass-through mode" }, 1,
- (Func) commands_pass_through, NULL, POST_SM,
- { 0 }, EP_NONE, { "pthrough", NULL }, },
-
{ { "open_editor", "Open external editor" }, 1,
(Func) commands_open_editor, "No input focused", NEVER_SM,
{ 0 }, EP_NONE, { "editor", NULL }, },
@@ -814,7 +809,7 @@ static WebSettings DWB_SETTINGS[] = {
SETTING_BUILTIN, CHAR, { .p = NULL }, (S_Func) dwb_webkit_setting, },
{ { "zoom-step", "The zoom step", },
SETTING_BUILTIN, DOUBLE, { .d = 0.1 }, (S_Func) dwb_webkit_setting, },
- { { "custom-encoding", "The custom encoding of the view", },
+ { { "custom-encoding", "The custom encoding of the tab", },
SETTING_PER_VIEW, CHAR, { .p = NULL }, (S_Func) dwb_webview_property, },
{ { "editable", "Whether content can be modified", },
SETTING_PER_VIEW, BOOLEAN, { .b = false }, (S_Func) dwb_webview_property, },
@@ -839,9 +834,9 @@ static WebSettings DWB_SETTINGS[] = {
{ { "scroll-step", "Whether to open tabs in background", },
SETTING_GLOBAL, DOUBLE, { .d = 0 }, (S_Func) dwb_init_vars, },
- { { "foreground-color", "Foreground color of the active view", },
+ { { "foreground-color", "Foreground color of the active tab", },
SETTING_GLOBAL, COLOR_CHAR, { .p = "#ffffff" }, (S_Func) dwb_reload_layout, },
- { { "background-color", "Background color of the active view", },
+ { { "background-color", "Background color of the active tab", },
SETTING_GLOBAL, COLOR_CHAR, { .p = "#000000" }, (S_Func) dwb_reload_layout, },
{ { "tab-active-fg-color", "Foreground color of the active tab", },
@@ -949,9 +944,6 @@ static WebSettings DWB_SETTINGS[] = {
{ { "complete-userscripts", "Whether to complete userscripts", },
SETTING_GLOBAL, BOOLEAN, { .b = false }, (S_Func)dwb_init_vars, },
- { { "use-fifo", "Create a fifo pipe for communication", },
- SETTING_GLOBAL, BOOLEAN, { .b = false }, NULL, },
-
{ { "default-width", "Default width of the window", },
SETTING_GLOBAL, INTEGER, { .i = 800 }, NULL, },
{ { "default-height", "Default height of the window", },
@@ -972,12 +964,10 @@ static WebSettings DWB_SETTINGS[] = {
SETTING_GLOBAL, CHAR, { .p = "xterm -e ncftp 'dwb_uri'" }, NULL, },
{ { "editor", "External editor", },
SETTING_GLOBAL, CHAR, { .p = "xterm -e vim dwb_uri" }, NULL, },
-#ifdef DWB_ADBLOCKER
{ { "adblocker", "Whether to block advertisements via a filterlist", },
SETTING_GLOBAL, BOOLEAN, { .b = false }, (S_Func)dwb_set_adblock, },
{ { "adblocker-filterlist", "Path to a filterlist", },
SETTING_GLOBAL, CHAR, { .p = NULL }, NULL, },
-#endif
{ { "plugin-blocker", "Whether to block flash plugins and replace them with a clickable element", },
SETTING_PER_VIEW, BOOLEAN, { .b = true }, (S_Func)dwb_set_plugin_blocker, },
{ { "plugin-blocker", "Whether to block flash plugins and replace them with a clickable element", },
diff --git a/src/domain.c b/src/domain.c
index 52fe4c7c..9df7f71f 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -15,7 +15,6 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifdef DWB_DOMAIN_SERVICE
#include <string.h>
#include "dwb.h"
#include "util.h"
@@ -175,4 +174,3 @@ domain_init() {
g_hash_table_insert(_tld_table, eff_tld, TLDS_EFFECTIVE[i]);
}
}
-#endif
diff --git a/src/domain.h b/src/domain.h
index 2644825c..210b1927 100644
--- a/src/domain.h
+++ b/src/domain.h
@@ -16,7 +16,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifdef DWB_DOMAIN_SERVICE
#ifndef DOMAIN_H
#define DOMAIN_H
@@ -30,4 +29,3 @@ GSList * domain_get_cookie_domains(WebKitWebView *wv);
gboolean domain_match(char **, const char *, const char *);
const char * domain_get_base_for_host(const char *host);
#endif
-#endif
diff --git a/src/download.c b/src/download.c
index b7cf997e..515d2d9a 100644
--- a/src/download.c
+++ b/src/download.c
@@ -73,10 +73,6 @@ download_get_command(const char *uri, const char *output) {
FREE(command);
command = newcommand;
}
- if ( GET_BOOL("use-fifo") && (newcommand = util_string_replace(command, "dwb_fifo", dwb.files.fifo)) ) {
- FREE(command);
- command = newcommand;
- }
return command;
}/*}}}*/
diff --git a/src/dwb.c b/src/dwb.c
index 818735fe..91d0041b 100644
--- a/src/dwb.c
+++ b/src/dwb.c
@@ -39,9 +39,7 @@
#include "js.h"
#include "callback.h"
#include "entry.h"
-#ifdef DWB_ADBLOCKER
#include "adblock.h"
-#endif
#include "domain.h"
/* DECLARATIONS {{{*/
@@ -72,6 +70,7 @@ static char * dwb_test_userscript(const char *);
static void dwb_open_channel(const char *);
static void dwb_open_si_channel(void);
static gboolean dwb_handle_channel(GIOChannel *c, GIOCondition condition, void *data);
+static void dwb_parse_commands(const char *line);
static void dwb_init_key_map(void);
@@ -135,7 +134,6 @@ dwb_set_plugin_blocker(GList *gl, WebSettings *s) {
return STATUS_OK;
}/*}}}*/
-#ifdef DWB_ADBLOCKER
/* dwb_set_adblock {{{*/
void
dwb_set_adblock(GList *gl, WebSettings *s) {
@@ -148,7 +146,6 @@ dwb_set_adblock(GList *gl, WebSettings *s) {
adblock_disconnect(l);
}
}/*}}}*/
-#endif
/* dwb_set_cookies */
static DwbStatus
@@ -471,7 +468,7 @@ dwb_update_status_text(GList *gl, GtkAdjustment *a) {
/*}}}*/
/* FUNCTIONS {{{*/
-
+/* dwb_glist_prepend_unique(GList **list, char *text) {{{*/
void
dwb_glist_prepend_unique(GList **list, char *text) {
for (GList *l = (*list); l; l=l->next) {
@@ -791,7 +788,7 @@ dwb_follow_selection() {
/* dwb_open_startpage(GList *) {{{*/
DwbStatus
dwb_open_startpage(GList *gl) {
- if (!dwb.misc.startpage)
+ if (dwb.misc.startpage == NULL)
return STATUS_ERROR;
if (gl == NULL)
gl = dwb.state.fview;
@@ -995,10 +992,10 @@ dwb_toggle_allowed(const char *filename, const char *data) {
}/*}}}*/
void
-dwb_reload(void) {
- const char *path = webkit_web_view_get_uri(CURRENT_WEBVIEW());
+dwb_reload(GList *gl) {
+ const char *path = webkit_web_view_get_uri(WEBVIEW(gl));
if ( !local_check_directory(dwb.state.fview, path, false, NULL) ) {
- webkit_web_view_reload(CURRENT_WEBVIEW());
+ webkit_web_view_reload(WEBVIEW(gl));
}
}
@@ -1863,7 +1860,6 @@ dwb_parse_nummod(const char *text) {
dwb.state.nummod = (int)strtol(num, NULL, 10);
while (g_ascii_isspace(*text)) text++;
return text;
-
}
gboolean
@@ -1886,7 +1882,7 @@ dwb_entry_activate(GdkEventKey *e) {
dwb_set_key(token[0], token[1]);
g_strfreev(token);
return true;
- case COMMAND_MODE: dwb_parse_command_line(GET_TEXT(), false);
+ case COMMAND_MODE: dwb_parse_command_line(GET_TEXT(), true);
return true;
case DOWNLOAD_GET_PATH: download_start();
return true;
@@ -1914,13 +1910,13 @@ dwb_entry_activate(GdkEventKey *e) {
/* dwb_eval_key(GdkEventKey *e) {{{*/
gboolean
dwb_eval_key(GdkEventKey *e) {
- gboolean ret = false;
+ gboolean ret = true, isprint = false;
int keyval = e->keyval;
unsigned int mod_mask;
int keynum = -1;
if (dwb.state.scriptlock) {
- return true;
+ return false;
}
if (e->is_modifier) {
return false;
@@ -1933,12 +1929,8 @@ dwb_eval_key(GdkEventKey *e) {
if (dwb.state.buffer->len > 0) {
g_string_erase(dwb.state.buffer, dwb.state.buffer->len - 1, 1);
dwb_set_status_bar_text(dwb.gui.lstatus, dwb.state.buffer->str, &dwb.color.active_fg, dwb.font.fd_active, false);
- ret = false;
}
- else {
- ret = false;
- }
- return ret;
+ return false;
}
/* Multimedia keys */
switch (keyval) {
@@ -1952,8 +1944,10 @@ dwb_eval_key(GdkEventKey *e) {
char *key = util_keyval_to_char(keyval, true);
if (key) {
mod_mask = CLEAN_STATE(e);
+ isprint = true;
}
- else if ( (key = g_strdup(gdk_keyval_name(keyval)))) {
+ else if ( (key = gdk_keyval_name(keyval))) {
+ key = g_strdup_printf("@%s@", key);
mod_mask = CLEAN_STATE_WITH_SHIFT(e);
}
else {
@@ -1970,11 +1964,12 @@ dwb_eval_key(GdkEventKey *e) {
}
if (mod_mask) {
#define IS_NUMMOD(X) (((X) & DWB_NUMMOD_MASK) && ((X) & ~DWB_NUMMOD_MASK) == mod_mask)
+ GSList *last = g_slist_last(dwb.custom_commands);
for (GSList *l = dwb.custom_commands; l; l=l->next) {
CustomCommand *c = l->data;
if (IS_NUMMOD(c->key->mod) || (c->key->mod == mod_mask && c->key->num == dwb.state.nummod)) {
for (int i=0; c->commands[i]; i++) {
- dwb_parse_command_line(c->commands[i], false);
+ dwb_parse_command_line(c->commands[i], l == last);
}
break;
}
@@ -1990,7 +1985,7 @@ dwb_eval_key(GdkEventKey *e) {
#undef IS_NUMMOD
}
FREE(key);
- return false;
+ return true;
}
g_string_append(dwb.state.buffer, key);
if (ALPHA(e) || DIGIT(e)) {
@@ -2001,11 +1996,12 @@ dwb_eval_key(GdkEventKey *e) {
int longest = 0;
KeyMap *tmp = NULL;
GList *coms = NULL;
+ GSList *last = g_slist_last(dwb.custom_commands);
for (GSList *l = dwb.custom_commands; l; l=l->next) {
CustomCommand *c = l->data;
if (c->key->num == dwb.state.nummod && !g_strcmp0(c->key->str, buf) && c->key->mod == mod_mask) {
for (int i=0; c->commands[i]; i++) {
- dwb_parse_command_line(c->commands[i], false);
+ dwb_parse_command_line(c->commands[i], l == last);
}
return true;
}
@@ -2028,7 +2024,6 @@ dwb_eval_key(GdkEventKey *e) {
if (dwb.comps.autocompletion) {
coms = g_list_append(coms, km);
}
- ret = true;
}
}
/* autocompletion */
@@ -2037,10 +2032,13 @@ dwb_eval_key(GdkEventKey *e) {
}
if (coms && g_list_length(coms) > 0) {
completion_autocomplete(coms, NULL);
- ret = true;
}
if (tmp && dwb.state.buffer->len == longest) {
commands_simple_command(tmp);
+ ret = true;
+ }
+ else if (e->state & GDK_MODIFIER_MASK || !isprint) {
+ ret = false;
}
if (longest == 0) {
dwb_clean_key_buffer();
@@ -2048,14 +2046,11 @@ dwb_eval_key(GdkEventKey *e) {
}
FREE(key);
return ret;
-
}/*}}}*/
/* dwb_insert_mode(Arg *arg) {{{*/
static DwbStatus
dwb_insert_mode(void) {
- if (dwb.state.mode & PASS_THROUGH)
- return STATUS_ERROR;
if (dwb.state.mode == HINT_MODE) {
dwb_set_normal_message(dwb.state.fview, true, INSERT);
}
@@ -2075,14 +2070,6 @@ dwb_command_mode(void) {
return STATUS_OK;
}/*}}}*/
-/* dwb_passthrough_mode () {{{*/
-static DwbStatus
-dwb_passthrough_mode(void) {
- dwb.state.mode |= PASS_THROUGH;
- dwb_set_normal_message(dwb.state.fview, false, "-- PASS THROUGH --");
- return STATUS_OK;
-}/*}}}*/
-
/* dwb_normal_mode() {{{*/
static DwbStatus
dwb_normal_mode(gboolean clean) {
@@ -2127,7 +2114,6 @@ dwb_change_mode(Mode mode, ...) {
break;
case INSERT_MODE: ret = dwb_insert_mode(); break;
case COMMAND_MODE: ret = dwb_command_mode(); break;
- case PASS_THROUGH: ret = dwb_passthrough_mode(); break;
default: PRINT_DEBUG("Unknown mode: %d", mode); break;
}
return ret;
@@ -2380,16 +2366,9 @@ dwb_clean_up() {
dwb_free_custom_keys();
dwb_soup_end();
-#ifdef DWB_ADBLOCKER
adblock_end();
-#endif
-#ifdef DWB_DOMAIN_SERVICE
domain_end();
-#endif
- if (g_file_test(dwb.files.fifo, G_FILE_TEST_EXISTS)) {
- unlink(dwb.files.fifo);
- }
util_rmdir(dwb.files.cachedir, true, true);
gtk_widget_destroy(dwb.gui.window);
return true;
@@ -2558,6 +2537,7 @@ dwb_str_to_key(char *str) {
return key;
g_strstrip(str);
GString *buffer = g_string_new(NULL);
+ GString *keybuffer;
char *end;
char **string = g_strsplit(str, " ", -1);
@@ -2597,7 +2577,19 @@ dwb_str_to_key(char *str) {
g_string_append(buffer, string[i]);
}
}
- key.str = buffer->str;
+ const char *escape, *start = buffer->str;
+ if ((escape = strchr(start, '\\'))) {
+ keybuffer = g_string_new(NULL);
+ do {
+ g_string_append_len(keybuffer, start, escape - start);
+ start = escape + 1;
+ } while ((escape = strchr(start, '\\')));
+ g_string_append_len(keybuffer, start, escape - start);
+ key.str = keybuffer->str;
+ g_string_free(keybuffer, false);
+ }
+ else
+ key.str = buffer->str;
key.num = strtol(buffer->str, &end, 10);
if (end == buffer->str)
key.num = -1;
@@ -3248,7 +3240,7 @@ dwb_init_custom_keys(gboolean reload) {
/* dwb_init() {{{*/
static void
-dwb_init() {
+dwb_init(GSList *exe) {
dwb_clean_vars();
dwb.state.views = NULL;
dwb.state.fview = NULL;
@@ -3285,9 +3277,7 @@ dwb_init() {
dwb_init_scripts();
dwb_init_custom_keys(false);
domain_init();
-#ifdef DWB_ADBLOCKER
adblock_init();
-#endif
dwb_soup_init();
@@ -3302,6 +3292,7 @@ dwb_init() {
else if (!restore || !restore_success) {
view_add(NULL, false);
}
+ /* Compute bar height */
PangoContext *pctx = gtk_widget_get_pango_context(VIEW(dwb.state.fview)->tablabel);
PangoLayout *layout = pango_layout_new(pctx);
int w = 0, h = 0;
@@ -3312,29 +3303,35 @@ dwb_init() {
dwb_pack(GET_CHAR("widget-packing"), false);
gtk_widget_set_size_request(dwb.gui.entry, -1, dwb.misc.bar_height);
g_object_unref(layout);
+
+ /* commands */
+ if (exe != NULL) {
+ for (GSList *l = exe; l; l=l->next) {
+ dwb_parse_commands(exe->data);
+ }
+ }
} /*}}}*/ /*}}}*/
/* FIFO {{{*/
/* dwb_parse_command_line(const char *line) {{{*/
void
dwb_parse_command_line(const char *line, gboolean clear) {
- while (g_ascii_isspace(*line))
- line++;
- char **token = g_strsplit(line, " ", 2);
+ const char *bak;
+ int nummod;
+ line = util_str_chug(line);
+ bak = dwb_parse_nummod(line);
+ nummod = dwb.state.nummod;
+ char **token = g_strsplit(bak, " ", 2);
KeyMap *m = NULL;
gboolean found;
- int nummod;
if (!token[0])
return;
- const char *bak;
for (GList *l = dwb.keymap; l; l=l->next) {
bak = token[0];
found = false;
m = l->data;
- bak = dwb_parse_nummod(bak);
- nummod = dwb.state.nummod;
if (!g_strcmp0(m->map->n.first, bak))
found = true;
else {
@@ -3369,6 +3366,14 @@ dwb_parse_command_line(const char *line, gboolean clear) {
dwb_change_mode(NORMAL_MODE, clear);
}
}/*}}}*/
+static void
+dwb_parse_commands(const char *line) {
+ char **commands = g_strsplit(util_str_chug(line), ";", -1);
+ for (int i=0; commands[i]; i++) {
+ dwb_parse_command_line(commands[i], commands[i+1] == NULL);
+ }
+ g_strfreev(commands);
+}
/* dwb_handle_channel {{{*/
static gboolean
@@ -3378,7 +3383,7 @@ dwb_handle_channel(GIOChannel *c, GIOCondition condition, void *data) {
g_io_channel_read_line(c, &line, NULL, NULL, NULL);
if (line) {
g_strstrip(line);
- dwb_parse_command_line(line, false);
+ dwb_parse_commands(line);
g_io_channel_flush(c, NULL);
g_free(line);
}
@@ -3387,7 +3392,7 @@ dwb_handle_channel(GIOChannel *c, GIOCondition condition, void *data) {
/* dwb_init_fifo{{{*/
static void
-dwb_init_fifo(gboolean single) {
+dwb_init_fifo(gboolean single, GSList *exe) {
FILE *ff;
/* Files */
@@ -3399,51 +3404,39 @@ dwb_init_fifo(gboolean single) {
FREE(path);
return;
}
-
if (GET_BOOL("single-instance")) {
if (!g_file_test(dwb.files.unifile, G_FILE_TEST_EXISTS)) {
mkfifo(dwb.files.unifile, 0666);
}
int fd = open(dwb.files.unifile, O_WRONLY | O_NONBLOCK);
- if ( (ff = fdopen(fd, "w")) ) {
- if (dwb.misc.argc) {
+ if ((dwb.misc.argc > 0 || exe != NULL)) {
+ if ( (ff = fdopen(fd, "w")) ) {
for (int i=0; i<dwb.misc.argc; i++) {
if (g_file_test(dwb.misc.argv[i], G_FILE_TEST_EXISTS) && !g_path_is_absolute(dwb.misc.argv[i])) {
char *curr_dir = g_get_current_dir();
path = g_build_filename(curr_dir, dwb.misc.argv[i], NULL);
- fprintf(ff, "add_view %s\n", path);
+ fprintf(ff, "tabopen %s\n", path);
FREE(curr_dir);
FREE(path);
}
else {
- fprintf(ff, "add_view %s\n", dwb.misc.argv[i]);
+ fprintf(ff, "tabopen %s\n", dwb.misc.argv[i]);
}
}
+ if (exe != NULL) {
+ for (GSList *l = exe; l; l=l->next) {
+ fprintf(ff, "%s\n", (char *)l->data);
+ }
+ }
+ fclose(ff);
+ exit(EXIT_SUCCESS);
}
- else {
- fprintf(ff, "add_view\n");
- }
- fclose(ff);
- exit(EXIT_SUCCESS);
}
close(fd);
dwb_open_si_channel();
}
-
- /* fifo */
- if (GET_BOOL("use-fifo")) {
- char *filename = g_strdup_printf("%s-%d.fifo", dwb.misc.name, getpid());
- dwb.files.fifo = g_build_filename(path, filename, NULL);
- FREE(filename);
-
- if (!g_file_test(dwb.files.fifo, G_FILE_TEST_EXISTS)) {
- mkfifo(dwb.files.fifo, 0600);
- }
- dwb_open_channel(dwb.files.fifo);
- }
-
FREE(path);
}/*}}}*/
/*}}}*/
@@ -3459,6 +3452,7 @@ main(int argc, char *argv[]) {
int last = 0;
gboolean single = false;
int argr = argc;
+ GSList *exe = NULL;
gtk_init(&argc, &argv);
@@ -3482,6 +3476,9 @@ main(int argc, char *argv[]) {
else if (argv[i][1] == 'e' && argv[i+1]) {
dwb.gui.wid = strtol(argv[++i], NULL, 10);
}
+ else if (argv[i][1] == 'x' && argv[i+1]) {
+ exe = g_slist_append(exe, argv[++i]);
+ }
else if (argv[i][1] == 'r' ) {
if (!argv[i+1] || argv[i+1][0] == '-') {
restore = "default";
@@ -3509,14 +3506,13 @@ main(int argc, char *argv[]) {
if (GET_BOOL("save-session") && argr == 1 && !restore && !single) {
restore = "default";
}
-
if (last) {
dwb.misc.argv = &argv[last];
dwb.misc.argc = g_strv_length(dwb.misc.argv);
}
- dwb_init_fifo(single);
+ dwb_init_fifo(single, exe);
dwb_init_signals();
- dwb_init();
+ dwb_init(exe);
gtk_main();
return EXIT_SUCCESS;
}/*}}}*/
diff --git a/src/dwb.h b/src/dwb.h
index 7e3efe82..35bb3032 100644
--- a/src/dwb.h
+++ b/src/dwb.h
@@ -282,7 +282,6 @@ typedef enum {
COMPLETE_BUFFER = 1<<17,
COMPLETE_QUICKMARKS = 1<<18,
COMPLETE_COMMAND_MODE = 1<<19,
- PASS_THROUGH = 1<<20,
CONFIRM = 1<<21,
} Mode;
@@ -375,11 +374,9 @@ enum Signal {
SIG_TAB_BUTTON_PRESS,
SIG_POPULATE_POPUP,
SIG_FRAME_CREATED,
-#ifdef DWB_ADBLOCKER
SIG_AD_LOAD_STATUS,
SIG_AD_FRAME_CREATED,
SIG_AD_RESOURCE_REQUEST,
-#endif
SIG_PLUGINS_LOAD,
SIG_PLUGINS_FRAME_LOAD,
@@ -672,7 +669,6 @@ struct _Files {
const char *cookies_allow;
const char *cookies_session_allow;
const char *download_path;
- const char *fifo;
const char *history;
const char *keys;
const char *mimetypes;
@@ -767,7 +763,7 @@ void dwb_save_searchengine(void);
char * dwb_execute_script(WebKitWebFrame *, const char *, gboolean);
void dwb_toggle_tabbar(void);
DwbStatus dwb_history(Arg *a);
-void dwb_reload(void);
+void dwb_reload(GList *gl);
DwbStatus dwb_history_back(void);
DwbStatus dwb_history_forward(void);
void dwb_scroll(GList *, double, ScrollDirection);
@@ -825,9 +821,7 @@ void dwb_open_quickmark(const char *);
gboolean dwb_update_find_quickmark(const char *text);
gboolean dwb_entry_activate(GdkEventKey *e);
-#ifdef DWB_ADBLOCKER
void dwb_set_adblock(GList *, WebSettings *);
-#endif
gboolean dwb_eval_key(GdkEventKey *);
void dwb_follow_selection(void);
diff --git a/src/soup.c b/src/soup.c
index a21d9e10..0962ec1f 100644
--- a/src/soup.c
+++ b/src/soup.c
@@ -63,7 +63,7 @@ dwb_soup_allow_cookie_tmp() {
}
FREE0(last_cookies->data);
g_slist_free(last_cookies);
- dwb_reload();
+ dwb_reload(dwb.state.fview);
}
DwbStatus
@@ -111,7 +111,7 @@ dwb_soup_allow_cookie(GList **whitelist, const char *filename, CookieStorePolicy
/* soup_cookie_jar_add_cookie steals the cookie, it must no be freed */
g_slist_free(allowed);
- dwb_reload();
+ dwb_reload(dwb.state.fview);
g_slist_free(asked);
soup_cookies_free(last_cookies);
return ret;
diff --git a/src/view.c b/src/view.c
index 5397c253..a63eb42c 100644
--- a/src/view.c
+++ b/src/view.c
@@ -29,9 +29,7 @@
#include "plugins.h"
#include "local.h"
#include "soup.h"
-#ifdef DWB_ADBLOCKER
#include "adblock.h"
-#endif
static void view_ssl_state(GList *);
static const char *dummy_icon[] = { "1 1 1 1 ", " c black", " ", };
@@ -220,7 +218,7 @@ view_console_message_cb(WebKitWebView *web, char *message, int line, char *sourc
static WebKitWebView *
view_create_web_view_cb(WebKitWebView *web, WebKitWebFrame *frame, GList *gl) {
if (dwb.misc.tabbed_browsing) {
- GList *gl = view_add(NULL, false);
+ GList *gl = view_add(NULL, dwb.state.background_tabs);
return WEBVIEW(gl);
}
else {
@@ -916,7 +914,6 @@ view_add(const char *uri, gboolean background) {
}
View *v = view_create_web_view();
gtk_box_pack_end(GTK_BOX(dwb.gui.topbox), v->tabevent, true, true, 0);
- //if ((dwb.state.layout & MAXIMIZED || background) && dwb.state.fview) {
if (dwb.state.fview) {
int p = g_list_position(dwb.state.views, dwb.state.fview) + 1;
gtk_box_reorder_child(GTK_BOX(dwb.gui.topbox), v->tabevent, g_list_length(dwb.state.views) - p);
@@ -944,10 +941,8 @@ view_add(const char *uri, gboolean background) {
view_init_signals(ret);
view_init_settings(ret);
-#ifdef DWB_ADBLOCKER
if (GET_BOOL("adblocker"))
adblock_connect(ret);
-#endif
dwb_update_layout();
if (uri != NULL) {
diff --git a/util/keys.in b/util/keys.in
index 7f45228e..0c235f74 100644
--- a/util/keys.in
+++ b/util/keys.in
@@ -1,25 +1,24 @@
# general General
open Open url
-Open Open url, edit the current url in the address bar
-open_nv Open in a new tab
-Open_nv Open url in a new view, edit the current url in the address bar
-open_nw Open url in a new window
-Open_nw Open url in a new window, edit the current url in the address bar
+open_url Open url, edit the current url in the address bar
+tabopen Open in a new tab
+tabopen_url Open url in a new tab, edit the current url in the address bar
+winopen Open url in a new window
+winopen_url Open url in a new window, edit the current url in the address bar
find_backward Find backward
find_forward Find forward
find_next Find next
find_previous Find previous
history_back Go back
history_forward Go forward
-history_back_nv Go back in a new tab
-history_forward_nv Go forward in a new tab
-history_back_nw Go back in a new tab
-history_forward_nw Go forward in a new tab
+tab_hist_back Go back in a new tab
+tab_hist_forward Go forward in a new tab
+win_hist_back Go back in a new window
+win_hist_forward Go forward in a new window
reload Reload current page
reload_bypass_cache Reload without using any cached data
stop_loading Stop loading current page
insert_mode Insert mode
-pass_through Go in pass-through mode, all keys are directly send to the webview
view_source View page source
zoom_in Zoom in
zoom_out Zoom out
@@ -27,31 +26,31 @@ zoom Zoom
quit Quit dwb
# hints Hints
-hint_mode Follow hints
-hint_mode_nv Follow hints, open link in a new view
-hint_mode_nw Follow hints, open link in a new window
-hint_mode_links Follow links
-hint_mode_images Follow images
-hint_mode_images_nv Follow images in a new tab
-hint_mode_editable Focus editable elements
-hint_mode_url Set hint's url in commandline
-hint_mode_url_nv Set hint's url in commandline, open in a new tab
-hint_mode_download Download via hints
-hint_mode_clipboard Save link location to clipboard
-hint_mode_primary Save link location to primary selection
-hint_mode_rapid Open new tabs in background rapidly
-hint_mode_rapid_nw Open new windows rapidly
+hints Follow hints
+hints_tab Follow hints, open link in a new tab
+hints_win Follow hints, open link in a new window
+hints_links Follow links
+hints_images Follow images
+hints_images_tab Follow images in a new tab
+hints_editable Focus editable elements
+hints_url Set hint's url in commandline
+hints_url_tab Set hint's url in commandline, open in a new tab
+hints_download Download via hints
+hints_clipboard Save link location to clipboard
+hints_primary Save link location to primary selection
+hints_rapid Open new tabs in background rapidly
+hints_rapid_win Open new windows rapidly
# bookmark_keys Bookmarks &amp Quickmarks
bookmark Bookmark current page
bookmarks Show bookmarks in a pop up menu and open
-bookmarks_nv Show bookmarks in a pop up menu and open in new view
-bookmarks_nw Show bookmarks in a pop up menu and open in new window
+tab_bookmarks Show bookmarks in a pop up menu and open in new tab
+win_bookmarks Show bookmarks in a pop up menu and open in new window
save_quickmark Save a quickmark for this page
-open_quickmark Open a quickmark
-open_quickmark_nv Open quickmark in a new tab
-open_quickmark_nw Open quickmark in a new window
-open_start_page Open the default homepage
+quickmark Open a quickmark
+tab_quickmark Open quickmark in a new tab
+win_quickmark Open quickmark in a new window
+start_page Open the default homepage
# commandline Commandline
command_mode Enter command mode
@@ -77,26 +76,21 @@ scroll_halfpage_down Scroll one-half page down
scroll_halfpage_up Scroll one-half page up
scroll_bottom Scroll to bottom of the page
scroll_top Scroll to the top of the page
-scroll_percent Scroll to percentage
# tabs Tabs &amp UI
-add_view Add a new view
-remove_view Close view
+tab_new Open a new blank tab
+close_tab Close tab
only Close all tabs except for the current one
undo Undo closing last tab
-decrease_master Decrease master area
-increase_master Increase master area
-focus_next Focus next view
-focus_nth_view Focus nth view
-focus_prev Focus previous view
+focus_next Focus next tab
+focus_tab Focus nth tab
+focus_prev Focus previous tab
lock_domain Lock tab to current domain
lock_uri Lock tab to current uri
-push_master Push to master area
-toggle_bottomstack Toggle bottomstack
fullscreen Toggle fullscreen
toggle_bars Toggle tabbar and statusbar
-toggle_bottombar Toggle bottombar
-toggle_topbar Toggle tabbar
+toggle_statusbar Toggle statusbar
+toggle_tabbar Toggle tabbar
protect Protect/unprotect tab
presentation_mode Toggle presentation mode
visible Toggle visibility of a tab
@@ -105,7 +99,6 @@ visible Toggle visibility of a tab
buffers Show all open tabs
complete_bookmarks Complete bookmarks
complete_history Complete browsing history
-complete_commands Complete command history
complete_path Complete local file path
complete_searchengines Complete searchengines
complete_userscript Complete userscripts
@@ -113,11 +106,11 @@ complete_current_history Complete history of the current tab
# clipboard Clipboard
paste Open url from clipboard
-paste_nv Open url from clipboard in a new tab
-paste_nw Open url from clipboard in a new window
+tab_paste Open url from clipboard in a new tab
+win_paste Open url from clipboard in a new window
paste_primary Open url from primary selection
-paste_primary_nw Open url from primary selection in a new window
-paste_primary_nv Open url from primary selection in a new window
+tab_paste_primary Open url from primary selection in a new window
+win_paste_primary Open url from primary selection in a new window
yank Yank current url to clipboard
yank_primary Yank current url to primary selection
yank_title Yank current title to clipboard
@@ -136,9 +129,6 @@ toggle_scripts_host Toggle block content for current domain
toggle_scripts_uri Toggle block content for current uri
toggle_scripts_host_tmp Toggle block content for current domain for this session
toggle_scripts_uri_tmp Toggle block content for current uri for this session
-private_browsing Toggle private browsing
-java_applets Toggle java applets
-plugins Toggle 'enable-plugins'
proxy Toggle proxy
# misc Miscellaneous
@@ -147,8 +137,8 @@ allow_session_cookie Allow session cookies for current site
allow_session_cookie_tmp Allow session cookies for current site temporarily
execute_userscript Execute userscript
focus_input Focus the next input
-new_view New view for next navigation
-new_window New window for next navigation
+new_tab New tab for next navigation
+new_win New window for next navigation
web_inspector Open the webinspector
open_editor Open an external editor for current input/textarea.
print Print current page
diff --git a/util/settings.in b/util/settings.in
index f74c58b6..a9074b9c 100644
--- a/util/settings.in
+++ b/util/settings.in
@@ -135,4 +135,3 @@ navigation-history-max Length of the navigation history
print-backgrounds checkbox Whether background images should be printed
sync-history text Interval to save history to disk, 0 means save immediately
tab-key-cycles-through-elements checkbox Tab cycles through elements in insert mode
-use-fifo checkbox Create a fifo for communication