Merge pull request #1697 from Airblader/feature-1695

Extend mouse commands on i3bar
This commit is contained in:
Michael Stapelberg
2015-06-18 20:50:56 +02:00
11 changed files with 310 additions and 55 deletions

View File

@ -281,13 +281,7 @@ struct Barconfig {
M_MOD5 = 7
} modifier;
/** Command that should be run when mouse wheel up button is pressed over
* i3bar to override the default behavior. */
char *wheel_up_cmd;
/** Command that should be run when mouse wheel down button is pressed over
* i3bar to override the default behavior. */
char *wheel_down_cmd;
TAILQ_HEAD(bar_bindings_head, Barbinding) bar_bindings;
/** Bar position (bottom by default). */
enum { P_BOTTOM = 0,
@ -353,6 +347,21 @@ struct Barconfig {
TAILQ_ENTRY(Barconfig) configs;
};
/**
* Defines a mouse command to be executed instead of the default behavior when
* clicking on the non-statusline part of i3bar.
*
*/
struct Barbinding {
/** The button to be used (e.g., 1 for "button1"). */
int input_code;
/** The command which is to be executed for this button. */
char *command;
TAILQ_ENTRY(Barbinding) bindings;
};
/**
* Finds the configuration file to use (either the one specified by
* override_configpath), the users one or the system default) and calls

View File

@ -80,6 +80,7 @@ CFGFUN(bar_verbose, const char *verbose);
CFGFUN(bar_modifier, const char *modifier);
CFGFUN(bar_wheel_up_cmd, const char *command);
CFGFUN(bar_wheel_down_cmd, const char *command);
CFGFUN(bar_bindsym, const char *button, const char *command);
CFGFUN(bar_position, const char *position);
CFGFUN(bar_i3bar_command, const char *i3bar_command);
CFGFUN(bar_color, const char *colorclass, const char *border, const char *background, const char *text);
@ -90,4 +91,5 @@ CFGFUN(bar_status_command, const char *command);
CFGFUN(bar_binding_mode_indicator, const char *value);
CFGFUN(bar_workspace_buttons, const char *value);
CFGFUN(bar_strip_workspace_numbers, const char *value);
CFGFUN(bar_start);
CFGFUN(bar_finish);