#include "anvil.h"
#include <unistd.h>
+static char* wmcmd[] = { "anvil", NULL };
+static char* pickexec[] = { "pickexec", NULL };
+static char* terminal[] = { "st", NULL };
+static char* locker[] = { "slock", NULL };
+static char* new_note[] = { "j", "note", NULL };
+static char* new_task[] = { "j", "task", NULL };
+static char* new_journal[] = { "j", "journal", NULL };
+static char* fetchsel[] = { "fetch", NULL, NULL };
+
+static void restart(Arg* arg)
+{
+ (void)arg;
+ if (X.disp)
+ {
+ XCloseDisplay(X.disp);
+ }
+ setsid();
+ exit(execvp(arg->cmd[0], arg->cmd));
+}
+
static void quit(Arg* arg)
{
(void)arg;
if (fork() == 0) {
if (X.disp)
{
- close(ConnectionNumber(X.disp));
+ close(ConnectionNumber(X.disp));
}
setsid();
exit(execvp(arg->cmd[0], arg->cmd));
}
}
-static char* pickexec[] = { "pickexec", NULL };
-static char* terminal[] = { "st", NULL };
-static char* locker[] = { "slock", NULL };
-static char* new_note[] = { "j", "note", NULL };
-static char* new_task[] = { "j", "task", NULL };
-static char* new_journal[] = { "j", "journal", NULL };
-static char* fetchsel[] = { "fetch", NULL, NULL };
-
static Key keys[] = {
+ { MODKEY|ShiftMask, XK_r, restart, { .cmd = wmcmd } },
{ MODKEY, XK_p, runcmd, { .cmd = pickexec } },
{ MODKEY, XK_minus, coljoin, { 0 } },
{ MODKEY, XK_equal, colsplit, { 0 } },