diff options
Diffstat (limited to 'sway')
-rw-r--r-- | sway/commands/bar.c | 93 | ||||
-rw-r--r-- | sway/commands/bar/hidden_state.c | 8 | ||||
-rw-r--r-- | sway/commands/bar/mode.c | 8 | ||||
-rw-r--r-- | sway/commands/bar/output.c | 15 | ||||
-rw-r--r-- | sway/commands/bar/status_command.c | 5 | ||||
-rw-r--r-- | sway/commands/bar/tray_output.c | 12 | ||||
-rw-r--r-- | sway/config/bar.c | 1 | ||||
-rw-r--r-- | sway/sway-bar.5.scd | 146 | ||||
-rw-r--r-- | sway/sway.5.scd | 12 |
9 files changed, 160 insertions, 140 deletions
diff --git a/sway/commands/bar.c b/sway/commands/bar.c index 88580ffb..7370910d 100644 --- a/sway/commands/bar.c +++ b/sway/commands/bar.c | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <strings.h> | 4 | #include <strings.h> |
5 | #include "sway/commands.h" | 5 | #include "sway/commands.h" |
6 | #include "sway/config.h" | 6 | #include "sway/config.h" |
7 | #include "sway/ipc-server.h" | ||
7 | #include "log.h" | 8 | #include "log.h" |
8 | 9 | ||
9 | // Must be in alphabetical order for bsearch | 10 | // Must be in alphabetical order for bsearch |
@@ -56,30 +57,27 @@ struct cmd_results *cmd_bar(int argc, char **argv) { | |||
56 | return error; | 57 | return error; |
57 | } | 58 | } |
58 | 59 | ||
59 | bool spawn = false; | 60 | char *id = NULL; |
60 | struct bar_config *bar = NULL; | ||
61 | if (strcmp(argv[0], "id") != 0 && is_subcommand(argv[1])) { | 61 | if (strcmp(argv[0], "id") != 0 && is_subcommand(argv[1])) { |
62 | for (int i = 0; i < config->bars->length; ++i) { | 62 | for (int i = 0; i < config->bars->length; ++i) { |
63 | struct bar_config *item = config->bars->items[i]; | 63 | struct bar_config *item = config->bars->items[i]; |
64 | if (strcmp(item->id, argv[0]) == 0) { | 64 | if (strcmp(item->id, argv[0]) == 0) { |
65 | sway_log(SWAY_DEBUG, "Selecting bar: %s", argv[0]); | 65 | sway_log(SWAY_DEBUG, "Selecting bar: %s", argv[0]); |
66 | bar = item; | 66 | config->current_bar = item; |
67 | break; | 67 | break; |
68 | } | 68 | } |
69 | } | 69 | } |
70 | if (!bar) { | 70 | if (!config->current_bar) { |
71 | spawn = !config->reading; | 71 | id = strdup(argv[0]); |
72 | sway_log(SWAY_DEBUG, "Creating bar: %s", argv[0]); | ||
73 | bar = default_bar_config(); | ||
74 | if (!bar) { | ||
75 | return cmd_results_new(CMD_FAILURE, | ||
76 | "Unable to allocate bar state"); | ||
77 | } | ||
78 | |||
79 | bar->id = strdup(argv[0]); | ||
80 | } | 72 | } |
81 | config->current_bar = bar; | ||
82 | ++argv; --argc; | 73 | ++argv; --argc; |
74 | } else if (config->reading && !config->current_bar) { | ||
75 | int len = snprintf(NULL, 0, "bar-%d", config->bars->length) + 1; | ||
76 | id = malloc(len * sizeof(char)); | ||
77 | if (!id) { | ||
78 | return cmd_results_new(CMD_FAILURE, "Unable to allocate bar id"); | ||
79 | } | ||
80 | snprintf(id, len, "bar-%d", config->bars->length); | ||
83 | } else if (!config->reading && strcmp(argv[0], "mode") != 0 && | 81 | } else if (!config->reading && strcmp(argv[0], "mode") != 0 && |
84 | strcmp(argv[0], "hidden_state") != 0) { | 82 | strcmp(argv[0], "hidden_state") != 0) { |
85 | if (is_subcommand(argv[0])) { | 83 | if (is_subcommand(argv[0])) { |
@@ -90,56 +88,49 @@ struct cmd_results *cmd_bar(int argc, char **argv) { | |||
90 | } | 88 | } |
91 | } | 89 | } |
92 | 90 | ||
93 | if (!config->current_bar) { | 91 | if (id) { |
94 | if (config->reading) { | 92 | sway_log(SWAY_DEBUG, "Creating bar: %s", id); |
95 | // Create new bar with default values | 93 | config->current_bar = default_bar_config(); |
96 | struct bar_config *bar = default_bar_config(); | 94 | if (!config->current_bar) { |
97 | if (!bar) { | 95 | free(id); |
98 | return cmd_results_new(CMD_FAILURE, | 96 | return cmd_results_new(CMD_FAILURE, "Unable to allocate bar config"); |
99 | "Unable to allocate bar state"); | ||
100 | } | ||
101 | |||
102 | // set bar id | ||
103 | int len = snprintf(NULL, 0, "bar-%d", config->bars->length - 1) + 1; | ||
104 | bar->id = malloc(len * sizeof(char)); | ||
105 | if (bar->id) { | ||
106 | snprintf(bar->id, len, "bar-%d", config->bars->length - 1); | ||
107 | } else { | ||
108 | return cmd_results_new(CMD_FAILURE, "Unable to allocate bar ID"); | ||
109 | } | ||
110 | |||
111 | // Set current bar | ||
112 | config->current_bar = bar; | ||
113 | sway_log(SWAY_DEBUG, "Creating bar %s", bar->id); | ||
114 | } | 97 | } |
98 | config->current_bar->id = id; | ||
115 | } | 99 | } |
116 | 100 | ||
101 | struct cmd_results *res = NULL; | ||
117 | if (find_handler(argv[0], bar_config_handlers, | 102 | if (find_handler(argv[0], bar_config_handlers, |
118 | sizeof(bar_config_handlers))) { | 103 | sizeof(bar_config_handlers))) { |
119 | if (config->reading) { | 104 | if (config->reading) { |
120 | return config_subcommand(argv, argc, bar_config_handlers, | 105 | res = config_subcommand(argv, argc, bar_config_handlers, |
121 | sizeof(bar_config_handlers)); | 106 | sizeof(bar_config_handlers)); |
122 | } else if (spawn) { | 107 | } else { |
123 | for (int i = config->bars->length - 1; i >= 0; i--) { | 108 | res = cmd_results_new(CMD_INVALID, |
124 | struct bar_config *bar = config->bars->items[i]; | 109 | "Can only be used in the config file"); |
125 | if (bar == config->current_bar) { | 110 | } |
126 | list_del(config->bars, i); | 111 | } else { |
127 | free_bar_config(bar); | 112 | res = config_subcommand(argv, argc, bar_handlers, sizeof(bar_handlers)); |
128 | break; | 113 | } |
129 | } | 114 | |
130 | } | 115 | if (res && res->status != CMD_SUCCESS) { |
116 | if (id) { | ||
117 | free_bar_config(config->current_bar); | ||
118 | id = NULL; | ||
131 | } | 119 | } |
132 | return cmd_results_new(CMD_INVALID, | 120 | return res; |
133 | "Can only be used in the config file."); | 121 | } |
122 | |||
123 | if (id) { | ||
124 | list_add(config->bars, config->current_bar); | ||
134 | } | 125 | } |
135 | 126 | ||
136 | struct cmd_results *res = | 127 | if (!config->reading && config->current_bar) { |
137 | config_subcommand(argv, argc, bar_handlers, sizeof(bar_handlers)); | 128 | ipc_event_barconfig_update(config->current_bar); |
138 | if (!config->reading) { | 129 | if (id) { |
139 | if (spawn) { | ||
140 | load_swaybar(config->current_bar); | 130 | load_swaybar(config->current_bar); |
141 | } | 131 | } |
142 | config->current_bar = NULL; | 132 | config->current_bar = NULL; |
143 | } | 133 | } |
134 | |||
144 | return res; | 135 | return res; |
145 | } | 136 | } |
diff --git a/sway/commands/bar/hidden_state.c b/sway/commands/bar/hidden_state.c index b2c2d245..1f08a5d2 100644 --- a/sway/commands/bar/hidden_state.c +++ b/sway/commands/bar/hidden_state.c | |||
@@ -23,7 +23,7 @@ static struct cmd_results *bar_set_hidden_state(struct bar_config *bar, | |||
23 | return cmd_results_new(CMD_INVALID, "Invalid value %s", hidden_state); | 23 | return cmd_results_new(CMD_INVALID, "Invalid value %s", hidden_state); |
24 | } | 24 | } |
25 | if (strcmp(old_state, bar->hidden_state) != 0) { | 25 | if (strcmp(old_state, bar->hidden_state) != 0) { |
26 | if (!config->reading) { | 26 | if (!config->current_bar) { |
27 | ipc_event_barconfig_update(bar); | 27 | ipc_event_barconfig_update(bar); |
28 | } | 28 | } |
29 | sway_log(SWAY_DEBUG, "Setting hidden_state: '%s' for bar: %s", | 29 | sway_log(SWAY_DEBUG, "Setting hidden_state: '%s' for bar: %s", |
@@ -47,6 +47,12 @@ struct cmd_results *bar_cmd_hidden_state(int argc, char **argv) { | |||
47 | "Unexpected value %s in config mode", argv[1]); | 47 | "Unexpected value %s in config mode", argv[1]); |
48 | } | 48 | } |
49 | 49 | ||
50 | if (config->current_bar && argc == 2 && | ||
51 | strcmp(config->current_bar->id, argv[1]) != 0) { | ||
52 | return cmd_results_new(CMD_INVALID, "Conflicting bar ids: %s and %s", | ||
53 | config->current_bar->id, argv[1]); | ||
54 | } | ||
55 | |||
50 | const char *state = argv[0]; | 56 | const char *state = argv[0]; |
51 | if (config->reading) { | 57 | if (config->reading) { |
52 | error = bar_set_hidden_state(config->current_bar, state); | 58 | error = bar_set_hidden_state(config->current_bar, state); |
diff --git a/sway/commands/bar/mode.c b/sway/commands/bar/mode.c index 1081ad4b..8b3fb275 100644 --- a/sway/commands/bar/mode.c +++ b/sway/commands/bar/mode.c | |||
@@ -27,7 +27,7 @@ static struct cmd_results *bar_set_mode(struct bar_config *bar, const char *mode | |||
27 | } | 27 | } |
28 | 28 | ||
29 | if (strcmp(old_mode, bar->mode) != 0) { | 29 | if (strcmp(old_mode, bar->mode) != 0) { |
30 | if (!config->reading) { | 30 | if (!config->current_bar) { |
31 | ipc_event_barconfig_update(bar); | 31 | ipc_event_barconfig_update(bar); |
32 | } | 32 | } |
33 | sway_log(SWAY_DEBUG, "Setting mode: '%s' for bar: %s", bar->mode, bar->id); | 33 | sway_log(SWAY_DEBUG, "Setting mode: '%s' for bar: %s", bar->mode, bar->id); |
@@ -51,6 +51,12 @@ struct cmd_results *bar_cmd_mode(int argc, char **argv) { | |||
51 | "Unexpected value %s in config mode", argv[1]); | 51 | "Unexpected value %s in config mode", argv[1]); |
52 | } | 52 | } |
53 | 53 | ||
54 | if (config->current_bar && argc == 2 && | ||
55 | strcmp(config->current_bar->id, argv[1]) != 0) { | ||
56 | return cmd_results_new(CMD_INVALID, "Conflicting bar ids: %s and %s", | ||
57 | config->current_bar->id, argv[1]); | ||
58 | } | ||
59 | |||
54 | const char *mode = argv[0]; | 60 | const char *mode = argv[0]; |
55 | if (config->reading) { | 61 | if (config->reading) { |
56 | error = bar_set_mode(config->current_bar, mode); | 62 | error = bar_set_mode(config->current_bar, mode); |
diff --git a/sway/commands/bar/output.c b/sway/commands/bar/output.c index 6a78b30d..cac1d056 100644 --- a/sway/commands/bar/output.c +++ b/sway/commands/bar/output.c | |||
@@ -21,16 +21,19 @@ struct cmd_results *bar_cmd_output(int argc, char **argv) { | |||
21 | bool add_output = true; | 21 | bool add_output = true; |
22 | if (strcmp("*", output) == 0) { | 22 | if (strcmp("*", output) == 0) { |
23 | // remove all previous defined outputs and replace with '*' | 23 | // remove all previous defined outputs and replace with '*' |
24 | for (int i = 0; i < outputs->length; ++i) { | 24 | while (outputs->length) { |
25 | free(outputs->items[i]); | 25 | free(outputs->items[0]); |
26 | list_del(outputs, i); | 26 | list_del(outputs, 0); |
27 | } | 27 | } |
28 | } else { | 28 | } else { |
29 | // only add output if not already defined with either the same | 29 | // only add output if not already defined, if the list has '*', remove |
30 | // name or as '*' | 30 | // it, in favor of a manual list |
31 | for (int i = 0; i < outputs->length; ++i) { | 31 | for (int i = 0; i < outputs->length; ++i) { |
32 | const char *find = outputs->items[i]; | 32 | const char *find = outputs->items[i]; |
33 | if (strcmp("*", find) == 0 || strcmp(output, find) == 0) { | 33 | if (strcmp("*", find) == 0) { |
34 | free(outputs->items[i]); | ||
35 | list_del(outputs, i); | ||
36 | } else if (strcmp(output, find) == 0) { | ||
34 | add_output = false; | 37 | add_output = false; |
35 | break; | 38 | break; |
36 | } | 39 | } |
diff --git a/sway/commands/bar/status_command.c b/sway/commands/bar/status_command.c index 77a73ab6..bb92e8e0 100644 --- a/sway/commands/bar/status_command.c +++ b/sway/commands/bar/status_command.c | |||
@@ -19,10 +19,5 @@ struct cmd_results *bar_cmd_status_command(int argc, char **argv) { | |||
19 | } else { | 19 | } else { |
20 | free(new_command); | 20 | free(new_command); |
21 | } | 21 | } |
22 | |||
23 | if (config->active && !config->validating) { | ||
24 | load_swaybar(config->current_bar); | ||
25 | } | ||
26 | |||
27 | return cmd_results_new(CMD_SUCCESS, NULL); | 22 | return cmd_results_new(CMD_SUCCESS, NULL); |
28 | } | 23 | } |
diff --git a/sway/commands/bar/tray_output.c b/sway/commands/bar/tray_output.c index 8bfdf193..eb3b486e 100644 --- a/sway/commands/bar/tray_output.c +++ b/sway/commands/bar/tray_output.c | |||
@@ -24,9 +24,21 @@ struct cmd_results *bar_cmd_tray_output(int argc, char **argv) { | |||
24 | free(outputs->items[i]); | 24 | free(outputs->items[i]); |
25 | } | 25 | } |
26 | outputs->length = 0; | 26 | outputs->length = 0; |
27 | } else if (strcmp(argv[0], "*") == 0) { | ||
28 | sway_log(SWAY_DEBUG, "Showing tray on all outputs for bar: %s", | ||
29 | config->current_bar->id); | ||
30 | while (outputs->length) { | ||
31 | free(outputs->items[0]); | ||
32 | list_del(outputs, 0); | ||
33 | } | ||
34 | return cmd_results_new(CMD_SUCCESS, NULL); | ||
27 | } else { | 35 | } else { |
28 | sway_log(SWAY_DEBUG, "Showing tray on output '%s' for bar: %s", argv[0], | 36 | sway_log(SWAY_DEBUG, "Showing tray on output '%s' for bar: %s", argv[0], |
29 | config->current_bar->id); | 37 | config->current_bar->id); |
38 | if (outputs->length == 1 && strcmp(outputs->items[0], "none") == 0) { | ||
39 | free(outputs->items[0]); | ||
40 | list_del(outputs, 0); | ||
41 | } | ||
30 | } | 42 | } |
31 | list_add(outputs, strdup(argv[0])); | 43 | list_add(outputs, strdup(argv[0])); |
32 | 44 | ||
diff --git a/sway/config/bar.c b/sway/config/bar.c index 4ab98ff1..9c30204e 100644 --- a/sway/config/bar.c +++ b/sway/config/bar.c | |||
@@ -172,7 +172,6 @@ struct bar_config *default_bar_config(void) { | |||
172 | wl_list_init(&bar->tray_bindings); | 172 | wl_list_init(&bar->tray_bindings); |
173 | #endif | 173 | #endif |
174 | 174 | ||
175 | list_add(config->bars, bar); | ||
176 | return bar; | 175 | return bar; |
177 | cleanup: | 176 | cleanup: |
178 | free_bar_config(bar); | 177 | free_bar_config(bar); |
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 |
diff --git a/sway/sway.5.scd b/sway/sway.5.scd index 280b6176..d6ba2e11 100644 --- a/sway/sway.5.scd +++ b/sway/sway.5.scd | |||
@@ -755,18 +755,6 @@ The default colors are: | |||
755 | *workspace_layout* default|stacking|tabbed | 755 | *workspace_layout* default|stacking|tabbed |
756 | Specifies the initial layout for new workspaces. | 756 | Specifies the initial layout for new workspaces. |
757 | 757 | ||
758 | # BAR CONTROL | ||
759 | |||
760 | *bar hidden_state* hide|show|toggle [<bar_id>] | ||
761 | Sets the hidden state of the bar (see *sway-bar*(5)), either individually, | ||
762 | by specifying a bar id, or if none is given, for all bar instances. | ||
763 | _toggle_ switches between _hide_ and _show_. | ||
764 | |||
765 | *bar mode* dock|hide|invisible|toggle [<bar_id>] | ||
766 | Sets the mode of the bar (see *sway-bar*(5)), either individually, | ||
767 | by specifying a bar id, or if none is given, for all bar instances. | ||
768 | _toggle_ switches between _dock_ and _hide_. | ||
769 | |||
770 | # CRITERIA | 758 | # CRITERIA |
771 | 759 | ||
772 | A criteria is a string in the form of, for example: | 760 | A criteria is a string in the form of, for example: |