From 2671aaeee6145fedf541e714fb06f32a48fdf009 Mon Sep 17 00:00:00 2001 From: Rafael Marçalo Date: Wed, 29 Nov 2023 17:41:39 +0000 Subject: Play external patch --- config.def.h | 2 ++ surf.c | 10 ++++++++++ 2 files changed, 12 insertions(+) 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[]) { -- cgit v1.2.3