sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

dwm-rebootcmd-20211013-5ed9c48.diff (1503B)


      1 From ff007bd8b5d91b163d810136d0e92c77a1462163 Mon Sep 17 00:00:00 2001
      2 From: Matteo Bini <matteobin@protonmail.com>
      3 Date: Wed, 13 Oct 2021 17:09:06 +0200
      4 Subject: [PATCH] Reboot 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..7c76bbc 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 *rebootcmd[]  = { "sudo", "shutdown", "-r", "+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_Delete, spawn,          {.v = rebootcmd} },
     28  };
     29  
     30  /* button definitions */
     31 diff --git a/dwm.1 b/dwm.1
     32 index 6687011..4356242 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\-Delete
     41 +Reboot (sudo shutdown -r +0).
     42  .SS Mouse commands
     43  .TP
     44  .B Mod1\-Button1
     45 -- 
     46 2.30.2
     47