dwm-shutdowncmd-20220202-d39e2f3.diff (1081B)
1 --- a/config.def.h 2 +++ b/config.def.h 3 @@ -58,6 +58,7 @@ static const Layout layouts[] = { 4 /* commands */ 5 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ 6 static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; 7 +static const char *shutdowncmd[] = { "sudo", "shutdown", "+0", NULL }; 8 static const char *termcmd[] = { "st", NULL }; 9 10 static Key keys[] = { 11 @@ -95,6 +95,7 @@ static Key keys[] = { 12 TAGKEYS( XK_8, 7) 13 TAGKEYS( XK_9, 8) 14 { MODKEY|ShiftMask, XK_q, quit, {0} }, 15 + { MODKEY|ShiftMask, XK_Escape, spawn, {.v = shutdowncmd} }, 16 }; 17 18 /* button definitions */ 19 --- a/dwm.1 20 +++ b/dwm.1 21 @@ -142,6 +142,9 @@ Add/remove all windows with nth tag to/from the view. 22 .TP 23 .B Mod1\-Shift\-q 24 Quit dwm. 25 +.TP 26 +.B Mod1\-Shift\-Esc 27 +Shutdown (sudo shutdown +0). 28 .SS Mouse commands 29 .TP 30 .B Mod1\-Button1