commit ab205c9f4bbf6defb9308a352251ceae22d68b67
Author: Michael Hendricks <[email protected]>
Date:   Tue May 22 14:13:28 2018 -0600

    [dwm] clean up fifo patch
    
      * remove unused #include
      * consistently use tab for indentation
      * accept trailing newline in commands
      * add "quit" command
    
    Since the new patch allows trailing newlines in commands, I also
    cleaned up index.md to remove echo's -n option.

diff --git a/dwm.suckless.org/patches/dwmfifo/dwm-dwmfifo-6.1.diff 
b/dwm.suckless.org/patches/dwmfifo/dwm-dwmfifo-6.1.diff
index 76adc198..a73f4952 100644
--- a/dwm.suckless.org/patches/dwmfifo/dwm-dwmfifo-6.1.diff
+++ b/dwm.suckless.org/patches/dwmfifo/dwm-dwmfifo-6.1.diff
@@ -2,7 +2,7 @@ diff --git a/config.def.h b/config.def.h
 index 7054c06..9f4ef79 100644
 --- a/config.def.h
 +++ b/config.def.h
-@@ -111,3 +111,65 @@ static Button buttons[] = {
+@@ -111,3 +111,66 @@ static Button buttons[] = {
        { ClkTagBar,            MODKEY,         Button3,        toggletag,      
{0} },
  };
  
@@ -10,6 +10,7 @@ index 7054c06..9f4ef79 100644
 +static Command commands[] = {
 +      { "dmenu",           spawn,          {.v = dmenucmd} },
 +      { "term",            spawn,          {.v = termcmd} },
++      { "quit",            quit,           {0} },
 +      { "togglebar",       togglebar,      {0} },
 +      { "focusstack+",     focusstack,     {.i = +1} },
 +      { "focusstack-",     focusstack,     {.i = -1} },
@@ -80,12 +81,11 @@ index 0362114..5c45d2a 100644
  #include <locale.h>
  #include <signal.h>
  #include <stdarg.h>
-@@ -28,6 +29,8 @@
+@@ -28,6 +29,7 @@
  #include <stdlib.h>
  #include <string.h>
  #include <unistd.h>
 +#include <sys/select.h>
-+#include <sys/stat.h>
  #include <sys/types.h>
  #include <sys/wait.h>
  #include <X11/cursorfont.h>
@@ -130,32 +130,33 @@ index 0362114..5c45d2a 100644
  }
  
  void
-@@ -702,6 +715,25 @@ dirtomon(int dir)
+@@ -701,6 +714,26 @@ dirtomon(int dir)
+       return m;
  }
  
- void
++void
 +dispatchcmd(void)
 +{
-+       int i;
-+       char buf[BUFSIZ];
-+       ssize_t n;
++      int i;
++      char buf[BUFSIZ];
++      ssize_t n;
 +
-+       n = read(fifofd, buf, sizeof(buf) - 1);
-+       if (n == -1)
-+               die("Failed to read() from DWM fifo %s:", dwmfifo);
-+       buf[n] = '

Reply via email to