1. Paul Barbu - Gheorghe
  2. dwm-patches

Source

dwm-patches / selfrestart

# HG changeset patch
# Parent b9e057051bf2467498652bcf4e75a76964617fd6
Eliminated redundancy from the self restart function

diff -r b9e057051bf2 config.def.h
--- a/config.def.h	Fri Nov 16 18:45:21 2012 +0200
+++ b/config.def.h	Sat Nov 17 00:24:28 2012 +0200
@@ -1,5 +1,17 @@
 /* See LICENSE file for copyright and license details. */
 
+/**
+ * self-restart
+ *
+ * Inspired by: Yu-Jie Lin
+ * https://sites.google.com/site/yjlnotes/notes/dwm
+ */
+void
+self_restart(const Arg *arg) {
+    char *const argv[] = {"/home/paullik/dwm/dwm", NULL};
+    execv(argv[0], argv);
+}
+
 /* appearance */
 static const char font[]            = "Liberation Mono:pixelsize=12:antialias=false:autohint=false";
 static const char normbordercolor[] = "#444444";
@@ -89,6 +101,7 @@
 	TAGKEYS(                        XK_7,                      6)
 	TAGKEYS(                        XK_8,                      7)
 	TAGKEYS(                        XK_9,                      8)
+    { MODKEY|ShiftMask,             XK_F10,    self_restart,   {0} },
 	{ MODKEY|ShiftMask,             XK_q,      quit,           {0} },
 };
 
@@ -108,4 +121,3 @@
 	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
 	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
 };
-