diff --git a/config/dwm/config.def.h b/config/dwm/config.def.h index 04d1dec8..4ce4d4da 100644 --- a/config/dwm/config.def.h +++ b/config/dwm/config.def.h @@ -1,5 +1,9 @@ /* See LICENSE file for copyright and license details. */ +/* includes */ + +#include + /* appearance */ static const unsigned int borderpx = 2; /* border pixel of windows */ static const unsigned int gappx = 15; /* gaps between windows */ @@ -82,6 +86,10 @@ 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-icons", "-show", "drun", NULL }; static const char *termcmd[] = { "kitty", NULL }; +// audio +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", static const Key keys[] = { /* modifier key function argument */ @@ -111,6 +119,10 @@ static const Key keys[] = { { MODKEY, XK_minus, setgaps, {.i = -1 } }, { MODKEY, XK_equal, setgaps, {.i = +1 } }, { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } }, + // audio + { 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol } }, + { 0, XF86XK_AudioMute, spawn, {.v = mutevol } }, + { 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol } }, TAGKEYS( XK_1, 0) TAGKEYS( XK_2, 1) TAGKEYS( XK_3, 2) diff --git a/config/dwmblocks/blocks.def.h b/config/dwmblocks/blocks.def.h index bd0964c9..6c8cbad6 100644 --- a/config/dwmblocks/blocks.def.h +++ b/config/dwmblocks/blocks.def.h @@ -4,6 +4,7 @@ static const Block blocks[] = { {"Mem:", "free -h | awk '/^Mem/ { print $3\"/\"$2 }' | sed s/i//g", 30, 0}, {"", "date '+%b %d (%a) %I:%M%p'", 5, 0}, {"Bat:", "cat /sys/class/power_supply/BAT1/capacity", 30, 0}, + {"Vol:", "pamixer --get-volume-human", 30, 0}, }; //sets delimeter between status commands. NULL character ('\0') means no delimeter.