sxhkd-rc

[fork] simple X hotkey daemon (but for the rc shell)
Log | Files | Refs | README | LICENSE

commit 93c193bc5dd35188ea848ba89dcf6abc43cce34d
parent e2b5659eb4c42162b847d5a9f87c23b845e5849a
Author: Bastien Dejean <nihilhill@gmail.com>
Date:   Wed,  8 Apr 2015 17:18:52 +0200

Remove synchronous char from command

It appears that, for most shells, a line that starts with a semicolon is
a syntax error.

Diffstat:
Mtypes.c | 6+++++-
Mtypes.h | 1+
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/types.c b/types.c @@ -193,8 +193,12 @@ hotkey_t *make_hotkey(chain_t *chain, char *command) { hotkey_t *hk = malloc(sizeof(hotkey_t)); hk->chain = chain; + hk->sync = false; + if (command[0] == SYNCHRONOUS_CHAR) { + command = lgraph(command+1); + hk->sync = true; + } snprintf(hk->command, sizeof(hk->command), "%s", command); - hk->sync = (command[0] == ';'); hk->cycle = NULL; hk->next = hk->prev = NULL; return hk; diff --git a/types.h b/types.h @@ -32,6 +32,7 @@ #define KEYSYMS_PER_KEYCODE 4 #define MOD_STATE_FIELD 255 #define ESCAPE_KEYSYM 0xff1b +#define SYNCHRONOUS_CHAR ';' typedef struct chord_t chord_t; struct chord_t {