commit b6024f867f246210ef7afcb7577e74249bc0ee35
parent 984baf23f974c47a28cefe78cef012ffdd9e7827
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Wed, 12 Aug 2020 19:11:03 +0200
Add bindings for controlling remote mpd
Diffstat:
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/config.h b/config.h
@@ -77,6 +77,7 @@ static char dmenumon[2] = "0";
#define ALTTERMINAL "st-light"
#define EDITOR "vi"
#define BROWSER "surf-open.sh"
+#define MPD_REMOTE "mini"
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define TERMCMD(...) {TERMINAL, "-e", __VA_ARGS__, NULL}
@@ -126,12 +127,18 @@ static const char *todocmd[] = DUPLEXATTACHCMD("todo", EDITOR " " HOME
static const char *calendarcmd[] = DUPLEXATTACHCMD("calendar", "calendar.sh");
static const char *mixercmd[] = TERMCMD("audiomixer");
static const char *musiccmd[] = TERMCMD("ncmpc");
+static const char *music_remote_cmd[] = TERMCMD("ncmpc", "-h", MPD_REMOTE);
static const char *mpdtogglecmd[] = {"mpc", "toggle", NULL};
static const char *mpdnextcmd[] = {"mpc", "next", NULL};
static const char *mpdprevcmd[] = {"mpc", "prev", NULL};
static const char *mpdstopcmd[] = {"mpc", "stop", NULL};
+static const char *mpd_remote_togglecmd[] = {"mpc", "toggle", "-h", MPD_REMOTE, NULL};
+static const char *mpd_remote_nextcmd[] = {"mpc", "next", "-h", MPD_REMOTE, NULL};
+static const char *mpd_remote_prevcmd[] = {"mpc", "prev", "-h", MPD_REMOTE, NULL};
+static const char *mpd_remote_stopcmd[] = {"mpc", "stop", "-h", MPD_REMOTE, NULL};
+
static const char *audioextvolupcmd[] = {"sndioctl", "output.level=+0.05", NULL};
static const char *audioextvoldncmd[] = {"sndioctl", "output.level=-0.05", NULL};
static const char *audioextmutecmd[] = {"sndioctl", "output.mute=!", NULL};
@@ -167,6 +174,7 @@ static Key keys[] = {
{ MODKEY|ControlMask|ShiftMask, XK_a, spawn, {.v = mixercmd } },
{ MODKEY|MODALTKEY, XK_b, togglebar, {0} },
{ MODKEY|ControlMask|ShiftMask, XK_b, spawn, {.v = mpdprevcmd } },
+ { MODKEY|ControlMask, XK_b, spawn, {.v = mpd_remote_prevcmd } },
{ MODKEY, XK_c, spawn, {.v = showcalcmd } },
{ MODKEY|ShiftMask, XK_c, spawn, {.v = calendarcmd } },
{ MODKEY, XK_d, spawn, {.v = todocmd } },
@@ -186,17 +194,21 @@ static Key keys[] = {
{ MODKEY, XK_m, spawn, {.v = mailcmd } },
{ MODKEY|ShiftMask, XK_m, setlayout, {.v = &layouts[2]} },
{ MODKEY|ControlMask|ShiftMask, XK_m, spawn, {.v = musiccmd } },
+ { MODKEY|ControlMask, XK_m, spawn, {.v = music_remote_cmd } },
{ MODKEY, XK_n, spawn, {.v = newscmd } },
{ MODKEY|ControlMask|ShiftMask, XK_n, spawn, {.v = mpdnextcmd } },
+ { MODKEY|ControlMask, XK_n, spawn, {.v = mpd_remote_nextcmd } },
{ MODKEY, XK_o, spawn, {.v = castcmd } },
{ MODKEY|ShiftMask, XK_o, spawn, {.v = topcmd } },
{ MODKEY, XK_p, spawn, {.v = passcmd } },
{ MODKEY|ShiftMask, XK_p, spawn, {.v = passemailcmd } },
{ MODKEY|ControlMask|ShiftMask, XK_p, spawn, {.v = mpdtogglecmd } },
+ { MODKEY|ControlMask, XK_p, spawn, {.v = mpd_remote_togglecmd } },
{ MODKEY, XK_q, killclient, {0} },
{ MODKEY|ShiftMask, XK_q, quit, {0} },
{ MODKEY, XK_r, spawn, {.v = screenrecordcmd } },
{ MODKEY|ControlMask|ShiftMask, XK_s, spawn, {.v = mpdstopcmd } },
+ { MODKEY|ControlMask, XK_s, spawn, {.v = mpd_remote_stopcmd } },
{ MODKEY, XK_t, spawn, {.v = textcmd } },
{ MODKEY|ShiftMask, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_u, spawn, {.v = plumbcmd } },