Commit Graph

35 Commits

Author SHA1 Message Date
llenck
6e34265d7b
Replace system_clock with steady_clock (#2559)
This fixes #857 and #1932. Also replaces PR #1725, since we don't need
our own implementation of condition_variable anymore since people who
update their polybar should have GCC 10 by now.

The m_updated_at field of the mpd module was removed instead of having
its clock change because it became unused in commit 645a3142a1.
2022-01-12 23:06:29 +01:00
Patrick Ziegler
d5be8cad97
Add compiler warning for missing override specifier (#2341)
* build: Add -Wsuggest-override

We should always use the override specifier when overriding virtual
functions. This helps prevent errors when a subclass tries to create a
function with the same name as a virtual function in a super-class but
with a different purpose.

* clang-format

* Upload logs on failure

* Add override to unsupported.hpp

* cmake: Make -Wsuggest-override flag conditional
2021-01-04 10:38:43 +01:00
Quan
39c73a8234
feat: Warn state for cpu, memory, fs, battery modules (#2199)
* [Temperature, Ramp] fix wrong icon for temperatures near base and warn temps

* [Temperature, Ramp] fix wrong icon for temperatures near base and warn temps

* Fix minor error

* Added WARN state for cpu module

* Implement WARN state for CPU, Memory modules, working on fs module

* Implement WARN state for fs module

* Simplify WARN state implementation for cpu and memory

* explicitly check percentage in get_by_percentage_with_borders

* Fixed silly error

* implement warn state on battery module, standardize the implementation on other modules

* minor fixes

* fix annoying error

* use more intuitive param name

* Fix percentage with borders bug

* Make requested changes
Hide the effect of warn states when unused

* Backward Compat: use no format instead of fallback label

* Reformat

* Refactor

* Reformat

* Reformat: convert tabs to spaces

* Reformat
2020-12-02 15:55:13 +01:00
patrick96
d592eea966 refactor: Move module type string into modules
This allows us to identify module by their type and it is also better to
store the module type as part of the module instead of having it
hardcoded in factory.hpp
2020-11-26 20:53:53 +01:00
Roberto Santalla
b2b73b5d91 feat(battery): add %percentage_raw% token (#1756)
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
2019-05-14 15:01:54 +02:00
Christoph Schiessl
2a9d5db179 feat(battery): implement animation-discharging 2018-05-02 11:44:55 +02:00
raidzero
93c425fdfe Add battery usage/charge in watts token %consumption% 2017-02-16 14:35:43 -07:00
Michael Carlberg
ad0af86a7b refactor(battery): Abstract value readers
Refs #263, #245
2016-12-31 04:20:48 +01:00
Michael Carlberg
7979f5b3d4 refactor(modules): Handle events using signal_receiver 2016-12-21 08:38:44 +01:00
Michael Carlberg
c01f111e34 refactor(modules): Move setup to constructor 2016-12-21 08:00:09 +01:00
Michael Carlberg
09ea07b750 refactor(battery): Use charge_{now,full} to calculate percentage 2016-12-16 09:58:54 +01:00
Michael Carlberg
ff9be848c7 refactor(clang-tidy): Apply fixes 2016-11-25 21:58:49 +01:00
Michael Carlberg
c6d85b2b92 refactor: Optimize build 2016-11-20 23:04:31 +01:00
Michael Carlberg
88c8bbd940 refactor: Fwd declare drawtypes
Ref #164
2016-11-19 15:49:06 +01:00
Michael Carlberg
38f9ba81cd feat(battery): Estimated time remaining
Adds a new token %time% that will display an
estimate of the remaining time until fully
charged/discharged
2016-11-19 15:42:31 +01:00
Michael Carlberg
fd57ab0f3d fix: project rename 2016-11-19 06:26:07 +01:00
Michael Carlberg
a1472dfd0f refactor(battery): Poll values by default
Fixes jaagr/lemonbuddy#140
2016-11-03 15:21:46 +01:00
Michael Carlberg
52c08675e6 fix(battery): Ignore the fake inotify event
Assume fake event if polling flag is set.

Fixes jaagr/lemonbuddy#140
2016-11-03 14:40:12 +01:00
Michael Carlberg
af2289e397 fix(battery): Poll until real inotify event occurs
Fixes jaagr/lemonbuddy#140
2016-11-03 12:56:35 +01:00
Michael Carlberg
e7cb345cec wip: Separate source from definitions 2016-11-03 12:54:32 +01:00
Michael Carlberg
f83dbf19b1 fix(battery): Poll thread requires running module
Closes jaagr/lemonbuddy#140
2016-11-02 18:38:13 +01:00
Michael Carlberg
36d4ee0e67 refactor(battery): Cleanup 2016-10-30 18:47:01 +01:00
Michael Carlberg
1075144b00 refactor(eventloop): Use concurrent queue for events
Events are now enqueued using a thread safe concurrent queue
which makes the previous eventloop locking redundant.
2016-10-29 06:48:51 +02:00
Michael Carlberg
d2187f44e0 refactor(drawtypes): Cleanup and fixes 2016-10-25 07:10:05 +02:00
Michael Carlberg
1c882508ec fix: Drop superflous prefix when throwing module_error 2016-10-19 02:15:52 +02:00
Michael Carlberg
68f72d69cc refactor: Drop tokenized labels
Handle placeholder tokens inside each label
instead of cloning into a new instance each time
2016-10-19 01:31:17 +02:00
Michael Carlberg
2af0d0845d fix(docs): Updated README and configs
Use dash instead of underscore as parameter name separator
Will break alot of configs but people like to work!
2016-10-12 05:19:31 +02:00
Michael Carlberg
d359ab6057 refactor: Application rewrite 2016-10-10 14:52:57 +02:00
Michael Carlberg
89ea8d9146 fix(battery): Store paths 2016-06-21 04:38:01 +02:00
Michael Carlberg
e1f8c001dd refactor: Pass by value 2016-06-21 04:23:23 +02:00
Michael Carlberg
2c74cb06de task(dsl): Replace colons with dashes
Colons break ini syntax highlighters and linters.
2016-06-11 07:49:14 +02:00
Michael Carlberg
39d3f61497 refactor(core): Clean-up
- use "#pragma once" instead of the regular include guard
- fix errors and warnings reported by cppcheck
2016-06-02 01:32:06 +02:00
Michael Carlberg
4a6a36f08f fix(battery): Poll capacity level
Some distros doesn't report any inotify event's for
the filesystem where the battery capacity file is located.

Resort to polling for now...
2016-05-31 02:55:08 +02:00
Michael Carlberg
23b2cc69dd fix(battery): Proper handling of charge animation
Closes jaagr/lemonbuddy#3
2016-05-26 11:50:01 +02:00
Michael Carlberg
eeefb3c610 init(git): Base commit 2016-05-19 20:23:45 +02:00