commit 5022accf71a5ca6c2c40be6ea46c77992f2a7a56
parent 76f8974dd30e09dcdad24c6ba6fdb8398e5adcba
Author: Matteo Bini <matteobin@protonmail.com>
Date: Wed, 13 Oct 2021 17:48:39 +0200
Reboot command for dwm
Diffstat:
2 files changed, 63 insertions(+), 0 deletions(-)
diff --git a/dwm.suckless.org/patches/rebootcmd/dwm-rebootcmd-20211013-5ed9c48.diff b/dwm.suckless.org/patches/rebootcmd/dwm-rebootcmd-20211013-5ed9c48.diff
@@ -0,0 +1,47 @@
+From ff007bd8b5d91b163d810136d0e92c77a1462163 Mon Sep 17 00:00:00 2001
+From: Matteo Bini <matteobin@protonmail.com>
+Date: Wed, 13 Oct 2021 17:09:06 +0200
+Subject: [PATCH] Reboot 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..7c76bbc 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 *rebootcmd[] = { "sudo", "shutdown", "-r", "+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_Delete, spawn, {.v = rebootcmd} },
+ };
+
+ /* button definitions */
+diff --git a/dwm.1 b/dwm.1
+index 6687011..4356242 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\-Delete
++Reboot (sudo shutdown -r +0).
+ .SS Mouse commands
+ .TP
+ .B Mod1\-Button1
+--
+2.30.2
+
diff --git a/dwm.suckless.org/patches/rebootcmd/index.md b/dwm.suckless.org/patches/rebootcmd/index.md
@@ -0,0 +1,16 @@
+rebootcmd
+================
+
+Description
+-----------
+Key binding to reboot PC: Mod1-Shift-Delete. The user running dwm must be
+enable to execute `sudo shutdown` without password.
+
+
+Download
+--------
+* [dwm-rebootcmd-20211013-5ed9c48.diff](dwm-rebootcmd-20211013-5ed9c48.diff)
+
+Authors
+-------
+* Matteo Bini - <matteobin@protonmail.com>