Commit Graph

141 Commits

Author SHA1 Message Date
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
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
1043354aec tray: Deprecate all legacy tray settings 2023-08-06 15:26:28 +02:00
patrick96
4d1bba2c4e Add changelog 2023-05-15 14:44:50 +02:00
patrick96
f78ec80df3 Add changelog entry 2023-05-10 17:06:00 +02:00
patrick96
8cc1b4fcfd fix(build): Use CMAKE_INSTALL_FULL_<dir> for default config
Using CMAKE_INSTALL_SYSCONFDIR does respect CMAKE_INSTALL_PREFIX, but it
prefixes it to CMAKE_INSTALL_SYSCONFDIR, which results in the default
config being installed to /usr/etc/polybar/config.ini or
/usr/local/etc/polybar/config.ini

CMAKE_INSTALL_FULL_SYSCONFDIR gives an absolute path that respects the
prefix but does the right thing (uses /etc) if it is /usr

Ref: #2770
2023-02-13 22:08:57 +01:00
patrick96
fc423c0921 fix(i3): Deal with negative coordinates
Pulls in fix in i3ipcpp repo: https://github.com/polybar/i3ipcpp/pull/12

Fixes https://github.com/polybar/polybar/issues/2888
Ref https://github.com/i3/i3/discussions/5352
2023-01-05 22:11:08 +01:00
patrick96
edf37385cb script: Bump poll timeout to 250ms
The module has a poll timeout because it needs to periodically check if
it is shutting down. Otherwise, it would be stuck polling and the bar
couldn't shut down until the script produces a new line.

However, this causes the bar to wake up intermittently (currently
~40/s) due to the 25ms timeout.
Bumping this to 250ms still gives us timely shut downs and caps the
number of wake ups to 4/s.

This is only a stop-gap solution, ideally the script runner is
integrated into the main event loop and uses its polling handles which
don't have to wake up to check for a shutdown.

Ref #1778
Ref #2337
2022-12-12 00:52:13 +01:00
patrick96
d5498c8a8a script: Require zero exit code to show empty module.
Showing an empty module if the script failed but produced no output does
not make too much sense.

Ref #2857
2022-11-05 12:43:43 +01:00
patrick96
87750c064e build: Bump C++ to C++17
Now requires gcc8 or clang7
2022-10-23 15:20:21 +02:00
Madhav Prabhu C M
30e1cc2595
feat(ipc): <label> support (#2841)
* Label = %output% working

* build fix

* Output as deprecated, Label as default

* Corrections

 * Corrections Simplified

* Changelog updated
2022-10-23 10:47:22 +02:00
Ashwin
cbf5439e80 changelog 2022-10-22 13:06:06 +02:00
Madhav Prabhu C M
54b75f23ab
feat(ipc). Per hook format (#2810)
* Added format-x support for ipc_module, tested with demo config

* Certain cases not working

* Certain cases not working, build

* Changed label to output tag, Mixing of default formats wont work

* created changelog
2022-10-09 18:42:36 +02:00
Patrick Ziegler
e9713185cb
backlight: Remove actual_brightness amdgpu check (#2839)
The issue has been fixed in the linux kernel version 5.9 and above so we
are removing our workaround for this from polybar.
Users with older versions can still work around this by explicitly
setting `use-actual-brightness` to false, it is just not done by default
anymore.

Closes #2835
Ref https://bugzilla.kernel.org/show_bug.cgi?id=203905
Ref 69d9f4278d
2022-10-08 15:52:47 +02:00
Ron0Studios
303015244e
feat: longest match ws-icon fuzzy matching (#2831)
* better fuzzy matching

Improved fuzzy matching so that it finds the longest matching icon instead of the first possible match

* Update CHANGELOG.md

* removed debug output

* added tests and improved fuzzy finder

- added return statements to the fuzzy finder
- added tests to check whether the fuzzy finder works.

* minor style changes

* minor change to iconset.cpp

* Delete tasks.json
2022-10-05 23:05:44 +02:00
Ashwin Rajesh
03987b19a5
fix(xwindow): Crash when no tag is set in format (#2833)
* xwindow works without tag

* changelog
2022-10-05 21:39:02 +02:00
patrick96
5719d130fd feat(xwindow): %instance%, %class% from WM_CLASS 2022-10-02 20:57:29 +02:00
Patrick Ziegler
053a7eb2d8
fix: Crash on root pixmap and window depth mismatch (#2813)
The background_manager used the root window depth for creating its
pixmaps, but when the root pixmap has a different depth, this causes the
copy_area_checked call to fail and crash the bar.

We now load the root pixmap before finding the visual and creating the
slice pixmaps.

Fixes #2798
2022-09-05 09:58:12 +02:00
Patrick Ziegler
d817080ee8
fix(renderer): Small gaps when rendering emojis (#2802)
If any rendered text uses a non-integer number of pixels (often emojis),
rendering of subsequent text blocks will start between pixels which
results in small gaps in the background and over/underline colors caused
by cairo only rendering at fractional-intensity in the beginning and end
pixel.

Simply rounding up text width can solve this.

Fixes #2785
2022-08-25 00:55:16 +02:00
Ashwin Rajesh
7838241a77
feat(tokens): Negative minimum length adds right padding (#2801)
* negative minimum length adds right padding

* missing else statement

* updated changelog
2022-08-25 00:36:38 +02:00
Dave
6ccecbfca2
feat(temperature): Add zone-type setting (#2752)
Signed-off-by: xphoniex <dj.2dixx@gmail.com>

Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-08-21 19:25:42 +02:00
Quantenzitrone
708bd9c891
feat(temperature): %temperature-k% token for Kelvin (#2784)
* added kelvin option for module/temperature

* changelog for the changes i made

* fixed typos

* fixed the temperature conversion to be more precise

* Update CHANGELOG.md

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>

* changed the calculation of the different temperatures

it now uses float as a initial value and makes m_temp temp_k and temp_f by converting and rounding with std::round

* std::lround makes more sense to use than std::round

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
2022-08-21 19:10:48 +02:00
Patrick Ziegler
b5764c8a93
Use CMAKE_INSTALL_SYSCONFDIR instead of /etc (#2770)
Some distro's build infrastructure (e.g. gentoo) can use
CMAKE_INSTALL_PREFIX to install to a different location.
When the config path is hardcoded to /etc, CMAKE_INSTALL_PREFIX has no
effect.

Ref: https://bugs.gentoo.org/858797
2022-07-19 23:26:11 +02:00
patrick96
841b799299
Add include-file reload fix to changelog 2022-07-09 12:26:07 +02:00
raffael0
f3e27a205e
backlight: auto-detect default card (#2728)
* auto-detect a default backlight

* Implemented suggestions

* added changelog

* Implemented suggestions

* Fix changelog formatting

Co-authored-by: patrick96 <p.ziegler96@gmail.com>
2022-06-16 12:54:38 +02:00
Maxim Kolesnikov
0331a5fda4
fix: error reporting for deprecated config values (#2725) 2022-06-12 16:31:11 +02:00
patrick96
7a1824a9b9
Merge remote-tracking branch 'origin/hotfix/3.6.3' 2022-05-04 11:08:12 +02:00
patrick96
a962a2658d
Version 3.6.3 2022-05-04 09:07:06 +02:00
Patrick Ziegler
f653c3a738
fix(pulse): Hanging during connection setup (#2709)
If context_state_callback is called before we call
pa_threaded_mainloop_wait in the main thread, the signal is lost and we
wait forever.

Fixes #2707
Ref #2699
Ref #2697
2022-05-04 08:58:53 +02:00
Mathis Weber
423cc1720f
fs: fallback if no mountpoints specified (#2705)
Ref #2572
2022-05-02 12:54:03 +02:00
Patrick Ziegler
efbd8e394f
fix(bar): Update struts when hiding (#2702)
When the bar is hidden, the struts should be 0 so that WMs can resize
their windows and not leave a gap.

Ref #2701
2022-04-27 21:09:59 +02:00
marxlaml
6a2d7b5dde
feat(backlight): Add scroll-interval (#2700)
Closes #2696

* Added `scroll-interval` option to `internal/backlight`

* Added PR to CHANGELOG.md

* Fixed indentation
2022-04-27 19:53:06 +02:00
Patrick Ziegler
bc9dda266f
fix(xworkspaces): Update on _NET_DESKTOP_VIEWPORT (#2698)
Fixes #2693
2022-04-25 17:46:53 +02:00
Mathis Weber
b5292791ef
fix: check if double click action associated (#2695)
When a module is clicked, only wait for the double click interval if a
double click action is associated with that module. Otherwise trigger
the click right away.

Fixes: #2663
2022-04-25 12:59:40 +02:00
raffael0
4961a7dcfc
feat(tray): Position using a module (#2595)
Closes: #1526
Closes: #314

* debug log

* semi-working prototype. works on the left and the center but not on the right

* fixes formatting

* fixes tests

* - fixed tray_width_change signal
- implements suggestions

* - fixes error with tray positioning

* - tries to fix tests. Does not work

* - fixes tests

* - implemented suggestions

* reverted formatting in comake and doc

* - changed unique_ptr to const reference

* - fixed formatting errors in code

* - actually fixed formatting(ran clang-format)

* - implemented suggestions

* - Added CHANGELOG.md entry(not sure about wording)

* - removed bar_settings from tray_manager::setup

* - fixed issue from rebase

* - fixed issue with tests from rebase

* implemented suggestions

* Update CHANGELOG.md

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
2022-04-15 23:50:04 +02:00
Patrick Ziegler
ab206a5f8e
fix: No overlines/underlines being drawn when using offsets (#2685) 2022-04-11 21:30:24 +02:00
Patrick Ziegler
146c1ac1d7
fix(ipc): Fallback folder not being user-specific (#2684)
If two users start a bar with IPC and don't have XDG_RUNTIME_DIR set,
polybar will create the fallback directory `/tmp/polybar`.
However, that directory is only accessible by the user that created it
and so polybar running under the second user will fail to open its
socket there.

We add the UID to the fallback directory to prevent this.

Fixes #2683
2022-04-07 15:33:56 +02:00
Patrick Ziegler
7d9227cb08
fix(battery): polling-interval not working (#2677)
Fixes #2649
2022-04-07 15:24:14 +02:00
Maxim Kolesnikov
9b28ba7a5e
fix(script): clear output when exec-if fails (#2675)
Fixes #2674
2022-04-04 12:49:13 +02:00
patrick96
973b1fa3d3 feat(text): Add standard format with label
Closes #1331
Closes #1342
Fixes #2673
2022-04-04 12:01:06 +02:00
patrick96
49b18fb3b7
Merge branch 'hotfix/3.6.2' 2022-04-03 20:11:19 +02:00
patrick96
77d611c03d
Version 3.6.2 2022-04-03 19:05:45 +02:00
Patrick Ziegler
aaac4c45ff
Fix changelog entry for interval-fail (#2669)
It was mistakenly added to the 3.6 changelog
2022-04-03 13:11:28 +02:00
Maxim Kolesnikov
41d41ca8df
fix(script): output timing inconsistencies (#2667)
Fixes #2650
2022-04-03 13:11:13 +02:00
Farseen
a2c1392c12
feat(pulseaudio): define reverse-scroll option (#2664)
* pulseaudio: define reverse-scroll option

When we enable natural scrolling option in libinput,
it sends scroll down event when we swipe up on the touchpad.
This makes the pulseaudio module feel weird.
This option fixes that.

* Update CHANGELOG.md

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
2022-04-02 23:45:54 +02:00
indev
36d19d372d fix(script): do not hide failing scripts with constant output 2022-04-02 23:24:05 +02:00
patrick96
ae32b5ff29 Update changelog 2022-03-20 20:18:00 +01:00
patrick96
b05b3a4c74 xworkspaces: Deal with disappearing windows
Because the X server is asynchronous, there is no guarantee that after
reading _NET_CLIENT_LIST, all windows still exist.
For that reason we need to handle XCB_WINDOW errors appropriately.
2022-03-20 18:31:02 +01:00
patrick96
b8075c9b4d Add polybar-msg same-user restriction to changelog 2022-03-19 12:26:53 +01:00
patrick96
8173eaf90a fix: Positioning in awesomeWM
Since polybar sets WM_NORMAL_HINTS, awesomeWM for some reason no longer
respect the position set by polybar before mapping.

reconfiguring the window position once again after mapping the window,
again positions it correctly.
2022-03-15 22:09:36 +01:00