diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2019-01-15 21:25:28 -0500 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2019-01-16 11:12:45 +0100 |
commit | 02bbefda20b9a4f86e740d33bbaa21c661bb2fac (patch) | |
tree | 1b753e414749374be1e144a326a744c4b6812480 /sway/sway-bar.5.scd | |
parent | layer_shell: do not SIGABRT sway on zero outputs (diff) | |
download | sway-02bbefda20b9a4f86e740d33bbaa21c661bb2fac.tar.gz sway-02bbefda20b9a4f86e740d33bbaa21c661bb2fac.tar.zst sway-02bbefda20b9a4f86e740d33bbaa21c661bb2fac.zip |
bar_cmd_tray_bind: Use mouse button helpers
This modifies `bar_cmd_tray_bindsym` to use `get_mouse_bindsym` for
parsing mouse buttons. This also introduces `bar_cmd_tray_bindcode`,
which will use `get_mouse_bindcode` for parsing mouse buttons. Like with
sway bindings, the two commands are encapsulated in a single file to
maximize shared code.
This also modifies tray bindings to work off of events codes rather than
x11 buttons, which allows for any mouse buttons to be used.
For `get_bar_config`, `event_code` has been added to the `tray_bindings`
section and will include to event code for the button. If the event code
can be mapped to a x11 button, `input_code` will still be the x11 button
number. Otherwise, `input_code` will be `0`.
Diffstat (limited to 'sway/sway-bar.5.scd')
-rw-r--r-- | sway/sway-bar.5.scd | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/sway/sway-bar.5.scd b/sway/sway-bar.5.scd index 3f6b4298..9a6397e3 100644 --- a/sway/sway-bar.5.scd +++ b/sway/sway-bar.5.scd | |||
@@ -115,13 +115,19 @@ Sway allows configuring swaybar in the sway configuration file. | |||
115 | Swaybar provides a system tray where third-party applications may place icons. | 115 | Swaybar provides a system tray where third-party applications may place icons. |
116 | The following commands configure the tray. | 116 | The following commands configure the tray. |
117 | 117 | ||
118 | The _button_ argument in all cases is a platform-specific button code. On Linux | 118 | *tray\_bindcode* <event-code> |
119 | you can find a list of these at linux/input-event-codes.h. | 119 | ContextMenu|Activate|SecondaryActivate|ScrollDown|ScrollLeft|ScrollRight|ScrollUp|nop |
120 | 120 | Executes the action when the mouse button has been pressed. The buttons can | |
121 | *tray\_bindsym* button<n> ContextMenu|Activate|SecondaryActivate|ScrollDown|ScrollLeft|ScrollRight|ScrollUp|nop | 121 | be given as an event code, which can be obtained from `libinput debug-events`. |
122 | Binds mouse button _n_ (1 to 9) to the specified action. Use the command | 122 | To disable the default behavior for a button, use the command _nop_. |
123 | _nop_ to disable the default action (Activate for button 1, ContextMenu for | 123 | |
124 | button 2 and SecondaryActivate for button 3). | 124 | *tray\_bindsym* button[1-9]|<event-name> |
125 | ContextMenu|Activate|SecondaryActivate|ScrollDown|ScrollLeft|ScrollRight|ScrollUp|nop | ||
126 | Executes the action when the mouse button has been pressed. The buttons can | ||
127 | be given as a x11 button number or an event name, which can be obtained | ||
128 | from `libinput debug-events`. Use the command _nop_ to disable the default | ||
129 | action (Activate for button1, ContextMenu for button2 and SecondaryActivate | ||
130 | for button3). | ||
125 | 131 | ||
126 | *tray\_padding* <px> [px] | 132 | *tray\_padding* <px> [px] |
127 | Sets the pixel padding of the system tray. This padding will surround the | 133 | Sets the pixel padding of the system tray. This padding will surround the |