Commit Graph

32 Commits

Author SHA1 Message Date
may
facb53e81f
backlight: do not convert percent to string in fmt 2023-07-16 04:14:43 +02:00
Robert Günzler
0f8c156f24
Lift reverse-scrolling option into AModule
The option is generally useful when scrolling is used, when configuring
input devices to use "natural scroll direction".
Both backlight and pulseaudio were using different implementations, this
unifies and documents them.

Signed-off-by: Robert Günzler <r@gnzler.io>
2023-06-12 14:08:18 +09:00
Alex
ede1d25440 fix: lint 2023-04-17 09:01:14 +02:00
yeheng282
022c9abad4 backlight: support tooltip 2023-04-11 21:01:02 +08:00
Kuruyia
973aa09f8b refactor(backlight): fix linter 2023-02-03 18:18:44 +01:00
Kuruyia
e8c4b85328 feat(backlight): use dbus to set the brightness 2023-02-03 12:58:52 +01:00
Kuruyia
a78f0124d2 feat(backlight): add brightness control 2023-02-01 14:46:55 +01:00
Aleksei Bavshin
ea17a66dfc
fix: compilation errors with cpp_std=c++20
There were two main issues with fmtlib and C++20 mode:

 - `fmt::format` defaults to compile-time argument checking and requires
   using `fmt::runtime(format_string)` to bypass that.
 - `std::format` implementation introduces conflicting declarations and
   we have to specify the namespace for all `format`/`format_to` calls.
2023-01-20 22:50:02 -08:00
Simon Plakolb
5e9bbe5c76 modules: Revert button to label 2022-11-24 13:08:16 +01:00
Jef Steelant
9f0a14c22b make linter happy 2022-11-10 09:19:49 +01:00
Baltazár Radics
d02e23c759 feat(backlight): hide if the display is powered off 2022-11-07 13:57:21 +01:00
Kelsey Judson
253222d31c Make backlight module respect format-<state> config 2022-11-07 21:06:16 +13:00
Simon Plakolb
b8322c4b4b button: Add AButton class
The AButton class is designed as full a substitute to ALabel. The
GtkButton attribute 'button_' is initialized with a label. This
label can the be referenced by the subsequent inheritors of AButton
instead of the GtkLabel attribute 'label_' of ALabel.
For convenience a GtkLabel* 'label_' attribute is added to AButton.

If the button cannot be clicked it is disabled, effectively acting
like its label predecessor.

GtkButton seems to catch one-click mouse events regardless of the
flags set on it. Therefore, 'signal_pressed' is connected to a
function creating a fake GdkEventButton* and calling 'handleToggle'
(for details on this possible bug in GTK see:
https://stackoverflow.com/questions/45334911 )

In accordance with other GtkButtons (i.e. the sway/workspace ones)
set_relief(Gtk::RELIEF_NONE) is called on the 'button_' instance.
2022-10-12 10:25:29 +02:00
Bao Trinh
96746142d2
Backlight: don't reset value when failing to read
Avoids the brightness percentage resetting to 0 on intermittent failures
2022-04-21 22:19:05 -05:00
Bao Trinh
1af7191740
Backlight: avoid crash on getting brightness fails
Reading brightness value for backlight device can fail intermittently
(particularly when using ddcci-driver-linux). Handle this more
gracefully rather than crashing
2022-04-21 22:02:45 -05:00
Alex
f2fcadbf62 refactor: lint 2022-04-06 08:37:19 +02:00
Matan1x
aacd0fcc65 round brightness 2021-09-08 17:12:30 +03:00
Alex
e01a081f2f fix(brightness): amd brightness 2020-04-21 09:11:56 +02:00
Alex
687c50dc13 refactor: remove old stuff 2020-04-12 18:31:07 +02:00
Alex
b40cdcb5bd refactor: call parent update 2020-04-12 18:30:21 +02:00
Jordi Pakey-Rodriguez
0f0765e517 feat(modules): call user on-update if configured 2019-12-05 14:42:36 -08:00
Alex
d24d85bebf refactor: move label name and id to label contructor 2019-05-22 12:06:24 +02:00
Ilia Sheshukov
9fa0eb7068 more elegant amd fix 2019-05-17 22:30:45 +03:00
Dan
5f0a3063d1 feat(states): add getState to other percent based modules 2019-05-02 22:24:29 -04:00
Dan
3bac96945c Revert "feat(percent): adds a percent class to numeric modules"
This reverts commit 82302e58f3b611f7ff6d686d1783b1c32914f7c9.
2019-05-02 22:24:29 -04:00
Dan
472363a623 feat(percent): adds a percent class to numeric modules 2019-05-02 22:24:29 -04:00
Alex
311c34ecbc feat(Bar): handle widget size changes 2019-04-24 12:37:24 +02:00
Alex
6ed8f94dab refactor: format code 2019-04-18 17:52:00 +02:00
Ian Hattendorf
39de8e544c
Disable backlight module if no backlight found 2019-02-28 19:50:57 -07:00
Ian Hattendorf
c1295c8fd6
Fix crash when monitor unplugged
`Backlight#devices_` was being destructed before
`Backlight#udev_thread_`. Also check if thread is still running after
`epoll_wait`
2019-02-25 20:05:44 -07:00
Robinhuett
63e97df9ff fix(backlight) Allow format-alt 2019-02-24 22:15:41 +01:00
Ian Hattendorf
875306804c
Add backlight module
Monitor the backlight level via udev. Poll every `interval` as well,
in case backlight udev events aren't supported.
2019-02-17 15:29:49 -07:00