Commit Graph

19 Commits

Author SHA1 Message Date
a625e2b79a fix(timer_module): sleep until next full interval (#2123)
Any timer_module based module would sleep for the set interval and then
continue running. Depending on the start time of polybar this
sleep pattern might not be aligned, which causes such modules to always
update in a shifted manner.
Consider the date module as an example. If the update interval is set to
60 seconds and polybar was started at 13:37:37, polybar would update the
clock at 13:38:37, 13:39:37 and so on.
To make matters worse, if a module would perform lengthy checks this
interval might drift over time, causing even more inconsistent updating.

This patch extends the base module with a sleep_until method that calls
the corresponding function on the sleephandler. Additionally the
timer_module is extended to compute the remaining time until the next
interval passes and sleep accordingly.

Closes #2064

Co-developed-by: Dominik Töllner <dominik.toellner@stud.uni-hannover.de>

Co-authored-by: Malte Bargholz <malte@screenri.de>
2020-06-20 22:15:25 +02:00
587dc6c84d bar: Make module separator a label
Some people use text modules instead of the `separator` key in the bar
section to better configure the separator (colors, fonts).
Since we disallowed the same module being used multiple times in #1534,
this will now print an error message.

This should help with this a bit.

Ref #1913
2019-10-27 16:02:33 +01:00
0ab9fcdc38 refactor: Remove all mentions of icon_t
Is exactly the same label_t
2019-04-08 09:01:48 +02:00
67f1ceaaca feat: format-font
Resolves #19
2019-01-17 08:31:14 +01:00
02833b7871 feat(volume): Optional event handling #84 2017-04-02 18:12:07 +02:00
30f516dd7d fix(formatting): Make formats parse specs as-is
This removes the spacing tinkering when parsing format specs.
The following example uses the old behavoir:

    format-test = <label-foo>  <label-bar>
    format-breaks = <label-foo><label-bar>/<bar-test>

`format-test` would replace all occurences of ' ' with the
a space string with defined `spacing` as its width. `format-breaks` would
not validate as the tags where split with ' ' as delimiter.

All that nonsense has been removed and each tag is extracted as is.
The `spacing` parameter can still be used to apply N extra whitespaces
between the tags, but it is now 0 by default.
2017-01-11 02:43:37 +01:00
f4e8051e9e refactor(script): Merge back script handling 2017-01-10 05:12:53 +01:00
ba757809d0 refactor(modules): Defer cache rebuild 2016-12-23 05:19:45 +01:00
debb3534c7 concurrency_ytil: Thread id 2016-12-23 05:18:58 +01:00
e47e439954 refactor(modules): Replace callbacks with signals
Refs #265
2016-12-22 22:11:30 +01:00
7979f5b3d4 refactor(modules): Handle events using signal_receiver 2016-12-21 08:38:44 +01:00
c01f111e34 refactor(modules): Move setup to constructor 2016-12-21 08:00:09 +01:00
f50f43af02 refactor: Cleanup 2016-12-16 10:23:54 +01:00
4fca0c89b4 refactor: Object construction 2016-12-14 11:01:44 +01:00
08be86fbe1 wip(refactor): Improve signal and event handling 2016-12-14 11:01:44 +01:00
ffbedf4217 feat: Add support for prefix and suffix to formats 2016-12-04 02:33:38 +01:00
ff9be848c7 refactor(clang-tidy): Apply fixes 2016-11-25 21:58:49 +01:00
d616a7d351 fix(build): Move chrono namespace to correct level
Ref #176
2016-11-21 00:19:22 +01:00
c6d85b2b92 refactor: Optimize build 2016-11-20 23:04:31 +01:00