[wiki] [sites] [dwm][patch][backlight] add patch || elbachir-one

From: <git_AT_suckless.org>
Date: Mon, 21 Oct 2024 15:27:42 +0200

commit 710223e36e408b0dc6dadf56317d220043e9245e
Author: elbachir-one <bachiralfa_AT_gmail.com>
Date: Mon Oct 21 14:26:46 2024 +0100

    [dwm][patch][backlight] add patch

diff --git a/dwm.suckless.org/patches/backlight/dwm-backlight-20241021-351084d.diff b/dwm.suckless.org/patches/backlight/dwm-backlight-20241021-351084d.diff
new file mode 100644
index 00000000..7c0dbaa7
--- /dev/null
+++ b/dwm.suckless.org/patches/backlight/dwm-backlight-20241021-351084d.diff
_AT_@ -0,0 +1,47 @@
+From 351084dabc6dbee742a3bf3b8829d530eb146e0d Mon Sep 17 00:00:00 2001
+From: elbachir-one <bachiralfa_AT_gmail.com>
+Date: Mon, 21 Oct 2024 14:03:49 +0100
+Subject: [PATCH] Keybinds to control the backlight
+
+---
+ config.def.h | 4 ++++
+ dwm.c | 1 +
+ 2 files changed, 5 insertions(+)
+
+diff --git a/config.def.h b/config.def.h
+index 9efa774..908c645 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -59,6 +59,8 @@ static const Layout layouts[] = {
+ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
+ static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
+ static const char *termcmd[] = { "st", NULL };
++static const char *upbrightness[] = { "xbacklight", "-inc", "10", NULL };
++static const char *downbrightness[] = { "xbacklight", "-dec", "10", NULL };
+
+ static const Key keys[] = {
+ /* modifier key function argument */
+_AT_@ -95,6 +97,8 @@ static const Key keys[] = {
+ TAGKEYS( XK_8, 7)
+ TAGKEYS( XK_9, 8)
+ { MODKEY|ShiftMask, XK_q, quit, {0} },
++ { 0, XF86XK_MonBrightnessUp, spawn, {.v = upbrightness } },
++ { 0, XF86XK_MonBrightnessDown, spawn, {.v = downbrightness } },
+ };
+
+ /* button definitions */
+diff --git a/dwm.c b/dwm.c
+index 1443802..5439d3e 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -36,6 +36,7 @@
+ #include <X11/Xlib.h>
+ #include <X11/Xproto.h>
+ #include <X11/Xutil.h>
++#include <X11/XF86keysym.h>
+ #ifdef XINERAMA
+ #include <X11/extensions/Xinerama.h>
+ #endif /* XINERAMA */
+--
+2.46.2
+
diff --git a/dwm.suckless.org/patches/backlight/index.md b/dwm.suckless.org/patches/backlight/index.md
new file mode 100644
index 00000000..92950890
--- /dev/null
+++ b/dwm.suckless.org/patches/backlight/index.md
_AT_@ -0,0 +1,17 @@
+backlight
+============
+
+Description
+-----------
+
+The **Backlight** patch for the Dynamic Window Manager (dwm) allows you to control the brightness using your laptop's brightness keys.
+
+Download
+--------
+
+* [dwm-backlight-20241021-351084d.diff](dwm-backlight-20241021-351084d.diff) (2024-10-21)
+
+Author
+------
+
+* [El Bachir](https://github.com/elbachir-one)
Received on Mon Oct 21 2024 - 15:27:42 CEST

This archive was generated by hypermail 2.3.0 : Mon Oct 21 2024 - 15:36:53 CEST