summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2019-09-06 23:37:30 +0200
committerbakkeby <[email protected]>2019-09-06 23:37:30 +0200
commit611460c6a6d72876d306e54bdba475d0e7f19676 (patch)
tree0adbc007f1007f40611c91f86d418e7daa0932e3
parent04a7b4de407480089e575b0047d6998ccc001791 (diff)
downloaddwm-flexipatch-611460c6a6d72876d306e54bdba475d0e7f19676.tar.gz
dwm-flexipatch-611460c6a6d72876d306e54bdba475d0e7f19676.zip
Adding autostart patch
-rw-r--r--README.md5
-rw-r--r--dwm.c3
-rw-r--r--patch/autostart.c10
-rw-r--r--patch/autostart.h1
-rw-r--r--patch/include.c4
-rw-r--r--patch/include.h4
-rw-r--r--patches.h14
7 files changed, 37 insertions, 4 deletions
diff --git a/README.md b/README.md
index da7ede7..76a150b 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
### Changelog:
-2019-09-06 - Added attachabove, attachaside, attachbelow and attachbottom patches
+2019-09-06 - Added attachabove, attachaside, attachbelow, attachbottom and autostart patches
2019-09-05 - Alpha, systray, togglefullscreen, tagallmon, tagmonfixfs, tagswapmon, pertag and zoomswap patches added
@@ -32,6 +32,9 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
- [attachbottom](https://dwm.suckless.org/patches/attachbottom/)
- new windows are placed at the bottom of the stack
+ - [autostart](https://dwm.suckless.org/patches/autostart/)
+ - makes dwm run `~/.dwm/autostart_blocking.sh` and `~/.dwm/autostart.sh &` on startup
+
- [pertag](https://dwm.suckless.org/patches/pertag/)
- adds nmaster, mfact, layouts and more per tag rather than per monitor
diff --git a/dwm.c b/dwm.c
index 2c379c2..62f6274 100644
--- a/dwm.c
+++ b/dwm.c
@@ -2614,6 +2614,9 @@ main(int argc, char *argv[])
die("pledge");
#endif /* __OpenBSD__ */
scan();
+ #if AUTOSTART_PATCH
+ runAutostart();
+ #endif
run();
cleanup();
XCloseDisplay(dpy);
diff --git a/patch/autostart.c b/patch/autostart.c
new file mode 100644
index 0000000..c61ea7f
--- /dev/null
+++ b/patch/autostart.c
@@ -0,0 +1,10 @@
+void
+runAutostart(void) {
+
+ int ret;
+
+ ret = system("cd ~/.config/dwm; ./autostart_blocking.sh");
+ ret = system("cd ~/.config/dwm; ./autostart.sh &");
+
+ if (ret); // ignore, hide compilation warnings
+} \ No newline at end of file
diff --git a/patch/autostart.h b/patch/autostart.h
new file mode 100644
index 0000000..6058a3d
--- /dev/null
+++ b/patch/autostart.h
@@ -0,0 +1 @@
+static void runAutostart(void); \ No newline at end of file
diff --git a/patch/include.c b/patch/include.c
index ebf5e3c..fa6c20b 100644
--- a/patch/include.c
+++ b/patch/include.c
@@ -6,6 +6,10 @@
#include "attachx.c"
#endif
+#if AUTOSTART_PATCH
+#include "autostart.c"
+#endif
+
#if PERTAG_PATCH
#include "pertag.c"
#endif
diff --git a/patch/include.h b/patch/include.h
index 29785e1..295ee77 100644
--- a/patch/include.h
+++ b/patch/include.h
@@ -6,6 +6,10 @@
#include "attachx.h"
#endif
+#if AUTOSTART_PATCH
+#include "autostart.h"
+#endif
+
#if SYSTRAY_PATCH
#include "systray.h"
#endif
diff --git a/patches.h b/patches.h
index 60e3801..9ebacb1 100644
--- a/patches.h
+++ b/patches.h
@@ -36,10 +36,13 @@
*/
#define ATTACHBOTTOM_PATCH 0
-/* The systray patch adds systray for the status bar.
- * https://dwm.suckless.org/patches/systray/
+/* This patch will make dwm run "~/.config/dwm/autostart_blocking.sh" and
+ * "~/.config/dwm/autostart.sh &" before entering the handler loop. One or
+ * both of these files can be ommited. Note the path inside .config rather
+ * than the original ~/.dwm folder.
+ * https://dwm.suckless.org/patches/autostart/
*/
-#define SYSTRAY_PATCH 0
+#define AUTOSTART_PATCH 0
/* The pertag patch adds nmaster, mfacts and layouts per tag rather
* than per monitor (default).
@@ -52,6 +55,11 @@
*/
#define PERTAGBAR_PATCH 0
+/* The systray patch adds systray for the status bar.
+ * https://dwm.suckless.org/patches/systray/
+ */
+#define SYSTRAY_PATCH 0
+
/* This patch allows you to move all visible windows on a monitor to an adjacent monitor.
* https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-tagallmon-6.2.diff
*/