aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Gonçalves <commit@rgoncalves.se>2021-12-04 22:42:44 +0000
committerRomain Gonçalves <me@rgoncalves.se>2023-06-05 18:16:06 +0200
commit1c8451518856909f01b4577e205994678f481ea5 (patch)
treec4fad8964676c89b5bb46a5ad3bc3e7978694da0
parent3d6673bea6da6459edc83a8c84f04ff4398846d5 (diff)
downloaddwm-1c8451518856909f01b4577e205994678f481ea5.tar.gz
config.h: Add media keys and script abstraction
-rw-r--r--config.h32
1 files changed, 28 insertions, 4 deletions
diff --git a/config.h b/config.h
index 2e8fd0f..1b345e0 100644
--- a/config.h
+++ b/config.h
@@ -1,5 +1,6 @@
/* See LICENSE file for copyright and license details. */
+#include <X11/XF86keysym.h>
#include "movestack.c"
/* appearance */
@@ -58,12 +59,21 @@ static const Layout layouts[] = {
/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_black, "-nf", col_white, "-sb", col_white, "-sf", col_black, NULL };
-static const char *termcmd[] = { "st", NULL };
+static const char *termcmd[] = { ".bin/ag-term", NULL };
+static const char *audio_increase_cmd[] = { ".bin/ag-audio", "inc", NULL };
+static const char *audio_decrease_cmd[] = { ".bin/ag-audio", "dec", NULL };
+static const char *audio_toggle_microphone_cmd[] = { ".bin/ag-audio", "mic-toggle", NULL };
+static const char *audio_toggle_cmd[] = { ".bin/ag-audio", "toggle", NULL };
+static const char *audio_next_cmd[] = { ".bin/ag-audio", "next", NULL };
+static const char *audio_prev_cmd[] = { ".bin/ag-audio", "prev", NULL };
+static const char *audio_play_cmd[] = { ".bin/ag-audio", "play", NULL };
+static const char *light_increase_cmd[] = { ".bin/ag-light", "inc", NULL };
+static const char *light_decrease_cmd[] = { ".bin/ag-light", "dec", NULL };
+static const char *lock_suspend_cmd[] = { ".bin/ag-lock", "-s", NULL };
+static const char *lock_cmd[] = { ".bin/ag-lock", NULL };
static Key keys[] = {
/* modifier key function argument */
- { MODKEY, XK_d, spawn, {.v = dmenucmd } },
- { MODKEY, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
@@ -88,6 +98,21 @@ static Key keys[] = {
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
+ /* volume */
+ { 0, XF86XK_AudioRaiseVolume, spawn, {.v = audio_increase_cmd } },
+ { 0, XF86XK_AudioLowerVolume, spawn, {.v = audio_decrease_cmd } },
+ { 0, XF86XK_AudioMicMute, spawn, {.v = audio_toggle_microphone_cmd } },
+ { 0, XF86XK_AudioMute, spawn, {.v = audio_toggle_cmd } },
+ { 0, XF86XK_AudioNext, spawn, {.v = audio_next_cmd } },
+ { 0, XF86XK_AudioPrev, spawn, {.v = audio_prev_cmd } },
+ { 0, XF86XK_AudioPlay, spawn, {.v = audio_play_cmd } },
+ { 0, XF86XK_MonBrightnessUp, spawn, {.v = light_increase_cmd } },
+ { 0, XF86XK_MonBrightnessDown, spawn, {.v = light_decrease_cmd } },
+ /* commands */
+ { MODKEY|ShiftMask, XK_F12, spawn, {.v = lock_suspend_cmd } },
+ { MODKEY, XK_F12, spawn, {.v = lock_cmd } },
+ { MODKEY, XK_Return, spawn, {.v = termcmd } },
+ { MODKEY, XK_d, spawn, {.v = dmenucmd } },
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2)
@@ -107,7 +132,6 @@ static Button buttons[] = {
{ 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, Button2, togglefloating, {0} },
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
remember that computers suck.