summaryrefslogtreecommitdiff
path: root/config.def.h
diff options
context:
space:
mode:
authorCraig Jennings <craigmartinjennings@gmail.com>2023-08-11 14:34:21 -0500
committerCraig Jennings <craigmartinjennings@gmail.com>2023-08-11 14:34:21 -0500
commitd960d126e0d8b1388e311f7dd9c97dd37b0e729a (patch)
treeeedf08ba06e43ec1021656e4ecbe20e82873839b /config.def.h
parent5f3acb3c407c680228c567dffe362108c010ddae (diff)
adding support for media keys with pulseaudio
Diffstat (limited to 'config.def.h')
-rw-r--r--config.def.h36
1 files changed, 23 insertions, 13 deletions
diff --git a/config.def.h b/config.def.h
index 561dd78..3a09955 100644
--- a/config.def.h
+++ b/config.def.h
@@ -1,5 +1,8 @@
/* See LICENSE file for copyright and license details. */
+#include "selfrestart.c"
+#include <X11/XF86keysym.h>
+
/* appearance */
static const unsigned int borderpx = 3; /* border pixel of windows */
static const int gappx = 10; /* gaps between windows */
@@ -149,7 +152,10 @@ static const char *editorcmd[] = { "emacs", NULL }; // default editor; respe
static const char *torbrowsercmd[] = { "tor-browser", NULL };
static const char *calccmd[] = { "gnome-calculator", NULL };
-#include "selfrestart.c"
+/* volume control */
+static const char *upvol[] = { "pactl", "set-sink-volume", "0", "+5%", NULL };
+static const char *downvol[] = { "pactl", "set-sink-volume", "0", "-5%", NULL };
+static const char *mutevol[] = { "pactl", "set-sink-mute", "0", "toggle", NULL };
static Key keys[] = {
/* modifier key function argument */
@@ -200,8 +206,12 @@ static Key keys[] = {
{ MODKEY|ShiftMask, XK_b, togglescratch, {.ui = 3 } },
{ MODKEY|ShiftMask, XK_Return, togglescratch, {.ui = 4 } },
{ MODKEY, XK_f, togglescratch, {.ui = 5 } },
+ { 0, XF86XK_AudioMute, spawn, {.v = mutevol } },
+ { 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol } },
+ { 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol } },
{ MODKEY|ShiftMask, XK_q, quit, {0} },
{ MODKEY|ShiftMask, XK_r, self_restart, {0} },
+
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2)
@@ -215,16 +225,16 @@ static Key keys[] = {
/* Button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
- /* click event mask button function argument */
- { ClkLtSymbol, 0, Button1, setlayout, {0} },
- { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
- { ClkWinTitle, 0, Button2, zoom, {0} },
- { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
- { ClkClientWin, MODKEY, Button1, movemouse, {0} },
- { ClkClientWin, MODKEY, Button3, togglefloating, {0} },
- { ClkClientWin, MODKEY|ShiftMask, Button1, resizemouse, {0} },
- { ClkTagBar, 0, Button1, view, {0} },
- { ClkTagBar, 0, Button3, toggleview, {0} },
- { ClkTagBar, MODKEY, Button1, tag, {0} },
- { ClkTagBar, MODKEY, Button3, toggletag, {0} },
+ /* click event mask button function argument */
+ { ClkLtSymbol, 0, Button1, setlayout, {0} },
+ { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
+ { ClkWinTitle, 0, Button2, zoom, {0} },
+ { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
+ { ClkClientWin, MODKEY, Button1, movemouse, {0} },
+ { ClkClientWin, MODKEY, Button3, togglefloating, {0} },
+ { ClkClientWin, MODKEY|ShiftMask, Button1, resizemouse, {0} },
+ { ClkTagBar, 0, Button1, view, {0} },
+ { ClkTagBar, 0, Button3, toggleview, {0} },
+ { ClkTagBar, MODKEY, Button1, tag, {0} },
+ { ClkTagBar, MODKEY, Button3, toggletag, {0} },
};