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:
Tony Crisci
2014-07-04 05:53:22 -04:00
committed by Michael Stapelberg
parent 0514be8d4b
commit 8e23dc881b
10 changed files with 94 additions and 1 deletions

View File

@ -358,6 +358,8 @@ state BAR:
'hidden_state' -> BAR_HIDDEN_STATE
'id' -> BAR_ID
'modifier' -> BAR_MODIFIER
'wheel_up_cmd' -> BAR_WHEEL_UP_CMD
'wheel_down_cmd' -> BAR_WHEEL_DOWN_CMD
'position' -> BAR_POSITION
'output' -> BAR_OUTPUT
'tray_output' -> BAR_TRAY_OUTPUT
@ -403,6 +405,14 @@ state BAR_MODIFIER:
modifier = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Control', 'Ctrl', 'Shift'
-> call cfg_bar_modifier($modifier); BAR
state BAR_WHEEL_UP_CMD:
command = string
-> call cfg_bar_wheel_up_cmd($command); BAR
state BAR_WHEEL_DOWN_CMD:
command = string
-> call cfg_bar_wheel_down_cmd($command); BAR
state BAR_POSITION:
position = 'top', 'bottom'
-> call cfg_bar_position($position); BAR