applied play external
authorDaniel Liu <mr.picklepinosaur@gmail.com>
Sat, 9 Jan 2021 18:27:52 +0000 (13:27 -0500)
committerDaniel Liu <mr.picklepinosaur@gmail.com>
Sat, 9 Jan 2021 18:27:52 +0000 (13:27 -0500)
config.def.h
surf.c

index 4ef4252..13fc1bc 100644 (file)
@@ -154,6 +154,8 @@ static Key keys[] = {
        { MODKEY,                GDK_KEY_slash,  spawn,      SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
        { MODKEY,                GDK_KEY_m,      spawn,      BM_ADD("_SURF_URI") },
 
        { MODKEY,                GDK_KEY_slash,  spawn,      SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
        { MODKEY,                GDK_KEY_m,      spawn,      BM_ADD("_SURF_URI") },
 
+       { MODKEY,                GDK_KEY_w,      playexternal, { 0 } },
+
        { 0,                     GDK_KEY_Escape, stop,       { 0 } },
        { MODKEY,                GDK_KEY_c,      stop,       { 0 } },
 
        { 0,                     GDK_KEY_Escape, stop,       { 0 } },
        { MODKEY,                GDK_KEY_c,      stop,       { 0 } },
 
diff --git a/surf.c b/surf.c
index a9da587..4520daa 100644 (file)
--- a/surf.c
+++ b/surf.c
@@ -238,6 +238,7 @@ static void togglefullscreen(Client *c, const Arg *a);
 static void togglecookiepolicy(Client *c, const Arg *a);
 static void toggleinspector(Client *c, const Arg *a);
 static void find(Client *c, const Arg *a);
 static void togglecookiepolicy(Client *c, const Arg *a);
 static void toggleinspector(Client *c, const Arg *a);
 static void find(Client *c, const Arg *a);
+static void playexternal(Client *c, const Arg *a);
 
 /* Buttons */
 static void clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h);
 
 /* Buttons */
 static void clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h);
@@ -1994,6 +1995,15 @@ clickexternplayer(Client *c, const Arg *a, WebKitHitTestResult *h)
        spawn(c, &arg);
 }
 
        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[])
 {
 int
 main(int argc, char *argv[])
 {