diff options
| author | Raghuram Subramani <raghus2247@gmail.com> | 2024-09-29 11:40:25 +0530 |
|---|---|---|
| committer | Raghuram Subramani <raghus2247@gmail.com> | 2024-09-29 11:40:25 +0530 |
| commit | f21899671bc5c8e6b9db93e3da66335b10416b98 (patch) | |
| tree | 0b6f37e8abfc6abfda62a7ac69a47ea6fabb2482 | |
| parent | c3399fe32abe61864c6ba22221c19694f4031fc7 (diff) | |
(patch): XF86keysym.patch
| -rw-r--r-- | config.def.h | 5 | ||||
| -rw-r--r-- | patches/XF86keysym.patch | 41 |
2 files changed, 46 insertions, 0 deletions
diff --git a/config.def.h b/config.def.h index bf9f43e..8b0f4fe 100644 --- a/config.def.h +++ b/config.def.h @@ -1,3 +1,5 @@ +#include <X11/XF86keysym.h> + /* Taken from https://github.com/djpohly/dwl/issues/466 */ #define COLOR(hex) { ((hex >> 24) & 0xFF) / 255.0f, \ ((hex >> 16) & 0xFF) / 255.0f, \ @@ -184,6 +186,9 @@ static const Key keys[] = { #define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} } CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6), CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12), + { 0,XF86XK_AudioRaiseVolume, spawn,{.v = upvol } }, + { 0,XF86XK_AudioLowerVolume, spawn,{.v = downvol } }, + { 0,XF86XK_AudioMute,spawn,{.v = mute } }, }; static const Button buttons[] = { diff --git a/patches/XF86keysym.patch b/patches/XF86keysym.patch new file mode 100644 index 0000000..9255b9a --- /dev/null +++ b/patches/XF86keysym.patch @@ -0,0 +1,41 @@ +From 7182343aaf6c1fed1f5802aff948cfb4f3c82e69 Mon Sep 17 00:00:00 2001 +From: 917Wolf <none> +Date: Thu, 6 May 2021 11:04:23 +0200 +Subject: [PATCH] Found this in my old dwm config, moved it into dwl ... It + made my volum keys work again :) + +--- + config.def.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/config.def.h b/config.def.h +index 089aa3795..29a6d624f 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -1,3 +1,4 @@ ++#include <X11/XF86keysym.h> + /* appearance */ + static const int sloppyfocus = 1; /* focus follows mouse */ + static const unsigned int borderpx = 1; /* border pixel of windows */ +@@ -62,6 +63,11 @@ static const int natural_scrolling = 0; + #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } + + /* commands */ ++// for cahnging the volume via alsa amixer // ++static const char *upvol[] = { "amixer", "-q", "-c", "0", "set", "Master", "2+", NULL }; ++static const char *downvol[] = { "amixer", "-q", "-c", "0", "set", "Master", "2-", NULL }; ++// for muting/unmuting // ++static const char *mute[] = { "amixer", "-q", "set", "Master", "toggle", NULL }; + static const char *termcmd[] = { "alacritty", NULL }; + static const char *menucmd[] = { "bemenu-run", NULL }; + +@@ -107,6 +113,9 @@ static const Key keys[] = { + #define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} } + CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6), + CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12), ++ { 0,XF86XK_AudioRaiseVolume, spawn,{.v = upvol } }, ++ { 0,XF86XK_AudioLowerVolume, spawn,{.v = downvol } }, ++ { 0,XF86XK_AudioMute,spawn,{.v = mute } }, + }; + + static const Button buttons[] = { |
