summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Marçalo <raroma09@gmail.com>2023-11-29 17:41:39 +0000
committerRafael Marçalo <raroma09@gmail.com>2023-11-29 17:41:39 +0000
commit2671aaeee6145fedf541e714fb06f32a48fdf009 (patch)
treedf09ecef815e909062262f345fa999c44af9887d
parent6db79a5ca7432ce6ed9130211260b198a2257169 (diff)
Play external patch
-rw-r--r--config.def.h2
-rw-r--r--surf.c10
2 files changed, 12 insertions, 0 deletions
diff --git a/config.def.h b/config.def.h
index f08fa1e..9cb0177 100644
--- a/config.def.h
+++ b/config.def.h
@@ -151,6 +151,8 @@ static Key keys[] = {
{ MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
{ MODKEY, GDK_KEY_s, spawn, SEARCH("_SURF_SEARCH", PROMPT_SEARCH) },
+ { MODKEY, GDK_KEY_w, playexternal, { 0 } },
+
{ 0, GDK_KEY_Escape, stop, { 0 } },
{ MODKEY, GDK_KEY_c, stop, { 0 } },
diff --git a/surf.c b/surf.c
index d780657..28331d5 100644
--- a/surf.c
+++ b/surf.c
@@ -241,6 +241,7 @@ static void toggleinspector(Client *c, const Arg *a);
static void toggletitle(Client *c, const Arg *a);
static void find(Client *c, const Arg *a);
static void search(Client *c, const Arg *a);
+static void playexternal(Client *c, const Arg *a);
/* Buttons */
static void clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h);
@@ -2063,6 +2064,15 @@ clickexternplayer(Client *c, const Arg *a, WebKitHitTestResult *h)
spawn(c, &arg);
}
+void
+playexternal(Client *c, const Arg *a)
+{
+ Arg arg;
+
+ arg = (Arg)VIDEOPLAY(geturi(c));
+ spawn(c, &arg);
+}
+
int
main(int argc, char *argv[])
{