[wiki] [sites] Shutdown command patch for dwm || Matteo Bini
commit 04abc1c126ec6c4dba7371f380e7f06f59831844
Author: Matteo Bini <matteobin_AT_protonmail.com>
Date: Wed Oct 13 17:56:17 2021 +0200
Shutdown command patch for dwm
diff --git a/dwm.suckless.org/patches/shutdowncmd/dwm-shutdowncmd-20211013-5ed9c48.diff b/dwm.suckless.org/patches/shutdowncmd/dwm-shutdowncmd-20211013-5ed9c48.diff
new file mode 100644
index 00000000..a8dc2a07
--- /dev/null
+++ b/dwm.suckless.org/patches/shutdowncmd/dwm-shutdowncmd-20211013-5ed9c48.diff
_AT_@ -0,0 +1,47 @@
+From d250c5f3123fd59bc5d57f0d112816aa5799a7ce Mon Sep 17 00:00:00 2001
+From: Matteo Bini <matteobin_AT_protonmail.com>
+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
+_AT_@ -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[] = {
+_AT_@ -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
+_AT_@ -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
+
diff --git a/dwm.suckless.org/patches/shutdowncmd/index.md b/dwm.suckless.org/patches/shutdowncmd/index.md
new file mode 100644
index 00000000..2cfdd71b
--- /dev/null
+++ b/dwm.suckless.org/patches/shutdowncmd/index.md
_AT_@ -0,0 +1,16 @@
+shutdowncmd
+================
+
+Description
+-----------
+Key binding to shutdown PC: Mod1-Shift-Esc. The user running dwm must be
+enable to execute `sudo shutdown` without password.
+
+
+Download
+--------
+* [dwm-shutdowncmd-20211013-5ed9c48.diff](dwm-shutdowncmd-20211013-5ed9c48.diff)
+
+Authors
+-------
+* Matteo Bini - <matteobin_AT_protonmail.com>
Received on Wed Oct 13 2021 - 17:56:55 CEST
This archive was generated by hypermail 2.3.0
: Wed Oct 13 2021 - 18:00:47 CEST