summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorBossCode45 <human.cyborg42@gmail.com>2022-08-22 20:17:41 +1200
committerBossCode45 <human.cyborg42@gmail.com>2022-08-22 20:17:41 +1200
commit3cb6b1583417c47c72e542604a8636d3410067fe (patch)
tree841c3682d8b372e471f4f6e5a41add2d949b375c /config.h
parentce211d76831a178b7197998764d2983140d204bb (diff)
downloadYATwm-3cb6b1583417c47c72e542604a8636d3410067fe.tar.gz
YATwm-3cb6b1583417c47c72e542604a8636d3410067fe.zip
Better keybind support - and credits in readme
Diffstat (limited to 'config.h')
-rw-r--r--config.h32
1 files changed, 26 insertions, 6 deletions
diff --git a/config.h b/config.h
index 18d0a93..4fa6ee3 100644
--- a/config.h
+++ b/config.h
@@ -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}}
};
-