diff options
Diffstat (limited to 'xmouseless.c')
-rw-r--r-- | xmouseless.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xmouseless.c b/xmouseless.c index 90dd4b1..e6acd29 100644 --- a/xmouseless.c +++ b/xmouseless.c @@ -1,4 +1,5 @@ /* + * xmouseless */ #include <stdio.h> #include <stdlib.h> @@ -30,6 +31,11 @@ typedef struct { int speed; } SpeedBindings; +typedef struct { + KeySym keysym; + char *command; +} ShellBinding; + /* load configuration */ #include "config.h" @@ -171,6 +177,17 @@ void handle_keyrelease(XKeyEvent event) { } } + /* shell bindings */ + for (i = 0; i < LENGTH(shell_bindings); i++) { + if (shell_bindings[i].keysym == keysym) { + printf("executing: %s\n", shell_bindings[i].command); + if (fork() == 0) { + system(shell_bindings[i].command); + exit(EXIT_SUCCESS); + } + } + } + /* exit */ for (i = 0; i < LENGTH(exit_keys); i++) { if (exit_keys[i] == keysym) { |