pamixer for quicker audio commands

This commit is contained in:
Luke Smith 2020-04-14 17:42:07 -04:00
parent be9abae0f8
commit e41336f785
No known key found for this signature in database
GPG key ID: 4C50B54A911F6252

View file

@ -87,22 +87,6 @@ static const char *termcmd[] = { "st", NULL };
static const char scratchpadname[] = "scratchpad"; static const char scratchpadname[] = "scratchpad";
static const char *scratchpadcmd[] = { "st", "-t", scratchpadname, "-g", "120x34", NULL }; static const char *scratchpadcmd[] = { "st", "-t", scratchpadname, "-g", "120x34", NULL };
/* PulseAudio commands. Require pulsemixer. */
static const char *volup[] = { "pulsemixer", "--change-volume", "+5", NULL };
static const char *bigvolup[] = { "pulsemixer", "--change-volume", "+15", NULL };
static const char *voldown[] = { "pulsemixer", "--change-volume", "-5", NULL };
static const char *bigvoldown[] = { "pulsemixer", "--change-volume", "-15", NULL };
static const char *voltoggle[] = { "pulsemixer", "--toggle-mute", NULL };
static const char *audiocontrol[] = { "st", "-e", "pulsemixer", NULL };
/* ALSA commands. Requires amixer in alsa-utils. */
/* static const char *volup[] = { "amixer", "sset", "Master", "5%+", NULL }; */
/* static const char *bigvolup[] = { "amixer", "sset", "Master", "15%+", NULL }; */
/* static const char *voldown[] = { "amixer", "sset", "Master", "5%-", NULL }; */
/* static const char *bigvoldown[] = { "amixer", "sset", "Master", "15%-", NULL }; */
/* static const char *voltoggle[] = { "amixer", "sset", "Master", "toggle" NULL }; */
/* static const char *audiocontrol[] = { "st", "-e", "alsamixer", NULL }; */
#include <X11/XF86keysym.h> #include <X11/XF86keysym.h>
#include "shiftview.c" #include "shiftview.c"
static Key keys[] = { static Key keys[] = {
@ -123,10 +107,10 @@ static Key keys[] = {
TAGKEYS( XK_9, 8) TAGKEYS( XK_9, 8)
{ MODKEY, XK_0, view, {.ui = ~0 } }, { MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY, XK_minus, spawn, {.v = voldown } }, { MODKEY, XK_minus, spawn, SHCMD("pamixer --allow-boost -d 5; kill -44 $(pidof dwmblocks)") },
{ MODKEY|ShiftMask, XK_minus, spawn, {.v = bigvoldown } }, { MODKEY|ShiftMask, XK_minus, spawn, SHCMD("pamixer --allow-boost -d 15; kill -44 $(pidof dwmblocks)") },
{ MODKEY, XK_equal, spawn, {.v = volup } }, { MODKEY, XK_equal, spawn, SHCMD("pamixer --allow-boost -i 5; kill -44 $(pidof dwmblocks)") },
{ MODKEY|ShiftMask, XK_equal, spawn, {.v = bigvolup } }, { MODKEY|ShiftMask, XK_equal, spawn, SHCMD("pamixer --allow-boost -i 15; kill -44 $(pidof dwmblocks)") },
/* { MODKEY, XK_BackSpace, spawn, SHCMD("") }, */ /* { MODKEY, XK_BackSpace, spawn, SHCMD("") }, */
{ MODKEY|ShiftMask, XK_BackSpace, spawn, SHCMD("[ \"$(printf \"No\\nYes\" | dmenu -i -nb darkred -sb red -sf white -nf gray -p \"Reboot computer?\")\" = Yes ] && sudo -A reboot") }, { MODKEY|ShiftMask, XK_BackSpace, spawn, SHCMD("[ \"$(printf \"No\\nYes\" | dmenu -i -nb darkred -sb red -sf white -nf gray -p \"Reboot computer?\")\" = Yes ] && sudo -A reboot") },
@ -159,7 +143,7 @@ static Key keys[] = {
{ MODKEY, XK_backslash, view, {0} }, { MODKEY, XK_backslash, view, {0} },
/* { MODKEY|ShiftMask, XK_backslash, spawn, SHCMD("") }, */ /* { MODKEY|ShiftMask, XK_backslash, spawn, SHCMD("") }, */
{ MODKEY, XK_a, spawn, {.v = audiocontrol } }, { MODKEY, XK_a, spawn, SHCMD("st -e pulsemixer; kill -44 $(pidof dwmblocks)") },
/* { MODKEY|ShiftMask, XK_a, spawn, SHCMD("") }, */ /* { MODKEY|ShiftMask, XK_a, spawn, SHCMD("") }, */
{ MODKEY, XK_s, togglesticky, {0} }, { MODKEY, XK_s, togglesticky, {0} },
/* { MODKEY|ShiftMask, XK_s, spawn, SHCMD("") }, */ /* { MODKEY|ShiftMask, XK_s, spawn, SHCMD("") }, */
@ -192,7 +176,7 @@ static Key keys[] = {
{ MODKEY, XK_n, spawn, SHCMD("st -e newsboat; pkill -RTMIN+6 dwmblocks") }, { MODKEY, XK_n, spawn, SHCMD("st -e newsboat; pkill -RTMIN+6 dwmblocks") },
{ MODKEY|ShiftMask, XK_n, spawn, SHCMD("hover right") }, { MODKEY|ShiftMask, XK_n, spawn, SHCMD("hover right") },
{ MODKEY, XK_m, spawn, SHCMD("st -e ncmpcpp") }, { MODKEY, XK_m, spawn, SHCMD("st -e ncmpcpp") },
{ MODKEY|ShiftMask, XK_m, spawn, {.v = voltoggle } }, { MODKEY|ShiftMask, XK_m, spawn, SHCMD("pamixer -t; kill -44 $(pidof dwmblocks)") },
{ MODKEY, XK_comma, spawn, SHCMD("mpc prev") }, { MODKEY, XK_comma, spawn, SHCMD("mpc prev") },
{ MODKEY|ShiftMask, XK_comma, spawn, SHCMD("mpc seek 0%") }, { MODKEY|ShiftMask, XK_comma, spawn, SHCMD("mpc seek 0%") },
{ MODKEY, XK_period, spawn, SHCMD("mpc next") }, { MODKEY, XK_period, spawn, SHCMD("mpc next") },
@ -229,9 +213,9 @@ static Key keys[] = {
{ MODKEY, XK_Delete, spawn, SHCMD("dmenurecord kill") }, { MODKEY, XK_Delete, spawn, SHCMD("dmenurecord kill") },
{ MODKEY, XK_Scroll_Lock, spawn, SHCMD("killall screenkey || screenkey &") }, { MODKEY, XK_Scroll_Lock, spawn, SHCMD("killall screenkey || screenkey &") },
{ 0, XF86XK_AudioMute, spawn, {.v = voltoggle } }, { 0, XF86XK_AudioMute, spawn, SHCMD("pamixer -t; kill -44 $(pidof dwmblocks)") },
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = volup } }, { 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pamixer --allow-boost -i 3; kill -44 $(pidof dwmblocks)") },
{ 0, XF86XK_AudioLowerVolume, spawn, {.v = voldown } }, { 0, XF86XK_AudioLowerVolume, spawn, SHCMD("pamixer --allow-boost -d 3; kill -44 $(pidof dwmblocks)") },
{ 0, XF86XK_AudioPrev, spawn, SHCMD("mpc prev") }, { 0, XF86XK_AudioPrev, spawn, SHCMD("mpc prev") },
{ 0, XF86XK_AudioNext, spawn, SHCMD("mpc next") }, { 0, XF86XK_AudioNext, spawn, SHCMD("mpc next") },
{ 0, XF86XK_AudioPause, spawn, SHCMD("mpc pause") }, { 0, XF86XK_AudioPause, spawn, SHCMD("mpc pause") },