diff options
| author | BossCode45 <human.cyborg42@gmail.com> | 2022-08-22 20:17:41 +1200 |
|---|---|---|
| committer | BossCode45 <human.cyborg42@gmail.com> | 2022-08-22 20:17:41 +1200 |
| commit | 3cb6b1583417c47c72e542604a8636d3410067fe (patch) | |
| tree | 841c3682d8b372e471f4f6e5a41add2d949b375c /config.h | |
| parent | ce211d76831a178b7197998764d2983140d204bb (diff) | |
| download | YATwm-3cb6b1583417c47c72e542604a8636d3410067fe.tar.gz YATwm-3cb6b1583417c47c72e542604a8636d3410067fe.zip | |
Better keybind support - and credits in readme
Diffstat (limited to 'config.h')
| -rw-r--r-- | config.h | 32 |
1 files changed, 26 insertions, 6 deletions
@@ -1,15 +1,35 @@ #include <X11/keysym.h> +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}} }; - |
