From d250c5f3123fd59bc5d57f0d112816aa5799a7ce Mon Sep 17 00:00:00 2001 From: Matteo Bini Date: Wed, 13 Oct 2021 17:24:42 +0200 Subject: [PATCH] Shutdown command --- config.def.h | 2 ++ dwm.1 | 3 +++ 2 files changed, 5 insertions(+) diff --git a/config.def.h b/config.def.h index 7054c06..47a7c69 100644 --- a/config.def.h +++ b/config.def.h @@ -55,6 +55,7 @@ static const Layout layouts[] = { /* commands */ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL }; +static const char *shutdowncmd[] = { "sudo", "shutdown", "+0", NULL }; static const char *termcmd[] = { "st", NULL }; static Key keys[] = { @@ -92,6 +93,7 @@ static Key keys[] = { TAGKEYS( XK_8, 7) TAGKEYS( XK_9, 8) { MODKEY|ShiftMask, XK_q, quit, {0} }, + { MODKEY|ShiftMask, XK_Escape, spawn, {.v = shutdowncmd} }, }; /* button definitions */ diff --git a/dwm.1 b/dwm.1 index 6687011..201bfd6 100644 --- a/dwm.1 +++ b/dwm.1 @@ -136,6 +136,9 @@ Add/remove all windows with nth tag to/from the view. .TP .B Mod1\-Shift\-q Quit dwm. +.TP +.B Mod1\-Shift\-Esc +Shutdown (sudo shutdown +0). .SS Mouse commands .TP .B Mod1\-Button1 -- 2.30.2