Commit Graph

2295 Commits

Author SHA1 Message Date
patrick96
4d1758457b fix(ipc): Clear output until initial hook finishes
Before, it just showed '%output%'

Fixes #3131
2024-08-01 11:15:48 +02:00
patrick96
baed54bc76 doc: Improve tray documentation
Unaware users may be confused by why the tray module is not shown in the
default config and if they add it, they may be confused why only one of
their bars shows the module.
2024-08-01 11:09:46 +02:00
Isak05
81ea16931e
fix(script): Receiving multiple lines rapidly only displays first line (#3119)
Fixes #3117
2024-04-28 21:10:12 +02:00
patrick96
ab583b08cd fix(tray): Clients not being removed properly
The vector::erase call needs to be supplied with the end of the range,
otherwise only a single element is removed.

Fixes #3111
2024-04-15 23:43:25 +02:00
patrick96
c8f7dc1c14 fix(i3): Properly render non-full-width windows
Without override-redirect, i3 will not allow you to have a
non-full-width bar. But polybar simply ignores that request and
continues to render the user-requested width instead of the width i3 has
configured the window to be.

With the 3.7 release, we started setting the window's backing pixmap to
the rendering pixmap. In the case above, the pixmap would only be
allocted for the smaller width and when i3 maps the window, it repeats
the backing pixmap to fill the entire window.

At the point where i3 maps the window, the pixmap contains an initial
render of the bar without module content and that render is then
duplicated.

Reverting back to the old approach of simply copying over the pixmap
after each render does not have that problem and the remainder of the
bar is black (or fully transparent with a compositor).

Ideally, polybar would respect the width i3 configures for it, but that
would break many existing setups that rely on non-full-width bars in i3

Fixes #3060
2024-02-18 19:02:30 +01:00
Patrick Ziegler
020699724f
fix(label): Misbehaving min-length tokens with non-ASCII characters (#3090)
* Changed bit count for label to use UTF8 standard

Fixes #3074

* label: Calculate length only once

The length calculation has to traverse the whole string

---------

Co-authored-by: nklloyd <nicholask.lloyd@gmail.com>
2024-02-10 12:51:34 +01:00
Patrick Ziegler
8e04f15ed6
fix(backlight): %backlight% token appearing on the bar (#3081)
* Fix backlight initial value matching the actual brightness level

The initial value is `0`. If the actual brightness is also `0` you see
`%percentage%` token as text, it’s not being replaced. Since
`m_brightness` is an `int` the initial value could be just `-1` since
the actual brightness is never goes below zero. Thus this bug will never
show up again because actual brightness on first render won’t match
the “old” `m_brightness` value.

See also for more detailed explanation of the bug:
https://github.com/polybar/polybar/discussions/3079#discussioncomment-8169932

* Add docs

---------

Co-authored-by: Viacheslav Lotsmanov <lotsmanov89@gmail.com>
2024-01-20 18:09:12 +01:00
patrick96
0ed669f049
fix(doc): Update vulnerable rtd search extension
Ref: https://github.com/readthedocs/readthedocs-sphinx-search/security/advisories/GHSA-xgfm-fjx6-62mj
2024-01-20 17:53:28 +01:00
patrick96
91bd85cf50
Version 3.7.1 2023-11-27 17:15:23 +01:00
patrick96
ade2ee0981 build: Update i3ipcpp
Closes #3042
Includes polybar/i3ipcpp#16
2023-11-27 15:53:30 +01:00
patrick96
c552df3b66 fix: Modules did not validate tags used in formats
The 'value' variable that was used for validation, was empty because it
was used in a move at the beginning of the function.

Fixes #3043
2023-11-16 22:29:00 +01:00
patrick96
432e19df01 build: Add missing headers in common.hpp 2023-11-12 15:18:34 +01:00
patrick96
cbfbba0700 Remove tray_visibility signal
No longer needed since tray visibility is now controlled directly by the
enclosing module
2023-11-11 04:01:26 +01:00
patrick96
8566051336 fix(tray): Allow module to disappear for empty tray
Modules that don't produce any output are hidden by the controller
(don't have margins or separators).
The tray module should also do that for `format = <tray>` when there are
no icons.

This required the visibility handling to be tied to the module
visibility instead of being handled by the renderer.
Otherwise, the renderer would hide the tray (because the %{Pt} tag was
never sent) and the tray would not unhide when new icons appeared; it
can't differentiate between hidden because empty and hidden because the
module is hidden by the user (the latter is the reason the renderer does
hiding at all).

Fixes #3036
2023-11-11 04:01:26 +01:00
patrick96
2471f3595c
Version 3.7.0 2023-11-05 23:36:13 +01:00
patrick96
cd57c1252c
Write migration guide for the content in custom/text 2023-11-05 22:53:09 +01:00
patrick96
ea3b47a65e
Improve release workflow documentation 2023-11-05 22:05:43 +01:00
patrick96
70c400d20d
doc: Specify boxes to check in GitHub release tool 2023-11-05 22:05:43 +01:00
patrick96
f8983e2bd3
Remove colon from download header 2023-11-05 22:05:40 +01:00
Tony Zorman
f7a755799c feat(xworkspaces): Add group-by-monitor flag
By default, we group workspaces by monitor with the help of
_NET_DESKTOP_VIEWPORT.  However, some users may experience this as an
unpredictable "shuffling" of workspaces.  While WMs could disable
advertising the property itself, it seems more sensible to handle this
at the level of polybar.  Hence, introduce a new group-by-monitor
flag—defaulting to true—which can be used to disable this behaviour.

Closes: https://github.com/polybar/polybar/issues/2603
Related: https://github.com/xmonad/xmonad-contrib/pull/791
Related: https://github.com/qtile/qtile/issues/3375

Co-authored-by: scaramangado <scaramangado@gmail.com>
2023-10-29 16:15:10 +01:00
patrick96
0a19c5e3d7 doc: Bump sphinx-rtd-theme to version 2
The notfound plugin (404 page) does not seem to work with older versions
of the theme.
2023-10-23 01:08:14 +02:00
patrick96
eaa3ba5f83 doc: Fix sphinx version 2023-10-23 00:32:46 +02:00
patrick96
7972c20fe9 fix(xpp): Allow for custom python executable
Includes polybar/xpp#34
2023-10-23 00:32:46 +02:00
patrick96
38f67f4269 doc: Add sphinx 404 page 2023-10-23 00:32:46 +02:00
patrick96
6a648c8ef7 doc: Update readthedocs URLs
There is a redirect setup that redirects anything to `/en/stable` (or
whatever the default version is).
This allows us to create version-agnostic direct links that always
redirect to the default version
2023-10-23 00:32:46 +02:00
patrick96
054b9f4d33 docs: Add banner for 'latest' version 2023-10-23 00:32:46 +02:00
patrick96
80aa2bade5 build: Fix cmake warnings in submodules
Includes polybar/xpp#33
Includes polybar/i3ipcpp#15
2023-10-22 15:40:33 +02:00
patrick96
aebdb5328a fix(backlight): Poll if necessary
The `backlight` file seems to not receive modification events for
inotify (it does receive other events though).
These other events still trigger an update, but the value read is still
the old value because the events arrive just slightly before the file is
updated.

The new `poll-interval` setting will inject an event every X seconds to
force an update.
If the actual_brightness file is used, the interval is set to 0 and thus
turned off.

This does not add any more wakeups to the module, the inotify modules
wake up every second anyway and during that time, the interval is
checked.

Fixes #2835
2023-10-21 20:32:11 +02:00
patrick96
278584fa27 feat(doc): Add rtd search extension
Provides real-time search on readthedocs

Ref: https://readthedocs-sphinx-search.readthedocs.io
2023-10-08 21:24:37 +02:00
patrick96
19e8d53320 doc: Explicitly specify sphinx rtd theme dependency
Since August 7, 2023, readthedocs will not install the rtd theme by
default anymore.

Ref: https://blog.readthedocs.com/python-core-requirements-changed/
2023-10-08 21:16:21 +02:00
patrick96
c9752598a5 fix(bspwm): Restack against topmost root window.
The ewmh strategy has to be dropped because the
`_NET_SUPPORTING_WM_CHECK` window may (at least in bspwm) appear
anywhere in the window stack.

To fix the overlapping monitors issue in #2873, we simply restack
against the topmost of these root windows.

Fixes #2972
Fixes #2873 (again)
2023-10-08 21:04:29 +02:00
patrick96
1bfe117c5d Document recommendations for nerd fonts 2023-09-30 19:32:48 +02:00
patrick96
16102c258a alsa: include asoundlib.h instead of all alsa headers
In alsa 1.2.10, the `alsa/control.h` header cannot be included on its
own because it does not include all symbols it uses.

We are basically duplicating asoundlib.h anyway and there is even a
macro variable to switch to it.

Ref: #3009
Ref: https://github.com/alsa-project/alsa-lib/issues/348
2023-09-28 19:30:49 +02:00
patrick96
53661e995a doc: Fix FreeBSD link 2023-08-20 11:59:43 +02:00
patrick96
1043354aec tray: Deprecate all legacy tray settings 2023-08-06 15:26:28 +02:00
patrick96
97ce1f6e7a Add inactive tray module to default config
Replaces the commented out `tray-position`
2023-08-06 15:26:28 +02:00
dvermd
b754790642
Cleanup base::tags (#2991) 2023-07-06 09:46:33 +02:00
Andrew Tran
c747599ef5
fix(tray): check for visibility when docking (#2973)
Fixes #2968
2023-06-13 11:25:36 +02:00
Vincent Bernat
2cd0809a46
fix(randr): avoid querying hardware to get current configuration (#2470)
When using `get_screen_resources`, XRandR will query the hardware to
detect any change. This takes some time.
`get_screen_resources_current` uses the cached information and is
pretty fast.

In my case, the information is always already present in cache because
it was set by the program that did configure the screens (autorandr in
my case, but this applies to most frontends). As polybar is not used
to configure stuff, I think this is fine. There should be something
configuring the screen before polybar is able to use it.

However, maybe some people are using `polybar --list-monitors` just
after plugging a screen. It won't display the new screen in this case.
So, maybe this is not a good idea. It makes polybar starts
faster (500ms faster in my case when there are 3 screens plugged).
Also, I did this change because running `polybar --list-monitor` in
parallel with starting `polybar` (in a for loop for example), I get
some curious bug where my screens disappear and reappear. I don't need
this change as this was easy to fix by avoiding the parallel access to
XRandR properties, but maybe this would avoid other people running
into the same problem.

Your take!
2023-05-18 11:29:30 +02:00
dvermd
06a3de0b89
Refactor config::dereference* (#2963)
* Refactor config::dereference*

* move config::deprecated* implementation to cpp file

* config: move more functions implementation to cpp file
2023-05-18 09:47:45 +02:00
patrick96
ea3eb6eaa4 ci: Update ubuntu version 2023-05-15 14:44:50 +02:00
patrick96
4d1bba2c4e Add changelog 2023-05-15 14:44:50 +02:00
patrick96
2c23f7a87f restack: Make bspwm first try ewmh strategy 2023-05-15 14:44:50 +02:00
patrick96
4f9f07eefd restack: Add ewmh restacking strategy
Positions the bar window above the _NET_SUPPORTING_WM_CHECK window

The generic restacking strategy now first tries the ewmh strategy, the
the bottom strategy.
2023-05-15 14:44:50 +02:00
patrick96
b11a2ff653 restack: Add bottom restacking strategy
For now this is the same as the generic one
2023-05-15 14:44:50 +02:00
patrick96
59acb4150b Clean up restacking code
Restacking algorithms now only need to provide the sibling window and
stacking mode.
2023-05-15 14:44:50 +02:00
patrick96
76c7ee3bf6 Introduce restacking utilities
Aim is to clean up restacking logic and remove some duplicated code
2023-05-15 14:44:50 +02:00
patrick96
f78ec80df3 Add changelog entry 2023-05-10 17:06:00 +02:00
patrick96
425d4dc338 Cleanup 2023-05-10 17:06:00 +02:00
patrick96
32c78aa63a Cleanup ucs4_to_utf8 2023-05-10 17:06:00 +02:00