tAdd binding for opening page source in EDITOR - surf - [fork] customized build… | |
git clone git://src.adamsgaard.dk/surf | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit d7065de5b1fe02200121c9229cd3e1574d77c064 | |
parent 38862af8c02916e76535ac6bfc729e13358de7d5 | |
Author: Anders Damsgaard <[email protected]> | |
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(-) | |
--- | |
diff --git a/config.h b/config.h | |
t@@ -137,6 +137,16 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_C… | |
} \ | |
} | |
+/* BOOKMARK(URI) */ | |
+#define EDITSRC(r) {\ | |
+ .v = (const char *[]){ "st", "-e", "/bin/sh", "-c", \ | |
+ "f=\"$(mktemp)\" && " \ | |
+ "hurl \"$(echo $(xprop -id $0 $1) | cut -d '\"' -f2)\"… | |
+ "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("_SUR… | |
+ { MODKEY, GDK_KEY_e, spawn, EDITSRC("_SURF_UR… | |
{ MODKEY, GDK_KEY_space, scrollv, { .i = +50 } }, | |
{ MODKEY, GDK_KEY_d, scrollv, { .i = +50 } }, | |
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_d, scrollv, { .i = +100 } }, |