aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar
Commit message (Collapse)AuthorAge
* Define _POSIX_C_SOURCE globallyLibravatar Simon Ser2024-02-23
| | | | See discussion in https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4555
* common: move load_image to swaybarLibravatar Manuel Stoeckl2023-11-23
| | | | | swaynag, swaymsg, and sway do not use this function and are unlikely to in the future.
* common: rename load_background_image to load_imageLibravatar Manuel Stoeckl2023-11-23
|
* swaybar: Implement wp_cursor_shape_v1Libravatar Alexander Orzechowski2023-07-31
|
* swaybar: handle wayland-cursor failuresLibravatar Manuel Stoeckl2023-07-08
| | | | | | Updating the cursor is not essential, so this change prints a warning when wl_cursor_theme_load or wl_cursor_theme_get_cursor fail instead of crashing or exiting.
* swaybar: don't set current workspace as not visibleLibravatar llyyr2023-06-27
| | | | | | | When `wrap_scroll yes` is configured and there's only one workspace open, swaybar will mark it as not visible if the user scrolls on it and eventually incorrectly fail the `active->visible` assert. Fix this by making sure that new and current workspace aren't the same.
* Use "default" XCursor instead of "left_ptr"Libravatar Simon Ser2023-06-25
| | | | | "left_ptr" is the legacy XCursor name. "default" is the cursor spec name.
* swaybar: remove the argument of StatusNotifierHostRegisteredLibravatar Hodong2023-06-23
| | | | | According to https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNotifierWatcher/ there is no argument for the StatusNotifierHostRegistered signal.
* swaybar: always subscribe to mode and workspaceLibravatar Mukundan3142023-05-09
| | | | | always subscribe to mode and workspace events, since we might need them after bar config updates even if we don't need them initially.
* Use format_str() throughoutLibravatar Simon Ser2023-04-14
|
* swaybar: Lift background clearing out of main rendering functionLibravatar Alexander Orzechowski2023-04-02
| | | | | | | | | This avoids us from using a bogus background_color value that mutates as swaybar renders things and deciding opacity depending on that. Also remove a redundant full surface clear. Just directly write our desired background color.
* swaybar: Set opaque region properlyLibravatar Alexander Orzechowski2023-04-02
| | | | The opaque region is set incorrectly if updated on-the-fly if switching from an opaque to a non opaque background.
* sway{,bar}: use default font hint styleLibravatar llyyr2023-02-27
| | | | | | | | | | CAIRO_HINT_STYLE_FULL attempts to maximize contrast at the expense of fidelity, this makes most fonts that haven't been hand hinted, which makes up the majority of fonts out there, appear much worse. In the absence of explicitly set hint style, cairo will default to CAIRO_HINT_STYLE_SLIGHT, which attempts to improve contrast while retaining fidelity to the original shapes, which is what we want.
* Use correct length for strncmp comparisonLibravatar Carl Smedstad2023-01-03
|
* swaybar: Make hotspots block bar release bindingsLibravatar Joan Bruguera2022-11-26
| | | | | | | | | | | | | | | | | | | | | | The previous commit prioritized hotspots before bar bindings for press events, which matches i3's behaviour. However, since hotspots don't need to do any processing on release events, those were not handled, and simply fell through to `bindsym --release` bar bindings (if any). This is counter-intuitive, and doesn't match i3's behaviour. Instead in case a hotspot handles the press event, it should also handle the release event, doing nothing, but blocking the event from triggering a --release bar binding. E.g., in Sway, without this commit, this config. shows a text on tray clicks: bar { # ... bindsym --release button1 exec swaynag -m I_got_the_release_event. } But the same configuration in i3 (with i3-nagbar) doesn't show the text. Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
* swaybar: Prioritize hotspot events to bar bindingsLibravatar Joan Bruguera2022-11-26
| | | | | | | | | | | | | | | | | This is consistent with i3bar's behaviour, and for example, allows binding a command to button1, while still being able to click on tray icons or other zones on the bar's status line which may have their own bindings. E.g., in Sway, without this commit, this config. makes tray icons unclickable: bar { # ... bindsym button1 exec swaynag -m You_clicked_the_tray._Want_some_help? } But the same configuration in i3 (with i3-nagbar) keeps tray items clickable. Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
* build: drop intermediate libraries for protocolsLibravatar Simon Ser2022-11-25
|
* Reuse parsed PangoFontDescriptionLibravatar Hugo Osvaldo Barrera2022-07-01
| | | | Avoids parsing the configured font each time text is rendered.
* swaybar: set opaque regionLibravatar Simon Ser2022-03-14
| | | | | When the background color is fully opaque, set the surface's opaque region to the whole surface.
* swaybar: remove swaybar_output.input_regionLibravatar Simon Ser2022-03-14
| | | | | No need to keep the region around, we can immediately destroy it after the wl_surface.set_input_region request.
* tray: do not render passive itemsLibravatar Tobias Bengfort2022-01-19
| | | | https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNotifierItem/#org.freedesktop.statusnotifieritem.status
* swaybar: fix tray item icon scaling, positioningLibravatar Nathan Schulte2022-01-07
|
* swaybar: fix tray_padding vs min-height re: scaleLibravatar Nathan Schulte2022-01-07
| | | | Co-authored-by: xdavidwu <xdavidwuph@gmail.com>
* swaybar: fix errno handling in status_handle_readableLibravatar Simon Ser2021-12-21
| | | | | If getline fails once, it was not reset before the next getline call. errno is only overwritten by getline on error.
* swaynag: remove xdg-output logicLibravatar Simon Ser2021-12-13
| | | | | We can just get the output name from wl_output directly, now that wl_output version 4 exists.
* swaybar: signal status command's process groupLibravatar Ludvig Michaelsson2021-11-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the status command a process group leader and change the kill(2) calls to target the new process group. Signals sent by swaybar will then be received by both the status command and its children, if any. While here, check the result of fork(2). Without this, children spawned by the status command may not receive the signals sent by swaybar. As a result, these children may be orphaned on reload. The issue could be shown by setting the bar to bar { status_command i3status | tee /tmp/i3status.out } which would leave orphaned processes for each reload of sway $ ps o pid,ppid,cmd | grep i3status | grep -v grep 43633 43624 sh -c i3status | tee /tmp/i3status.out 43634 43633 i3status 43635 43633 tee /tmp/i3status.out $ swaymsg reload $ ps o pid,ppid,cmd | grep i3status | grep -v grep 43634 1 i3status 43635 1 tee /tmp/i3status.out 43801 43788 sh -c i3status | tee /tmp/i3status.out 43802 43801 i3status 43803 43801 tee /tmp/i3status.out This fixes #5584.
* refactor: use JSON_MAX_DEPTH everywhereLibravatar Jason Nader2021-10-25
|
* swaybar: fix cairo_font_options leakLibravatar Nathan Schulte2021-10-08
|
* swaybar: properly draw blocks with transparent black borderLibravatar Nathan Schulte2021-09-20
| | | | | | while the draw itself is a no-op, alignment must still be accounted this requires more signalling about the blocks (border_set; was the border set?)
* swaybar: properly draw urgent block right borderLibravatar Nathan Schulte2021-09-15
| | | | | introduced via #3287 -- https://github.com/swaywm/sway/pull/3287/files#diff-a1e918ce0bc71f4f7934767541319e724a51a34a5418ecdc286065e50921eda4L239 uncovered via #3394 -- https://github.com/swaywm/sway/pull/3394/files#diff-a1e918ce0bc71f4f7934767541319e724a51a34a5418ecdc286065e50921eda4R258
* Rename pango_printf to render_textLibravatar Simon Ser2021-09-13
| | | | | This avoids using the pango_ prefix, reserved for functions coming from the Pango library.
* Simplify swaybar/swaynag scaling codeLibravatar Caduser20202021-09-12
| | | | | Use `cairo_scale` to set the scale factor, removing redundant multiplications by `output->scale`.
* swaybar: log Wayland display errorsLibravatar Simon Ser2021-07-26
|
* swaybar: exit cleanly when disconnected from IPCLibravatar Simon Ser2021-07-26
|
* cairo: Replace <cairo/cairo.h> by <cairo.h>Libravatar Issam E. Maghni2021-05-10
| | | | | | | For full context, read https://gitlab.freedesktop.org/cairo/cairo/-/issues/479 TL;DR, cairo’s pc file adds `/cairo` to CFLAGS. So namespace cairo shouldn’t be used.
* swaybar: fail gracefully on tokener creation failLibravatar Tudor Brindus2021-03-22
| | | | | | | | | | | | | | | This commit adds missing error-handling to the creation of the tokener instance. The stack depth parameter is used to initialize an array that json-c prefaults ahead of time, causing INT_MAX to result in out of memory errors. Also drop the depth to 256 to prevent this OOM. Though this fix is not very satisfactory -- json-c could be made to not prefault -- it should do for now. At the very least, swaybar will not crash. Fixes #6126.
* swaybar: use INT_MAX max JSON depth when parsing IPC responseLibravatar Tudor Brindus2021-03-21
| | | | | | | | There's no inherent limit on the nesting Sway can generate, and the default used by `json_tokener_new`, 32, can plausibly be hit during regular usage. Fixes #6115.
* swaybar: Use position from wl_pointer.enterLibravatar Kenny Levinsen2021-03-20
| | | | | | | | | | | | Only wl_pointer.motion was used to update pointer position, which would cause issues if the pointer was not moved prior to wl_pointer.button. This also fixes touch input through wl_pointer emulation, which fires wl_pointer.button immediately after wl_pointer.enter. Copied from a similar fix made to swaynag. Closes: https://github.com/swaywm/sway/issues/6109
* swaybar: silence missing IconThemePath messageLibravatar Pi-Yueh Chuang2021-03-17
| | | | | | | | | | IconThemePath is not a standard property in XDG's StatusNotifierItem specification, so missing this property should not be logged as an error. This patch changes the log level to SWAY_DEBUG when swaybar queries the value of IconThemePath so that swaybar won't log the returned message as an error if IconThemePath does not exist. Closes: https://github.com/swaywm/sway/issues/6092
* swaybar: use text subpixel antialias only where it would look goodLibravatar Fenveireth2021-03-07
| | | | | | | | | | | | | | | | | | | | | Closes #5605 Text Subpixel antialiasing is : - FreeType makes glyph bitmaps containing coverage percentage for each subpixel, instead of pixel - Then draw by performing the blend for each subpixel, instead of pixel (e.g. dual-source blending in opengl) And there's only one Alpha channel, so this extra coverage data can't leave Cairo to reach the compositor through there. Therefore, it can't work as intended if output text alpha != bar background alpha. Disable it for those cases, enable it elsewhere As for color emojis, they are RGBA bitmaps. If drawn with text alpha=1.0 and background alpha=1.0 (should be completely opaque bar), then with 'CAIRO_OPERATOR_SOURCE' then texels with alpha < 1.0 result in a blend with whatever's behind the bar, instead of the bar background
* Make command line option lists constLibravatar Manuel Stoeckl2021-02-04
|
* Make Wayland request listeners static const when possibleLibravatar Manuel Stoeckl2021-02-04
|
* Changed fprintf(stdout,...) to printf(...) for more readable codeLibravatar SpizzyCoder2021-01-16
|
* Fix #5940Libravatar Mukundan3142021-01-11
| | | | Fallback to focused_statusline instead of statusline on focused output
* man: update maintainerLibravatar Simon Ser2021-01-08
| | | | | Also remove the AUTHORS section from swaybar-protocol(7), for consistency with the rest of the man pages.
* build: introduce sd-bus-provider optionLibravatar Simon Ser2020-12-09
| | | | This allows to select a specific provider for the sd-bus library.
* swaybar: don't expand separator_block_width if separator is falseLibravatar Ludvig Michaelsson2020-10-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | When swaybar receives the following JSON body [ { "full_text": "foo", "separator": false, "separator_block_width": 0 }, { "full_text": "bar" } ] it should not draw any separator or any space between the two blocks. However, since swaybar calculates that separator_block_width 0 is too small to fit any configured separator, it will override the separator_block_width with some non-zero value. This patch changes that such that the necessary separator_block_width is only expanded if the block has 'separator: true'. This should be in line to what i3 does, as its documentation of the i3bar protocol for separator states that "[...] if you disable the separator line, there will still be a gap after the block, unless you also use separator_block_width".
* Add support for workspace_min_width bar option.Libravatar Tarmack2020-10-11
|
* Document required '\n' in swaybar-protocolLibravatar Hubert Hirtz2020-08-04
| | | | | | | | | | | | | | | The following statusbar output is not considered by sway to be following the swaybar-protocol: {"version":1}[[{"full_text":"2.89","urgent":false}], However this one is: {"version":1}\n[[{"full_text":"2.89","urgent":false}], Both outputs contain a header with the required values and an unfinished array of objects with the required values, but the first one is showed verbatim.
* swaybar: allow status line cleanup to proceed when hiddenLibravatar Charmander2020-07-22
| | | | | | | | | | `determine_bar_visibility` stops and starts the status command process according to the bar’s visibility. If the bar was hidden during teardown, teardown would stall while waiting for the stopped status command process to exit. This resumes a stopped status command during teardown and allows, for example, sway to reload or quit without leaving a swaybar instance behind each time. Fixes #5536. CONT before TERM as requested in review.