commit 5701653a326eb4998eaad69e93c7374129f6455b
parent 4048cfa317cbdbb4523b014f7734352316783f99
Author: PJ-004 <pranavj765@gmail.com>
Date: Fri, 18 Oct 2024 00:15:34 -0700
[dwm][patch] Add amixer-integration patch
Diffstat:
2 files changed, 67 insertions(+), 0 deletions(-)
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
@@ -0,0 +1,47 @@
+From ac5b105c8c1d8c8043d7b8be17e331e871d1c597 Mon Sep 17 00:00:00 2001
+From: Pranav Jha <pranavj765@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
+@@ -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 */
+@@ -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
+@@ -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
@@ -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@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)