Previously, when volume was in close proximity to n_max_volume, a larger
increase would not do anything. After this patch, volume is set to
m_max_volume in such scenarios. If the volume already is at
n_max_volume, we mirror the old behavior and emit a warning.
So, for example, consider m_max_volume was 100%, but the volume prior
to the increase was 96%. An increase of 5% would do nothing (emit a
warning, even) instead of setting the volume to 100%.
Note that this might happen even if the volume is at 95% according to
%percentage% due to rounding errors.
Displays real percentage instead of being set to 100 if percentage > full-at
* battery: added percentage_raw token, which ignores full-at
* battery: current_percentage returns raw, added clamping function instead
* battery: clamp percentage used by build()
Made clamp_percentage() const to allow its usage inside build()
* battery: read and return percentage in one line
Fixes compilation under GCC 9
The default copy constructor implicit generation is deprecated by C++ standard.
The window& operator=(const xcb_window_t win); operator seems to be useless.
Fixes#1728
Ref jaagr/xpp#16
We need to have the version string available in multiple places not just
the source code. It is now hardcoded in the root CMakeLists.txt and all
files that need it will be configured with cmake.
This also removed the unecessary duality of GIT_TAG and APP_VERSION and
GIT_TAG_NAMESPACE and APP_VERSION_NAMESPACE.
To avoid polybar from being killed by SIGUSR1 during reloading, SIGUSR1 is ignored until the signal is registered in the new polybar process.
As stated in signal(7) man page, the ignored signals are still ignored after a call to a function of the execvX family.
During an execve(2), the dispositions of handled signals are reset to the default;
the dispositions of ignored signals are left unchanged.
Fixes#428
* `layout-icon-*` list that maps layouts to icons.
* `indicator-icon-*` list that maps indicators to off and on icons
* `label-indicator-off`
* `label-indicator-on` which replaces the now deprecated `label-indicator`
* `label-indicator-[on|off]-*` for each indicator. Overrides `label-indicator-on` and `label-indicator-off`
Fixes#1558Closes#1048
* add icon support for xkeyboard layouts
* removed unneeded #include
* add sperate %icon% token that can be used in <label-layout>
* removed unneeded #include
* added caps lock indicator (was mentioned in wiki, but not actually implememnted) and support for indicator icons
* a few more fixes to make sure existing user configs are not broken
* ready to go
* Added an option to replace xkb indicator names
* Added labels for each indicator state
* Removed print left on accident
* Fixed review comments
* Update src/modules/xkeyboard.cpp
Co-Authored-By: Gilnaa <gilad@naaman.io>
Polybar had issues when there is no background set or set by a tool like imagemagick which doesn't add the root pixmap to the root window properties.
There's not much we can do about it, but at least polybar doesn't crash anymore.
Fixes#1582Fixes#1585
* fix(tray_manager): only enable transparency if neccessary
Previously, we always enabled transparency
* fix(background_manager): avoid needless fetching
* fix(renderer): move logging message to correct place
* fix(background_manager): handle dummy pixmap (_XSETROOT_ID) right
* fix(background_manager): more initialization + don't free on error
Freeing on error is incorrect, since we could still be called again later in
which case we still need the resources.
* fix(background_manager): add more infos to trace logs
* fix(background): correct typo (XROOTMAP -> XROOTPMAP)
* fix(background_manager): do not report "no background" as error
* style(background_manager): use braces for if
Co-Authored-By: bennofs <benno.fuenfstueck@gmail.com>
* fix(background_manager): better error message for dummy pixmap
Co-Authored-By: bennofs <benno.fuenfstueck@gmail.com>
* style(background): some more style fixes
* fix(connection): initialize pixmap in all cases in root_pixmap()
* style(connection): improve readability using early return
This adds `monitor-exact = true` in the bar section
This also properly does best-match instead of first-match if multiple
matches exists. For example if there are two monitors HDMI2 and HDMI-2
and we try to match HDMI-2 with monitor-exact = false, until now HDMI2
would be matched. Now exact matches are always preferred.
Fixes#1532
This adds a new label in the bspwm module `label-marked`
This flag for focused nodes of a focused desktop was introduced in [1]
and released with bspwm 0.9.4
It adds the `M` flag to `G` type items in bspwm's report format
Resolves#1552
[1]: d0138af475
This patch adds support for observing multiple slices of the desktop background.
This is used for the tray so that it doesn't have to rely on the bar's rect to
get the desktop background. In particular, it now handles the case where the
tray is not contained fully within the bar's outer rect (for example, when using tray-offset-{x,y})
Co-Authored-By: bennofs <benno.fuenfstueck@gmail.com>
* Clean up CMake logic
- removed logic to find CppUnit (no longer used)
- removed "dirs" variable used to pass include directories
- removed add_library function (no longer used)
- removed make_executable function
* only used in 2 places (polybar and polybar-msg)
* it was more general than needed, logic is simpler without it
- split polybar into static library and executable
* this allows linking unit tests to the library
* rename library
* add coverage build
- Added a CMake build type "Coverage" that builds C and C++
code with the "--coverage" flag (recognized by both GCC and Clang)
- removed "-Wno-missing-field-initializers" from test flags,
since it didn't seem to be needed any more
- removed logic from tests/CMakeLists to disable "-Werror" and "-pedantic-errors"
since there didn't seem to be any warnings during the build
* fix whitespace
* update travis
* remove O2 from defalt flags
* allow tests to be built by default make target
* disable Werror for debug builds
wireless_tools 29 redefines inline in iwlib.h as:
#define inline inline __attribute__((always_inline))
which conflicts with POLYBAR_NS, which is defined as:
#define POLYBAR_NS \
namespace polybar { \
inline namespace APP_VERSION_NAMESPACE {
In version 30.pre9 this #define is moved into a source file and thus
cannot conflict.
The error only occurs when building with clang, so it seems gcc and
clang handle this differently
Fixes#1492
If a tailed command is used polybar would generate two action tags, one
with %counter% replaced and one with %pid% replaced, but never both
This is a bug that was introduced in #934
The idea is that pseudo-transparency should behave like real transparency as
much as possible. To achieve this, we now render the bar the same way in both
cases. The only part where pseudo-transparency differs is at the very end, where
the rendered bar is captured and composited against the desktop background
image. This should ensure that both modes behave the same.