i3bar: implement custom mouse wheel commands
Users can specify a command to run when a button was pressed on i3bar to override the default behavior. Currently only the mouse wheel buttons are supported. This is useful for disabling the scroll wheel action or running scripts that implement custom behavior for these buttons. Example: bar { wheel_up_cmd nop wheel_down_cmd exec ~/.i3/scripts/custom_wheel_down } fixes #1104
This commit is contained in:
committed by
Michael Stapelberg
parent
0514be8d4b
commit
8e23dc881b
10
src/ipc.c
10
src/ipc.c
@ -512,6 +512,16 @@ static void dump_bar_config(yajl_gen gen, Barconfig *config) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (config->wheel_up_cmd) {
|
||||
ystr("wheel_up_cmd");
|
||||
ystr(config->wheel_up_cmd);
|
||||
}
|
||||
|
||||
if (config->wheel_down_cmd) {
|
||||
ystr("wheel_down_cmd");
|
||||
ystr(config->wheel_down_cmd);
|
||||
}
|
||||
|
||||
ystr("position");
|
||||
if (config->position == P_BOTTOM)
|
||||
ystr("bottom");
|
||||
|
Reference in New Issue
Block a user