Commit Graph

30 Commits

Author SHA1 Message Date
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
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
patrick96 49b18fb3b7
Merge branch 'hotfix/3.6.2' 2022-04-03 20:11:19 +02:00
patrick96 325ef4c3b3 Cleanup builder
Removes unused methods and fields
2022-03-14 22:58:01 +01:00
patrick96 50eac859fd Cleanup use of pointers in util code 2022-03-06 18:28:26 +01:00
patrick96 1a59599388 fix(modules): Avoid downcast in module constructor
The previous CAST_MOD(Impl) for the action_router constructor was
illegal because `this` is not yet of type Impl (because the subclass
constructor has not run yet).

The action_router now accepts std::function for its callbacks.

Fixes #2519
2021-10-03 03:18:39 +02:00
the 698b96d17b
feat(backlight): add use-actual-brightness option (#2380)
* add use-actual-brightness option

* added to changelog

* added to changelog 2

* added to changelog 3
2021-02-16 10:02:33 +01:00
Patrick Ziegler 26be83f893
module: Implement action router (#2336)
* module: Implement proof of concept action router

Action implementation inside module becomes much cleaner because each
module just registers action names together with a callback (pointer to
member function) and the action router does the rest.

* Make input function final

This forces all modules to use the action router

* modules: Catch exceptions in action handlers

* Use action router for all modules

* Use action_ prefix for function names

The mpd module's 'stop' action overwrote the base module's stop function
which caused difficult to debug behavior.

To prevent this in the future we now prefix each function that is
responsible for an action with 'action_'

* Cleanup

* actions: Throw exception when re-registering action

Action names are unique inside modules. Unfortunately there is no way to
ensure this statically, the next best thing is to crash the module and
let the user know that this is a bug.

* Formatting

* actions: Ignore data for actions without data

This is the same behavior as before.

* action_router: Write tests
2021-01-04 10:25:52 +01:00
patrick96 9fb75779f3 Incorporate reviews 2020-11-26 20:53:53 +01:00
patrick96 bc1b86c584 actions: Separate data from action string
Modules now no longer need to manually parse the action string and
extract data from it.
2020-11-26 20:53:53 +01:00
patrick96 ae2350167b actions: Switch all modules over to new system
All modules now expose their actions as public static constants

Issues: The menu module no longer closes when an item is clicked (before
it would intercept any executed command and look if it matches one of
its exec commands)
2020-11-26 20:53:53 +01:00
nicey0 b8a1354117
backlight: Just match amdgpu_bl prefix (#2122)
Some devices can have "amdgpu_bl1" or "amdgpu_bl2", but the code hardcoded in the value "amdgpu_bl0". This change tests based on the first characters: "amdgpu_bl".
2020-06-05 21:48:17 +02:00
Gus Caplan 068bf5a311 feat(backlight): Add enable-scroll (#1957)
* backlight: enable changing via scroll

* squash! feedback

* Update src/modules/backlight.cpp

Co-Authored-By: Jérôme BOULMIER <jerome.boulmier@outlook.fr>

Co-authored-by: Jérôme BOULMIER <jerome.boulmier@outlook.fr>
2020-01-15 16:32:17 +01:00
patrick96 2b31a3f112 fix(backlight): Use 'brightness' with amdgpu_bl0
The amdgpu driver seems to set 'actual_brightness' wrong.

Fixes #1870
Ref: https://github.com/Alexays/Waybar/issues/335
2019-10-21 14:37:29 +02:00
Michael Carlberg 3292cea786 refactor(tokens): Move token suffix to configuration 2017-01-14 18:00:35 +01:00
Michael Carlberg ad0af86a7b refactor(battery): Abstract value readers
Refs #263, #245
2016-12-31 04:20:48 +01:00
Michael Carlberg 78bb3695e6 refactor(config): Deduce return type from default value 2016-12-30 23:32:05 +01:00
Michael Carlberg 788a7ca3a3 refactor(modules): Get rid of .inl files 2016-12-21 09:21:35 +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 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 fd57ab0f3d fix: project rename 2016-11-19 06:26:07 +01:00
Michael Carlberg e7cb345cec wip: Separate source from definitions 2016-11-03 12:54:32 +01:00
Michael Carlberg d359ab6057 refactor: Application rewrite 2016-10-10 14:52:57 +02:00
Michael Carlberg e1f8c001dd refactor: Pass by value 2016-06-21 04:23:23 +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 9321fb0db9 fix(backlight): Check file existance 2016-06-01 16:06:24 +02:00
Michael Carlberg eeefb3c610 init(git): Base commit 2016-05-19 20:23:45 +02:00