tAdd binding for opening page source in EDITOR - surf - [fork] customized build of surf, the suckless webkit browser
(HTM) git clone git://src.adamsgaard.dk/surf
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit d7065de5b1fe02200121c9229cd3e1574d77c064
(DIR) parent 38862af8c02916e76535ac6bfc729e13358de7d5
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Thu, 2 Jul 2020 07:10:20 +0200
Add binding for opening page source in EDITOR
Diffstat:
M config.h | 11 +++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/config.h b/config.h
t@@ -137,6 +137,16 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
} \
}
+/* BOOKMARK(URI) */
+#define EDITSRC(r) {\
+ .v = (const char *[]){ "st", "-e", "/bin/sh", "-c", \
+ "f=\"$(mktemp)\" && " \
+ "hurl \"$(echo $(xprop -id $0 $1) | cut -d '\"' -f2)\" > \"$f\" && " \
+ "tmux new-session \"$EDITOR $f\" ", \
+ winid, r, NULL \
+ } \
+}
+
/* styles */
/*
* The iteration will stop at the first match, beginning at the beginning of
t@@ -182,6 +192,7 @@ static Key keys[] = {
{ MODKEY, GDK_KEY_j, scrollv, { .i = +10 } },
{ MODKEY, GDK_KEY_k, scrollv, { .i = -10 } },
{ MODKEY, GDK_KEY_b, spawn, BOOKMARKURI("_SURF_URI") },
+ { MODKEY, GDK_KEY_e, spawn, EDITSRC("_SURF_URI") },
{ MODKEY, GDK_KEY_space, scrollv, { .i = +50 } },
{ MODKEY, GDK_KEY_d, scrollv, { .i = +50 } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_d, scrollv, { .i = +100 } },