[wiki] [sites] [dwm][patch] Add amixer-integration patch || PJ-004

From: <git_AT_suckless.org>
Date: Fri, 18 Oct 2024 09:15:41 +0200

commit 5701653a326eb4998eaad69e93c7374129f6455b
Author: PJ-004 <pranavj765_AT_gmail.com>
Date: Fri Oct 18 00:15:34 2024 -0700

    [dwm][patch] Add amixer-integration patch

diff --git a/dwm.suckless.org/patches/amixer-integration/dwm-amixer-integration-6.5.diff b/dwm.suckless.org/patches/amixer-integration/dwm-amixer-integration-6.5.diff
new file mode 100644
index 00000000..cf80674e
--- /dev/null
+++ b/dwm.suckless.org/patches/amixer-integration/dwm-amixer-integration-6.5.diff
_AT_@ -0,0 +1,47 @@
+From ac5b105c8c1d8c8043d7b8be17e331e871d1c597 Mon Sep 17 00:00:00 2001
+From: Pranav Jha <pranavj765_AT_gmail.com>
+Date: Thu, 17 Oct 2024 23:42:22 -0700
+Subject: [PATCH] amixer integration
+
+---
+ config.def.h | 4 ++++
+ dwm.c | 1 +
+ 2 files changed, 5 insertions(+)
+
+diff --git a/config.def.h b/config.def.h
+index 9efa774..e9d980d 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 *incvol[] = {"/usr/bin/amixer", "set", "Master", "5+", NULL};
++static const char *decvol[] = {"/usr/bin/amixer", "set", "Master", "5-", 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_AudioLowerVolume,spawn,{.v = decvol} },
++ { 0, XF86XK_AudioRaiseVolume,spawn,{.v = incvol} },
+ };
+
+ /* 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.34.1
+
diff --git a/dwm.suckless.org/patches/amixer-integration/index.md b/dwm.suckless.org/patches/amixer-integration/index.md
new file mode 100644
index 00000000..c3b0ba1a
--- /dev/null
+++ b/dwm.suckless.org/patches/amixer-integration/index.md
_AT_@ -0,0 +1,20 @@
+amixer-integration
+================
+
+Description
+-----------
+This patch allows volume to be increased or decreased using the volume buttons on a Laptop. This only works with amixer and your device would need to have amixer installed as well as dedicated volume buttons to work properly.
+
+Please contact me via email if you want to suggest an update or fix any bugs.
+
+Download
+--------
+* [dwm-amixer-integration-6.5.diff](dwm-amixer-integration-6.5.diff)
+
+Authors
+-------
+* Pranav Jha - <pranavjworkacc_AT_gmail.com>
+
+Acknowledgements
+----------------
+* Pedro A. López-Valencia (palopezv) - For his GitHub guide that showed how to use multimedia keys with dwm [link](https://gist.github.com/palopezv/efd34059af6126ad970940bcc6a90f2e)
Received on Fri Oct 18 2024 - 09:15:41 CEST

This archive was generated by hypermail 2.3.0 : Fri Oct 18 2024 - 09:24:54 CEST