From bc034ab9bdff61efbb7cd7b72a10bb33c199aba1 Mon Sep 17 00:00:00 2001 From: yuzu-eva Date: Fri, 19 Aug 2022 15:21:14 +0200 Subject: volume control --- config.h | 10 +++++++++- drw.o | Bin 11352 -> 0 bytes dwm | Bin 69264 -> 0 bytes dwm.c | 1 + dwm.o | Bin 57280 -> 0 bytes util.o | Bin 2392 -> 0 bytes 6 files changed, 10 insertions(+), 1 deletion(-) delete mode 100644 drw.o delete mode 100755 dwm delete mode 100644 dwm.o delete mode 100644 util.o diff --git a/config.h b/config.h index 1ae9e7e..7b51d41 100644 --- a/config.h +++ b/config.h @@ -31,7 +31,7 @@ static const Rule rules[] = { /* class instance title tags mask isfloating isterminal noswallow monitor */ { "Gimp", NULL, NULL, 0, 1, 0, 0, -1 }, { "Firefox", NULL, NULL, 1 << 8, 0, 0, -1, -1 }, - { "Kitty", NULL, NULL, 0, 0, 1, 0, -1 }, + { "kitty", NULL, NULL, 0, 0, 1, 0, -1 }, { NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */ }; @@ -67,6 +67,9 @@ 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 *roficmd[] = { "rofi", "-show", "drun", "-show-icons", NULL }; static const char *termcmd[] = { "kitty", NULL }; +static const char *upvol[] = { "/usr/bin/pactl", "set-sink-volume", "0", "+5%", NULL }; +static const char *downvol[] = { "/usr/bin/pactl", "set-sink-volume", "0", "-5%", NULL }; +static const char *mutevol[] = { "/usr/bin/pactl", "set-sink-mute", "0", "toggle", NULL }; static Key keys[] = { /* modifier key function argument */ @@ -99,6 +102,11 @@ static Key keys[] = { TAGKEYS( XK_3, 2) TAGKEYS( XK_4, 3) { MODKEY|ShiftMask, XK_q, quit, {0} }, + + { 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol} }, + { 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol} }, + { 0, XF86XK_AudioMute, spawn, {.v = mutevol} }, + }; /* button definitions */ diff --git a/drw.o b/drw.o deleted file mode 100644 index da1cb9d..0000000 Binary files a/drw.o and /dev/null differ diff --git a/dwm b/dwm deleted file mode 100755 index 4b7d2a1..0000000 Binary files a/dwm and /dev/null differ diff --git a/dwm.c b/dwm.c index 1def6bc..3bd6f5a 100644 --- a/dwm.c +++ b/dwm.c @@ -40,6 +40,7 @@ #include #endif /* XINERAMA */ #include +#include #include "drw.h" #include "util.h" diff --git a/dwm.o b/dwm.o deleted file mode 100644 index 690bb2d..0000000 Binary files a/dwm.o and /dev/null differ diff --git a/util.o b/util.o deleted file mode 100644 index 3fb5658..0000000 Binary files a/util.o and /dev/null differ -- cgit v1.2.3