From 3cb6b1583417c47c72e542604a8636d3410067fe Mon Sep 17 00:00:00 2001 From: BossCode45 Date: Mon, 22 Aug 2022 20:17:41 +1200 Subject: Better keybind support - and credits in readme --- config.h | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'config.h') diff --git a/config.h b/config.h index 18d0a93..4fa6ee3 100644 --- a/config.h +++ b/config.h @@ -1,15 +1,35 @@ #include +typedef union +{ + const char** str; + const int* num; +} KeyArg; + struct Key { KeySym keysym; unsigned int modifiers; + void (*function)(const KeyArg arg); + const KeyArg arg; }; -Key keyBinds[] = { - {XK_E, Mod1Mask}, - {XK_Return, Mod1Mask}, - {XK_D, Mod1Mask}, - {XK_T, Mod1Mask} +//Keybind commands +void exit(const KeyArg arg); +void spawn(const KeyArg arg); +void toggle(const KeyArg arg); +void kill(const KeyArg arg); + +const char* alacritty[] = {"alacritty", NULL}; +const char* rofi[] = {"rofi", "-i", "-show" "drun", NULL}; + +unsigned int mod = Mod1Mask; + +static struct Key keyBinds[] = { + //Key //Modifiers //Func //Args + {XK_E, mod, exit, {NULL}}, + {XK_Return, mod, spawn, {alacritty}}, + {XK_D, mod, spawn, {rofi}}, + {XK_T, mod, toggle, {NULL}}, + {XK_Q, mod, kill, {NULL}} }; - -- cgit v1.2.3