summaryrefslogtreecommitdiff
path: root/surf/patches/surf-playexternal-20190724-b814567.diff
blob: 5c10b097e870aa53b15c2ca2b911870a54197875 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From 95e17b5bd428173c83e60cec9cd5666cfe9066fa Mon Sep 17 00:00:00 2001
From: DanMan <dnahimov@gmail.com>
Date: Wed, 24 Jul 2019 18:47:46 -0400
Subject: [PATCH] added playexternal hotkey function

---
 config.def.h |  2 ++
 surf.c       | 10 ++++++++++
 2 files changed, 12 insertions(+)

diff --git a/config.def.h b/config.def.h
index 6d3135e..5fa0d9d 100644
--- a/config.def.h
+++ b/config.def.h
@@ -105,6 +105,8 @@ static Key keys[] = {
 	{ MODKEY,                GDK_KEY_f,      spawn,      SETPROP("_SURF_FIND", "_SURF_FIND") },
 	{ MODKEY,                GDK_KEY_slash,  spawn,      SETPROP("_SURF_FIND", "_SURF_FIND") },
 
+	{ 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 93a1629..e74e9df 100644
--- a/surf.c
+++ b/surf.c
@@ -217,6 +217,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 playexternal(Client *c, const Arg *a);
 
 /* Buttons */
 static void clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h);
@@ -1648,6 +1649,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[])
 {
-- 
2.22.0