dwm-shutdowncmd-20211013-5ed9c48.diff (1499B)
1 From d250c5f3123fd59bc5d57f0d112816aa5799a7ce Mon Sep 17 00:00:00 2001 2 From: Matteo Bini <matteobin@protonmail.com> 3 Date: Wed, 13 Oct 2021 17:24:42 +0200 4 Subject: [PATCH] Shutdown command 5 6 --- 7 config.def.h | 2 ++ 8 dwm.1 | 3 +++ 9 2 files changed, 5 insertions(+) 10 11 diff --git a/config.def.h b/config.def.h 12 index 7054c06..47a7c69 100644 13 --- a/config.def.h 14 +++ b/config.def.h 15 @@ -55,6 +55,7 @@ static const Layout layouts[] = { 16 /* commands */ 17 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ 18 static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL }; 19 +static const char *shutdowncmd[] = { "sudo", "shutdown", "+0", NULL }; 20 static const char *termcmd[] = { "st", NULL }; 21 22 static Key keys[] = { 23 @@ -92,6 +93,7 @@ static Key keys[] = { 24 TAGKEYS( XK_8, 7) 25 TAGKEYS( XK_9, 8) 26 { MODKEY|ShiftMask, XK_q, quit, {0} }, 27 + { MODKEY|ShiftMask, XK_Escape, spawn, {.v = shutdowncmd} }, 28 }; 29 30 /* button definitions */ 31 diff --git a/dwm.1 b/dwm.1 32 index 6687011..201bfd6 100644 33 --- a/dwm.1 34 +++ b/dwm.1 35 @@ -136,6 +136,9 @@ Add/remove all windows with nth tag to/from the view. 36 .TP 37 .B Mod1\-Shift\-q 38 Quit dwm. 39 +.TP 40 +.B Mod1\-Shift\-Esc 41 +Shutdown (sudo shutdown +0). 42 .SS Mouse commands 43 .TP 44 .B Mod1\-Button1 45 -- 46 2.30.2 47