diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2019-09-02 21:41:11 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-09-04 16:48:50 -1000 |
commit | 1fd2c6ba498e61f4fe823bf552f9d2fce8612de4 (patch) | |
tree | 8e2d9adab3451f1f05c76340d466a442c840e558 /sway/sway-bar.5.scd | |
parent | seatop_default: only focus container on press (diff) | |
download | sway-1fd2c6ba498e61f4fe823bf552f9d2fce8612de4.tar.gz sway-1fd2c6ba498e61f4fe823bf552f9d2fce8612de4.tar.zst sway-1fd2c6ba498e61f4fe823bf552f9d2fce8612de4.zip |
swaybar: complete barconfig_update event handling
This adds complete support for the barconfig_update ipc event. This also
changes the bar command and subcommand handlers to correctly emit the
event. This makes it so all bar subcommands other than id and
swaybar_command are dynamically changeable at runtime. sway-bar.5 has
been updated accordingly
Diffstat (limited to 'sway/sway-bar.5.scd')
-rw-r--r-- | sway/sway-bar.5.scd | 146 |
1 files changed, 83 insertions, 63 deletions
diff --git a/sway/sway-bar.5.scd b/sway/sway-bar.5.scd index 36e84496..78124c92 100644 --- a/sway/sway-bar.5.scd +++ b/sway/sway-bar.5.scd | |||
@@ -10,58 +10,38 @@ Sway allows configuring swaybar in the sway configuration file. | |||
10 | 10 | ||
11 | # COMMANDS | 11 | # COMMANDS |
12 | 12 | ||
13 | *status_command* <status command> | 13 | The following commands may only be used in the configuration file. |
14 | Executes the bar _status command_ with _sh -c_. Each line of text printed | ||
15 | to stdout from this command will be displayed in the status area of the | ||
16 | bar. You may also use swaybar's JSON status line protocol. See | ||
17 | *swaybar-protocol*(7) for more information on the protocol | ||
18 | |||
19 | If running this command via IPC, you can disable a running status command by | ||
20 | setting the command to a single dash: _swaybar bar bar-0 status\_command -_ | ||
21 | |||
22 | *pango_markup* enabled|disabled | ||
23 | Enables or disables pango markup for status lines. This has no effect on | ||
24 | status lines using the i3bar JSON protocol. | ||
25 | 14 | ||
26 | *id* <bar_id> | 15 | *id* <bar_id> |
27 | Sets the ID of the bar. | 16 | Sets the ID of the bar. |
28 | 17 | ||
29 | *position* top|bottom | ||
30 | Sets position of the bar. Default is _bottom_. | ||
31 | |||
32 | *output* <output> | ||
33 | Restrict the bar to a certain output, can be specified multiple times. If | ||
34 | the output command is omitted, the bar will be displayed on all outputs. | ||
35 | |||
36 | *swaybar_command* <command> | 18 | *swaybar_command* <command> |
37 | Executes custom bar command. Default is _swaybar_. | 19 | Executes custom bar command. Default is _swaybar_. |
38 | 20 | ||
39 | *font* <font> | 21 | The following commands may be used either in the configuration file or at |
40 | Specifies the font to be used in the bar. _font_ should be specified as a | 22 | runtime. |
41 | pango font description. For more information on pango font descriptions, | ||
42 | see https://developer.gnome.org/pango/stable/pango-Fonts.html#pango-font-description-from-string | ||
43 | 23 | ||
44 | *separator_symbol* <symbol> | 24 | *bindcode* [--release] <event-code> <command> |
45 | Specifies the separator symbol to separate blocks on the bar. | 25 | Executes _command_ when the mouse button has been pressed (or if _released_ |
46 | 26 | is given, when the button has been released). The buttons can be given as | |
47 | *wrap_scroll* yes|no | 27 | an event code, which can be obtaining from *libinput debug-events*. To |
48 | Enables or disables wrapping when scrolling through workspaces with the | 28 | disable the default behavior for a button, use the command _nop_. |
49 | scroll wheel. Default is _no_. | ||
50 | |||
51 | *workspace_buttons* yes|no | ||
52 | Enables or disables workspace buttons on the bar. Default is _yes_. | ||
53 | |||
54 | *strip_workspace_name* yes|no | ||
55 | If set to _yes_, then workspace names will be omitted from the workspace | ||
56 | button and only the custom number will be shown. Default is _no_. | ||
57 | 29 | ||
58 | *strip_workspace_numbers* yes|no | 30 | *bindsym* [--release] button[1-9]|<event-name> <command> |
59 | If set to _yes_, then workspace numbers will be omitted from the workspace | 31 | Executes _command_ when the mouse button has been pressed (or if _released_ |
60 | button and only the custom name will be shown. Default is _no_. | 32 | is given, when the button has been released). The buttons can be given as a |
33 | x11 button number or an event name, which can be obtained from *libinput | ||
34 | debug-events*. To disable the default behavior for a button, use the | ||
35 | command _nop_. | ||
61 | 36 | ||
62 | *binding_mode_indicator* yes|no | 37 | *binding_mode_indicator* yes|no |
63 | Enable or disable binding mode indicator. Default is _yes_. | 38 | Enable or disable binding mode indicator. Default is _yes_. |
64 | 39 | ||
40 | *font* <font> | ||
41 | Specifies the font to be used in the bar. _font_ should be specified as a | ||
42 | pango font description. For more information on pango font descriptions, | ||
43 | see https://developer.gnome.org/pango/stable/pango-Fonts.html#pango-font-description-from-string | ||
44 | |||
65 | *gaps* <all> | <horizontal> <vertical> | <top> <right> <bottom> <left> | 45 | *gaps* <all> | <horizontal> <vertical> | <top> <right> <bottom> <left> |
66 | Sets the gaps from the edge of the screen for the bar. Gaps can either be | 46 | Sets the gaps from the edge of the screen for the bar. Gaps can either be |
67 | set all at once, per direction, or per side. Note that only sides that | 47 | set all at once, per direction, or per side. Note that only sides that |
@@ -72,20 +52,21 @@ Sway allows configuring swaybar in the sway configuration file. | |||
72 | *height* <height> | 52 | *height* <height> |
73 | Sets the height of the bar. Default height (0) will match the font size. | 53 | Sets the height of the bar. Default height (0) will match the font size. |
74 | 54 | ||
75 | *bindcode* [--release] <event-code> <command> | 55 | *hidden_state* hide|show [<bar-id>] |
76 | Executes _command_ when the mouse button has been pressed (or if _released_ | 56 | Specifies the behaviour of the bar when it is in _hide_ mode. When the |
77 | is given, when the button has been released). The buttons can be given as | 57 | hidden state is _hide_, then it is normally hidden, and only unhidden by |
78 | an event code, which can be obtaining from *libinput debug-events*. To | 58 | pressing the modifier key or in case of urgency hints. When the hidden |
79 | disable the default behavior for a button, use the command _nop_. | 59 | state is _show_, then it is permanently visible, drawn on top of the |
60 | currently visible workspace. Default is _hide_. | ||
80 | 61 | ||
81 | *bindsym* [--release] button[1-9]|<event-name> <command> | 62 | For compatibility with i3, _bar hidden_state hide|show [<bar-id>]_ is |
82 | Executes _command_ when the mouse button has been pressed (or if _released_ | 63 | supported along with the sway only _bar <bar-id> hidden_state hide|show_ |
83 | is given, when the button has been released). The buttons can be given as a | 64 | syntax. When using the i3 syntax, if _bar-id_ is omitted, the hidden_state |
84 | x11 button number or an event name, which can be obtained from *libinput | 65 | will be changed for all bars. Attempting to use _bar <bar-id1> |
85 | debug-events*. To disable the default behavior for a button, use the | 66 | hidden_state hide|show <bar-id2>_ will result in an error due to |
86 | command _nop_. | 67 | conflicting bar ids. |
87 | 68 | ||
88 | *mode* dock|hide|invisible|overlay | 69 | *mode* dock|hide|invisible|overlay [<bar-id>] |
89 | Specifies the visibility of the bar. In _dock_ mode, it is permanently | 70 | Specifies the visibility of the bar. In _dock_ mode, it is permanently |
90 | visible at one edge of the screen. In _hide_ mode, it is hidden unless the | 71 | visible at one edge of the screen. In _hide_ mode, it is hidden unless the |
91 | modifier key is pressed, though this behaviour depends on the hidden state. | 72 | modifier key is pressed, though this behaviour depends on the hidden state. |
@@ -93,32 +74,70 @@ Sway allows configuring swaybar in the sway configuration file. | |||
93 | permanently visible on top of other windows. (In _overlay_ mode the bar is | 74 | permanently visible on top of other windows. (In _overlay_ mode the bar is |
94 | transparent to input events.) Default is _dock_. | 75 | transparent to input events.) Default is _dock_. |
95 | 76 | ||
96 | *hidden_state* hide|show | 77 | For compatibility with i3, _bar mode <mode> [<bar-id>]_ syntax is supported |
97 | Specifies the behaviour of the bar when it is in _hide_ mode. When the | 78 | along with the sway only _bar <bar-id> mode <mode>_ syntax. When using the |
98 | hidden state is _hide_, then it is normally hidden, and only unhidden by | 79 | i3 syntax, if _bar-id_ is omitted, the mode will be changed for all bars. |
99 | pressing the modifier key or in case of urgency hints. When the hidden | 80 | Attempting to use _bar <bar-id1> mode <mode> <bar-id2>_ will result in an |
100 | state is _show_, then it is permanently visible, drawn on top of the | 81 | error due to conflicting bar ids. |
101 | currently visible workspace. Default is _hide_. | ||
102 | 82 | ||
103 | *modifier* <Modifier>|none | 83 | *modifier* <Modifier>|none |
104 | Specifies the modifier key that shows a hidden bar. Default is _Mod4_. | 84 | Specifies the modifier key that shows a hidden bar. Default is _Mod4_. |
105 | 85 | ||
106 | *status_padding* <padding> | 86 | *output* <output>|\* |
107 | Sets the vertical padding that is used for the status line. The default is | 87 | Restrict the bar to a certain output, can be specified multiple times. If |
108 | _1_. If _padding_ is _0_, blocks will be able to take up the full height of | 88 | the output command is omitted, the bar will be displayed on all outputs. _\*_ |
109 | the bar. This value will be multiplied by the output scale. | 89 | can be given at any point to reset it back to all outputs. |
90 | |||
91 | *pango_markup* enabled|disabled | ||
92 | Enables or disables pango markup for status lines. This has no effect on | ||
93 | status lines using the i3bar JSON protocol. | ||
94 | |||
95 | *position* top|bottom | ||
96 | Sets position of the bar. Default is _bottom_. | ||
97 | |||
98 | *separator_symbol* <symbol> | ||
99 | Specifies the separator symbol to separate blocks on the bar. | ||
100 | |||
101 | *status_command* <status command> | ||
102 | Executes the bar _status command_ with _sh -c_. Each line of text printed | ||
103 | to stdout from this command will be displayed in the status area of the | ||
104 | bar. You may also use swaybar's JSON status line protocol. See | ||
105 | *swaybar-protocol*(7) for more information on the protocol | ||
106 | |||
107 | If running this command via IPC, you can disable a running status command by | ||
108 | setting the command to a single dash: _swaybar bar bar-0 status\_command -_ | ||
110 | 109 | ||
111 | *status_edge_padding* <padding> | 110 | *status_edge_padding* <padding> |
112 | Sets the padding that is used when the status line is at the right edge of | 111 | Sets the padding that is used when the status line is at the right edge of |
113 | the bar. This value will be multiplied by the output scale. The default is | 112 | the bar. This value will be multiplied by the output scale. The default is |
114 | _3_. | 113 | _3_. |
115 | 114 | ||
115 | *status_padding* <padding> | ||
116 | Sets the vertical padding that is used for the status line. The default is | ||
117 | _1_. If _padding_ is _0_, blocks will be able to take up the full height of | ||
118 | the bar. This value will be multiplied by the output scale. | ||
119 | |||
120 | *strip_workspace_name* yes|no | ||
121 | If set to _yes_, then workspace names will be omitted from the workspace | ||
122 | button and only the custom number will be shown. Default is _no_. | ||
123 | |||
124 | *strip_workspace_numbers* yes|no | ||
125 | If set to _yes_, then workspace numbers will be omitted from the workspace | ||
126 | button and only the custom name will be shown. Default is _no_. | ||
127 | |||
116 | *unbindcode* [--release] <event-code> | 128 | *unbindcode* [--release] <event-code> |
117 | Removes the binding with the given <event-code>. | 129 | Removes the binding with the given <event-code>. |
118 | 130 | ||
119 | *unbindsym* [--release] button[1-9]|<event-name> | 131 | *unbindsym* [--release] button[1-9]|<event-name> |
120 | Removes the binding with the given <button> or <event-name>. | 132 | Removes the binding with the given <button> or <event-name>. |
121 | 133 | ||
134 | *wrap_scroll* yes|no | ||
135 | Enables or disables wrapping when scrolling through workspaces with the | ||
136 | scroll wheel. Default is _no_. | ||
137 | |||
138 | *workspace_buttons* yes|no | ||
139 | Enables or disables workspace buttons on the bar. Default is _yes_. | ||
140 | |||
122 | ## TRAY | 141 | ## TRAY |
123 | 142 | ||
124 | Swaybar provides a system tray where third-party applications may place icons. | 143 | Swaybar provides a system tray where third-party applications may place icons. |
@@ -142,10 +161,11 @@ ContextMenu|Activate|SecondaryActivate|ScrollDown|ScrollLeft|ScrollRight|ScrollU | |||
142 | Sets the pixel padding of the system tray. This padding will surround the | 161 | Sets the pixel padding of the system tray. This padding will surround the |
143 | tray on all sides and between each item. The default value for _px_ is 2. | 162 | tray on all sides and between each item. The default value for _px_ is 2. |
144 | 163 | ||
145 | *tray_output* none|<output> | 164 | *tray_output* none|<output>|\* |
146 | Restrict the tray to a certain output, can be specified multiple times. If | 165 | Restrict the tray to a certain output, can be specified multiple times. If |
147 | omitted, the tray will be displayed on all outputs. Unlike i3bar, swaybar | 166 | omitted, the tray will be displayed on all outputs. Unlike i3bar, swaybar |
148 | can show icons on any number of bars and outputs without races. | 167 | can show icons on any number of bars and outputs without races. _\*_ can be |
168 | given at any point to reset it to display on all outputs. | ||
149 | 169 | ||
150 | *icon_theme* <name> | 170 | *icon_theme* <name> |
151 | Sets the icon theme that sway will look for item icons in. This option has | 171 | Sets the icon theme that sway will look for item icons in. This option has |