dotfiles

Dotfiles for my OpenBSD environment.
git clone https://git.mtkn.jp/dotfiles
Log | Files | Refs

surf-playexternal-20190724-b814567.diff (1572B)


      1 From 95e17b5bd428173c83e60cec9cd5666cfe9066fa Mon Sep 17 00:00:00 2001
      2 From: DanMan <dnahimov@gmail.com>
      3 Date: Wed, 24 Jul 2019 18:47:46 -0400
      4 Subject: [PATCH] added playexternal hotkey function
      5 
      6 ---
      7  config.def.h |  2 ++
      8  surf.c       | 10 ++++++++++
      9  2 files changed, 12 insertions(+)
     10 
     11 diff --git a/config.def.h b/config.def.h
     12 index 6d3135e..5fa0d9d 100644
     13 --- a/config.def.h
     14 +++ b/config.def.h
     15 @@ -105,6 +105,8 @@ static Key keys[] = {
     16  	{ MODKEY,                GDK_KEY_f,      spawn,      SETPROP("_SURF_FIND", "_SURF_FIND") },
     17  	{ MODKEY,                GDK_KEY_slash,  spawn,      SETPROP("_SURF_FIND", "_SURF_FIND") },
     18  
     19 +	{ MODKEY,                GDK_KEY_w,      playexternal, { 0 } },
     20 +
     21  	{ 0,                     GDK_KEY_Escape, stop,       { 0 } },
     22  	{ MODKEY,                GDK_KEY_c,      stop,       { 0 } },
     23  
     24 diff --git a/surf.c b/surf.c
     25 index 93a1629..e74e9df 100644
     26 --- a/surf.c
     27 +++ b/surf.c
     28 @@ -217,6 +217,7 @@ static void togglefullscreen(Client *c, const Arg *a);
     29  static void togglecookiepolicy(Client *c, const Arg *a);
     30  static void toggleinspector(Client *c, const Arg *a);
     31  static void find(Client *c, const Arg *a);
     32 +static void playexternal(Client *c, const Arg *a);
     33  
     34  /* Buttons */
     35  static void clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h);
     36 @@ -1648,6 +1649,15 @@ clickexternplayer(Client *c, const Arg *a, WebKitHitTestResult *h)
     37  	spawn(c, &arg);
     38  }
     39  
     40 +void
     41 +playexternal(Client *c, const Arg *a)
     42 +{
     43 +	Arg arg;
     44 +
     45 +	arg = (Arg)VIDEOPLAY(geturi(c));
     46 +	spawn(c, &arg);
     47 +}
     48 +
     49  int
     50  main(int argc, char *argv[])
     51  {
     52 -- 
     53 2.22.0
     54