[wiki] [sites] [dwm] clean up fifo patch || Michael Hendricks
commit ab205c9f4bbf6defb9308a352251ceae22d68b67
Author: Michael Hendricks <michael_AT_ndrix.org>
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
_AT_@ -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
-_AT_@ -111,3 +111,65 @@ static Button buttons[] = {
+_AT_@ -111,3 +111,66 @@ static Button buttons[] = {
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};
_AT_@ -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} },
_AT_@ -80,12 +81,11 @@ index 0362114..5c45d2a 100644
#include <locale.h>
#include <signal.h>
#include <stdarg.h>
-_AT_@ -28,6 +29,8 @@
+_AT_@ -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>
_AT_@ -130,32 +130,33 @@ index 0362114..5c45d2a 100644
}
void
-_AT_@ -702,6 +715,25 @@ dirtomon(int dir)
+_AT_@ -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] = '
Received on Tue May 22 2018 - 22:22:18 CEST
This archive was generated by hypermail 2.3.0
: Tue May 22 2018 - 22:24:22 CEST