ce93188a4a
* add units support (POINT, PIXEL, SPACE) for polybar - add a size_with_unit struct - add a geometry_format_values struct - move dpi initialisation from renderer.cpp to bar.cpp - add a string to size_with_unit converter - add point support (with pt) - add pixel support (with px) * Fix unit test compilation * clang-format * Better names The old names didn't really capture the purpose of the structs and function. space_type -> spacing_type space_size -> spacing_val size_type -> extent_type geometry -> extent_val geometry_format_values -> percentage_with_offset * Remove parse_size_with_unit No longer needed. The convert<spacing_val> function in config.cpp already does all the work for us and always setting the type to pixel was wrong. In addition, line-size should not be of type spacing_val but extent_val. * Cleanup I tried to address most of my comments on the old PR * Fix renderer width calculation We can't just blindly add the x difference to the width because for example the width should increase if x < width and the increase keeps x < width. Similarly, we can't just add the offset to the width. * Rename geom_format_to_pixels to percentage_with_offset_to_pixel * Cleanup * Apply suggested changes from Patrick on GitHub Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com> * Update src/components/bar.cpp Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com> * Update src/components/config.cpp Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com> * Update src/components/builder.cpp Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com> * Update src/components/builder.cpp Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com> * config: Use stod for parsing percentage * Use stof instead of strtof * units: Fix test edge cases * Remove unnecessary clang-format toggle * Use percentage_with_offset for margin-{top,bottom} * Support negative extent values * Rename unit to units and create a cpp file * Move percentage_with_offset_to_pixel unit test to units * Add unit tests for units_utils * Clarify when and how negative spacing/extent is allowed Negative spacing is never allowed and produces a config error. Extents allow negative values in theory, but only a few use-cases accept it. Only the extent value used for the `%{O}` tag and the offset value in percentage_with_offset can be negative. Everything else is capped below at 0. The final pixel value of percentage_with_offset also caps below at 0. * Fix parsing errors not being caught in config * Print a proper error message for uncaught exceptions * Cleanup module::get_output All changes preserve the existing semantics * Stop using remove_trailing_space in module::get_output Instead, we first check if the current tag is built, and only if it is, the spacing is prepended. * Remove unused imports * Restore old behavior If there are two tags and the second one isn't built (module::build returns false), the space in between them is removed. For example in the mpd module: format-online = <toggle> <label-song> foo If mpd is not running, the mpd module will return false when trying to build the `<label-song>` tag. If we don't remove the space between `<toggle>` and `<label-song>`, we end up with two spaces between `<toggle>` and `foo`. This change is to match the old behavior where at least one trailing space character was removed from the builder. * Add changelog entry * Remove unused setting * Use percentage with offset for tray-offset Co-authored-by: Jérôme BOULMIER <jerome.boulmier@outlook.fr> Co-authored-by: Joe Groocock <github@frebib.net>
14 KiB
14 KiB
Changelog
All notable changes to this project will be documented in this file.
Each release should have the following subsections, if entries exist, in the
given order: Breaking
, Build
, Deprecated
, Removed
, Added
, Changed
,
Fixed
, Security
.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
Breaking
- We added the backslash escape character (\) for configuration values. This
means that the literal backslash character now has special meaning in
configuration files, therefore if you want to use it in a value as a literal
backslash, you need to escape it with the backslash escape character. The
parser logs an error if any unescaped backslashes are found in a value. This
affects you only if you are using two consecutive backslashes in a value,
which will now be interpreted as a single literal backslash.
#2354
- We rewrote our tag parser. This shouldn't break anything, if you experience
any problems, please let us know.
The new parser now gives errors for certain invalid tags where the old parser
would just silently ignore them. Adding extra text to the end of a valid tag
now produces an error. For example, tags like
%{T-a}
,%{T2abc}
,%{rfoo}
, and others will now start producing errors. This does not affect you unless you are producing your own formatting tags (for example in a script) and you are using one of these invalid tags. - For security reasons, the named pipe at
/tmp/polybar_mqueue.<PID>
had its permission bits changed from666
to600
to prevent sending ipc messages to polybar processes running under a different user.
Build
- New dependency: libuv. At least version 1.3 is required.
- Bump the minimum cmake version to 3.5
- The
BUILD_IPC_MSG
option has been renamed toBUILD_POLYBAR_MSG
- Building the documentation is now enabled by default and not just when
sphinx-build
is found. - Users can control exactly which targets should be available with the following
cmake options (together with their default value):
BUILD_POLYBAR=ON
- Builds thepolybar
executableBUILD_POLYBAR_MSG=ON
- Builds thepolybar-msg
executableBUILD_TESTS=OFF
- Builds the test suiteBUILD_DOC=ON
- Builds the documentationBUILD_DOC_HTML=BUILD_DOC
- Builds the html documentation (depends onBUILD_DOC
)BUILD_DOC_MAN=BUILD_DOC
- Builds the manpages (depends onBUILD_DOC
)BUILD_CONFIG=ON
- Generates the default configBUILD_SHELL=ON
- Generates shell completion filesDISABLE_ALL=OFF
- Disables all above targets by default. Individual targets can still be enabled explicitly.
- The documentation can no longer be built by directly configuring the
doc
directory. - The sample config file is now placed in the
generated-sources
folder inside whatever folder you invokedcmake
from instead of in the root folder of the repository. - The
POLYBAR_FLAGS
cmake variable can be used to pass extra C++ compiler flags. - The sample config file has been removed.
- Polybar now ships a default config that is installed to
/etc/polybar/config.ini
, it lives indoc/config.ini
. It will also be placed in theexamples
directory in the documentation folder.#2405
- The
userconfig
target has been removed, you can no longer usemake userconfig
. As an alternative, you can copy the default config from/etc/polybar/config.ini
.
Deprecated
[settings]
:throttle-output
andthrottle-output-for
have been removed. The new event loop already does a similar thing where it coalesces update triggers if they happen directly after one another, leading to only a single bar update.- When not specifying the config file with
--config
, naming your config fileconfig
is deprecated. Rename your config file toconfig.ini
. - Directly writing ipc messages to
/tmp/polybar_mqueue.<PID>
is deprecated, users should always usepolybar-msg
. As a consequence the message format used for IPC is deprecated as well. polybar-msg hook
is deprecated in favor of using the hook action.polybar-msg
will tell you the correct command to use.
Removed
DEBUG_SHADED
cmake variable and its associated functionality.
Added
- Support
px
andpt
units everyhwere where before only a number of spaces or pixels could be specified. (#2578
) - Right and middle click events for alsa module.
(
#2566
) internal/network
: New token%mac%
shows MAC address of selected interface (#2568
)- Polybar can now read config files from stdin:
polybar -c /dev/stdin
. custom/script
: Implementenv-*
config option. (#2090
)drawtypes/ramp
: Add support for ramp weights. (#1750
)internal/memory
: New tokens%used%
,%free%
,%total%
,%swap_total%
,%swap_free%
, and%swap_used%
that automatically switch between MiB and GiB when below or above 1GiB. (#2472
)- Option to always show urgent windows in i3 module when
pin-workspace
is active (#2374
) internal/xworkspaces
:reverse-scroll
can be used to reverse the scroll direction when cycling through desktops.- The backslash escape character (\).
#2354
- Warn states for the cpu, memory, fs, and battery modules.
(
#570
,#956
,#1871
,#2141
)internal/battery
:format-low
,label-low
,animation-low
,low-at = 10
.internal/cpu
:format-warn
,label-warn
,warn-percentage = 80
internal/fs
:format-warn
,label-warn
,warn-percentage = 90
internal/memory
:format-warn
,label-warn
,warn-percentage = 90
radius
now affects the bar border as well (#1566
)- Per-corner radius with
radius-{bottom,top}-{left,right}
(#2294
) internal/network
:speed-unit = B/s
can be used to customize how network speeds are displayed.internal/xkeyboard
:%variant%
can be used to parse the layout variant (#316
)- Config option to hide a certain module
(
hidden = false
) (#2108
) - Actions to control visibility of modules
(
module_toggle
,module_show
, andmodule_hide
) (#2108
) internal/xworkspaces
: Make the urgent hint persistent (#1081
)internal/network
:interface-type
may be used in place ofinterface
to automatically select a network interface (#2025
)internal/xworkspaces
:%nwin%
can be used to display the number of open windows per workspace (#604
)internal/backlight
: addeduse-actual-brightness
option- Added
wm-restack = generic
option that lowers polybar to the bottom of the stack. Fixes the issue where the bar is being drawn on top of fullscreen windows in xmonad. (#2205
) - Added
occupied-scroll = true
option to bspwm module. Allows scrolling only through occupied desktops only. (#2427
) custom/ipc
:send
action to send arbitrary strings to be displayed in the module. (#2455
)- Added
double-click-interval
setting to the bar section to control the time interval in which a double-click is recognized. Defaults to 400 (ms) (#1441
) internal/xkeyboard
: Allow configuring icons using variant (#2414
)custom/ipc
: Addhook
,next
,prev
,reset
actions to the ipc module (#2464
)- Added a new
tray-foreground
setting to give hints to tray icons about what color they should be. (#2235) polybar-msg
:- For module actions, you can now also specify the module name, action name, and optional data as separate arguments.
- Added man page
internal/network
: New token%netspeed%
that provides the total speed of the internet (up + down speed) (#2590)
Changed
- Polybar now also reads
config.ini
when searching for config files. (#2323
) - Polybar additionally searches in
XDG_CONFIG_DIRS/polybar
(or/etc/xdg/polybar
if it is not set) and/etc/polybar
for config files (onlyconfig.ini
). (#2016
) - We rewrote polybar's main event loop. This shouldn't change any behavior for the user, but be on the lookout for X events, click events, or ipc messages not arriving and the bar not shutting down/restarting properly and let us know if you find any issues.
- Slight changes to the value ranges the different ramp levels are responsible for in the cpu, memory, fs, and battery modules. The first and last level are only used for everything at or below and at and above the edges of the value range, respectively. The other levels are evenly distributed over the value range as before.
custom/script
:interval
now defaults to 0 iftail = true
as per the documentation.internal/network
:- Increased precision for upload and download speeds: 0 decimal places for KB/s (as before), 1 for MB/s and 2 for GB/s.
- Clicks arriving in close succession, no longer get dropped. Before polybar would drop any click that arrived within 5ms of the previous one.
- Increased the double click interval from 150ms to 400ms.
- Stop ignoring actions if they arrive while the previous one hasn't been processed yet.
(
#2469
) - Polybar can now be run without passing the bar name as argument given that
the configuration file only defines one bar
(
#2525
) include-directory
andinclude-file
now support relative paths. The paths are relative to the folder of the file where those directives appear. (#2523
)custom/ipc
: Empty output strings are no longer formatted. This prevents extraneous spaces and separators from appearing in the bar when the output of an ipc module is empty.
Fixed
custom/script
: Concurrency issues with fast-updating tailed scripts. (#1978
)- Trailing space after the layout label when indicators are empty and made sure right amount
of spacing is added between the indicator labels, in the xkeyboard module.
(
#2292
) - Parser error if click command contained
}
(#2040
) - Slight imprecision when calculating percentages. This caused the volume
reported by alsa to be off by one.
(
#2399
) internal/backlight
: With amdgpu backlights, the brightness indicator was slightly behind. (#2367
)- Warning message regarding T@ in bspwm module
(
#2371
) polybar -m
used to show both physical outputs and randr monitors, even if the outputs were covered by monitors. (#2481
)internal/xworkspaces
:internal/network
: The module now properly supports 'altnames' for interfaces.internal/battery
: More accurate battery state (#2563
)- Some modules stop updating when system time moves backwards. (
#857
,#1932
)
3.5.7 - 2021-09-21
Fixed
- The tray mistakenly removed tray icons that did not support XEMBED
(
#2479
,#2442
) custom/ipc
: Only the first appearance of the%pid%
token was replaced (#2500
)
3.5.6 - 2021-05-24
Build
- Support building documentation on sphinx 4.0 (
#2424
)
Fixed
3.5.5 - 2021-03-01
Build
- Support older python sphinx versions again (
#2356
)
3.5.4 - 2021-01-07
Fixed
- Wrong text displayed if module text ends with
}
(#2331
)
3.5.3 - 2020-12-23
Build
- Don't use
git
when building documentation (#2309
)
Fixed
- Empty color values are no longer treated as invalid and no longer produce an error.