aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/bar
Commit message (Collapse)AuthorAge
* Declare all struct cmd_handler arrays constLibravatar Manuel Stoeckl2021-02-04
| | | | And make the functions handling these arrays use const types.
* Add support for workspace_min_width bar option.Libravatar Tarmack2020-10-11
|
* cmd/bar/colors: fix dereference of null pointerLibravatar Antonin Décimo2020-07-30
| | | | | | `!*rgba` tests if the first byte of rgba isn't `'\0'`. `hex_to_rgba_hex` returns NULL if `parse_color` fails. There's a null pointer dereference in that case. The intended behavior is `!rgba`.
* treewide: fix typosLibravatar Torstein Husebø2020-02-18
|
* bar_cmd_colors: remove add_colorLibravatar Brian Ashworth2019-12-28
| | | | | | | | | | | | This is the third commit in a series of commits to refactor color handling in sway. This removes add_color from commands.c. It was only being used by bar_cmd_colors. This also changes the functions to use parse_color which is used to validate rgb(a) colors throughout the code base and is also what i3bar is using to parse the colors after they are passed over ipc. After parsing the color and ensuring it is valid, the rgba hex string is then generated using snprintf. This refactor also ensures that all the colors for the command are valid before applying any of them.
* swaybar: complete barconfig_update event handlingLibravatar Brian Ashworth2019-09-04
| | | | | | | | 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
* Fix memory leaksLibravatar Antonin Décimo2019-08-12
|
* bar: fix segfault with missing or invalid bar idLibravatar Alyssa Ross2019-05-17
| | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this patch, if I ran something like this, sway would crash: swaymsg bar height 50 or swaymsg bar not-a-bar-id color bg #ff0000 This was in contrast to other bar subcommands, like status_command, which would exit with a "No bar defined" message. The difference between the subcommands that crashed and the ones that exited was that some subcommands had a check to see if a bar was specified, while others just assumed that it had been and carried on until they segfaulted. Because this check was identical in every subcommand it was present in, and I couldn't think of a case where it would be valid to run a bar subcommand without specifying which bar to apply it to, I moved this check from individual subcommands into the bar command, which is already responsible for actually setting the specified bar. This reduced code duplication, and fixed the crash for the subcommands that were missing this check.
* Add unbindsym/unbindcode command for swaybarLibravatar Alex Maese2019-04-17
|
* swaybar: add overlay mode (fix #1620)Libravatar Milkey Mouse2019-02-24
| | | | | Overlay mode puts the bar above normal windows and passes through/ignores any touch/mouse/keyboard events that would be sent to it.
* fix double free for mode toggle if bar was invisibleLibravatar Rouven Czerwinski2019-02-10
| | | | | | | | | If the bar was set to "invisible" and subsequently "toggle" was send twice, the new mode was never set and the bar->mode was double freed. Fix this by not requiring the bar->mode to be "hide" and instead show it unconditionally, because it was either hidden or invisible. Fixes #3637
* bar_cmd_modifier: add support for noneLibravatar Brian Ashworth2019-02-08
| | | | | | | | sway-bar(5) documents `modifier none`, which comes from i3. This implements the functionality for `modifier none` since it was not previously implemented. The bar modifier toggles visibility of the bar when the bar mode is set to hide. When the bar modifier is set to `none`, the ability to toggle visibility of the bar will be disabled.
* Move sway-specific functions in common/util.c into sway/Libravatar M Stoeckl2019-01-21
| | | | | | Modifier handling functions were moved into sway/input/keyboard.c; opposite_direction for enum wlr_direction into sway/tree/output.c; and get_parent_pid into sway/tree/root.c .
* Replace wlr_log with sway_logLibravatar M Stoeckl2019-01-21
| | | | | | | | | | | | | This commit mostly duplicates the wlr_log functions, although with a sway_* prefix. (This is very similar to PR #2009.) However, the logging function no longer needs to be replaceable, so sway_log_init's second argument is used to set the exit callback for sway_abort. wlr_log_init is still invoked in sway/main.c This commit makes it easier to remove the wlroots dependency for the helper programs swaymsg, swaybg, swaybar, and swaynag.
* bar_cmd_tray_bind: Use mouse button helpersLibravatar Brian Ashworth2019-01-16
| | | | | | | | | | | | | | | | 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`.
* Remove now-unused "input" argument of cmd_results_newLibravatar M Stoeckl2019-01-14
| | | | | | | | | Patch tested by compiling with `__attribute__ ((format (printf, 2, 3)))` applied to `cmd_results_new`. String usage constants have been converted from pointers to arrays when encountered. General handler format strings were sometimes modified to include the old input string, especially for unknown command errors.
* Merge pull request #3344 from RedSoxFan/bar-mouse-bindings-improvedLibravatar Drew DeVault2019-01-13
|\ | | | | Improve mouse button parsing: bar mouse bindings
| * bar_cmd_bind: utilize mouse button helpersLibravatar Brian Ashworth2019-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This modifies `bar_cmd_bindsym` to use `get_mouse_bindsym` for parsing mouse buttons. This also introduces `cmd_bar_bindcode`, which will use `get_mouse_bindcode` for parsing mouse buttons. Like sway bindings, the two commands are encapsulated in a single file with shared code. This also modifies swaybar to operate off of event codes rather than x11 button numbers, which allows for any mouse button to be used. This introduces two new IPC properties: - For `get_bar_config`, `event_code` has been added to the `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`. - Likewise for `click_events`, `event` has been added and will include the event code for the button clicked. If the event code can be mapped to a x11 button, `button` will still be the x11 button number. Otherwise, `button` will be `0`.
* | swaybar: add status_edge_padding commandLibravatar Brian Ashworth2019-01-11
| | | | | | | | | | This adds the bar subcommand `status_edge_padding <padding>` to set the padding used when the status line is on the right edge of the bar.
* | swaybar: add status_padding commandLibravatar Brian Ashworth2019-01-11
|/ | | | | | Adds the bar subcommand `status_padding <padding>` which allows setting the padding used for swaybar. If `status_padding` is set to `0`, blocks will be able to take up the full height of the bar.
* swaybar: do not create tray if hiddenLibravatar Ian Fan2018-12-31
|
* swaybar: implement tray configLibravatar Ian Fan2018-12-31
|
* swaybar: fix focused_statusline color parsing.Libravatar Rune Morling2018-12-29
|
* list.c: rename free_flat_list to list_free_items_and_destroyLibravatar Ian Fan2018-12-09
|
* Cleanup list codeLibravatar Ian Fan2018-12-09
|
* Implement bar gapsLibravatar Brian Ashworth2018-11-28
| | | | | | | | | Adds the bar subcommand `gaps <amount>|<horizontal> <vertical>|<top> <right> <bottom> <left>` to set gaps for swaybar. Due to restrictions on margins for a layer_surface, only the sides that are anchored to an edge of the screen can have gaps. Since there is support for per-side outer gaps for workspaces, those should be able to be used instead for the last side.
* Replace _XOPEN_SOURCE with _POSIX_C_SOURCELibravatar emersion2018-11-25
| | | | And make sure we don't define both in the same source file.
* Merge pull request #3083 from c-edw/feature/StripWorkspaceNameLibravatar emersion2018-11-19
|\ | | | | Implement strip_workspace_name.
| * Implement strip_workspace_name.Libravatar Connor E2018-11-17
| |
* | Use parse_boolean where possible.Libravatar Connor E2018-11-10
|/
* commands: replace EXPECTED_LESS_THAN with EXPECTED_AT_MOSTLibravatar Ian Fan2018-10-23
| | | | This makes it a bit more obvious what the expected number of arguments is.
* commands: remove EXPECTED_MORE_THANLibravatar Ian Fan2018-10-23
| | | | Its uses have been replaced with EXPECTED_AT_LEAST.
* commands/bar: remove left and right from allowed positionsLibravatar Rouven Czerwinski2018-10-20
| | | | "left" and "right" are not allowed positions for swaybar, remove them.
* commands: fix sending bar mode/hidden_state updates to all barsLibravatar Ian Fan2018-10-14
| | | | | Previously, if a change was sent to all bars, it would only actually change the first bar it encountered, due to return value handling
* cmd_bar: fix bar id issuesLibravatar Brian Ashworth2018-10-13
| | | | | | Allows bar-subcommand to be a valid bar-ids Destroys runtime created bar if trying to use a config only subcommand Allow subcommands (except for id) to be ids
* bar_cmd_status_command: only reload current barLibravatar Brian Ashworth2018-10-13
| | | | | Ideally, this will be replaced with an IPC barconfig_update event in the near future
* bar-bindsym: address ianyfan's commentsLibravatar Brian Ashworth2018-10-09
|
* Implement bar bindsymLibravatar Brian Ashworth2018-10-09
|
* Fix memory leak in status_command handlerLibravatar emersion2018-10-08
|
* Allow status_command to be disabled via IPCLibravatar Ryan Dwyer2018-10-08
|
* swaybar: fix setting binding mode indicatorLibravatar Ian Fan2018-09-28
|
* bar: free old position when changingLibravatar Ian Fan2018-07-15
|
* Update for swaywm/wlroots#1126Libravatar emersion2018-07-09
|
* bar_cmd_modifier: fix use-after-free on errorLibravatar Dominique Martinet2018-07-02
| | | | Found through static analysis.
* bar_cmd_font: fix leak of fontLibravatar Dominique Martinet2018-07-02
| | | | | | join_args is a freshly allocated string and can be used as is. Found through static analysis.
* Address first round of review for generic blocksLibravatar Brian Ashworth2018-06-02
|
* Make command block implementation genericLibravatar Brian Ashworth2018-06-02
|
* Clean up imported bar commandsLibravatar Drew DeVault2018-03-29
|
* Add bar configuration commandsLibravatar Drew DeVault2018-03-29
|
* Move everything to sway/old/Libravatar Drew DeVault2017-11-18
|