Implement i3's logic for maintaining a list of 'bindsym' directives and passing it to i3bar through the IPC.

This commit is contained in:
Ingo Bürk
2015-05-02 21:54:56 +02:00
parent ab12d3fc74
commit 2b6f76852c
4 changed files with 48 additions and 16 deletions

View File

@ -531,6 +531,23 @@ CFGFUN(bar_modifier, const char *modifier) {
}
static void bar_configure_mouse_command(const char *button, const char *command) {
if (strncasecmp(button, "button", sizeof("button") - 1) != 0) {
ELOG("unknown button \"%s\" for mouse command, ignoring.\n", button);
return;
}
struct Mousecommand *current;
TAILQ_FOREACH(current, &(current_bar.mouse_commands), commands) {
if (strcasecmp(current->button, button) == 0) {
ELOG("command for button %s was already specified, ignoring.\n", button);
return;
}
}
struct Mousecommand *new_command = scalloc(sizeof(struct Mousecommand));
new_command->button = sstrdup(button);
new_command->command = sstrdup(command);
TAILQ_INSERT_TAIL(&(current_bar.mouse_commands), new_command, commands);
}
CFGFUN(bar_wheel_up_cmd, const char *command) {