Commit Graph
100 Commits
Author SHA1 Message Date
Guido Günther e7df74f5cc data: Document sound-file hint
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-01-26 16:12:13 +01:00
Guido Günther d0f1c3bb28 feedback-manager: Drop fb_found boolean
Just check the elements on the event list. This makes it easier to
extend as we can't forget to toggle the variable.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-01-26 16:11:23 +01:00
Guido Günther 9fd06731ae feedback-manager: Improve readability of add_event_feedbacks()
Save one indent level and add the feedback at the very end. This
makes extending easier.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-01-26 16:04:11 +01:00
Guido Günther 9bb2a528c6 feedback-manager: Split out event feedback preparation
It's becoming gradually more complex so move it to a separate function.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-01-26 14:38:52 +01:00
Guido Günther 1c6ff93333 dir-locals: Set display column
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-01-26 14:38:52 +01:00
Guido Günther 1acb55ef0d packaging: Add symbols from 0.6.0
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-01-26 14:04:48 +01:00
Guido Günther fadae2aa8d treewide: Document changes and release 0.6.0
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-21 20:00:34 +01:00
Guido Günther 7f2283e64a README: Document new API
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-15 18:54:40 +01:00
Guido Günther f639f7d103 feedback-manager: Instantiate .Haptic DBus interface
Make the haptic interface available on the Bus when a haptic
motor is found at daemon startup.

Closes: https://source.puri.sm/Librem5/feedbackd/-/issues/80

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-15 18:54:40 +01:00
Guido Günther 31c7bf7d6b haptic-manager: New object to handle the Haptic DBus interface
To trigger a 200ms rumble at 100%, a 50ms pause and a 300ms rumble at 50%:

   busctl call --user org.sigxcpu.Feedback /org/sigxcpu/Feedback org.sigxcpu.Feedback.Haptic Vibrate 'sa(du)' org.foo.app 3 1.0 200  0.0 50  0.5 300

To cancel an ongoing pattern:

   busctl call --user org.sigxcpu.Feedback /org/sigxcpu/Feedback org.sigxcpu.Feedback.Haptic Vibrate 'sa(du)' org.foo.app 0

The API has lower priority than the event based API to e.g.  not miss
incoming phone calls or cell broadast messages.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-15 18:54:40 +01:00
Guido Günther 93dc859f7d data: Add vibration API
The API is meant to trigger the given vibration pattern on the haptic
device. The pattern is sequence of relative amplitude and duration
pairs. A magnitude of 0.0 indicates a pause.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-15 18:54:40 +01:00
Guido Günther 9cebb2c081 feedback-vibra: Add support for patterns
Add a new class that takes an array of durations and magnitudes.
A magnitude of 0 indicates a pause.

We can consider dropping the VibraRumble class at some point as that
is a special case of VibraPeriodic now however as the feedbacks are
encoded in the themes let's make sure VibraPattern is good API before
deprecating VibraRumble.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-15 18:35:58 +01:00
Guido Günther 386c98c381 dev-vibra: Allow to set magnitude
Allows for more subtle feedback

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-15 18:35:44 +01:00
Guido Günther 58221c7416 feedback-vibra: Allow derived classes to override duration
This allows the derived classes to perform the length duration
calculation.  The parent class can thus still keep track of the total
feedback length.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-15 18:35:25 +01:00
Guido Günther 18f2c88746 feedback-vibra: Clear timer id
Make sure we clear the timer id when vibra ended.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-15 18:35:21 +01:00
Guido Günther 24736b9490 feedback-vibra: Use g_timeout_add_once
Fix some indent while at that

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-15 18:35:17 +01:00
Guido Günther 5ed445a81d feedback-manager: Don't trigger haptic feedbacks when vibra is busy
This just gives odd vibration. Later on we should use priorities to
allow for higher priority events like phone calls to override lower
priority events like e.g. button presses. This is similar to how we want
to handle LED patterns.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-15 18:35:04 +01:00
Guido Günther cdf5fb2b2d feedback-manager: Split out feedback level calculation
This allows to use it from other places too and while at that
documents it.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-15 18:34:35 +01:00
Guido Günther 8a11565cc1 dev-vibra: Allow to check if the device is busy
We accept `NULL` to make the case of no haptic easy to handle.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-15 18:34:28 +01:00
Guido Günther 5238d46968 feedback-rumble: Fix indent
There were some tabs from day 0

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-15 18:34:25 +01:00
Guido Günther b724789ab1 dev-vibra: Untabify
Gbp-Dch: Ignore
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-15 18:34:16 +01:00
Guido Günther fb64c9dcfb data: Really add gnome-clocks
Fixes d5b2042 ("data: Add gnome-clocks to allow-important list")

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-12 17:36:31 +01:00
Guido Günther 0190e032f9 doc: Modernize README a bit
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-10-02 16:05:55 +02:00
Guido Günther e79b1eec7b ci: Drop duplicate format check 2024-10-02 16:05:55 +02:00
Guido Günther f629ef431c theme: Add notification-missed-new
We'll remove message-new-notification somewhat later to not break
existing themes.

This reverts commit 5cc9713984778e61c4218e8ff6d896324cba5d5d.
2024-10-02 14:48:01 +02:00
Guido Günther a069f4b9e2 event-naming-spec: Expand on notifiction events
We move them to the system category as the notification server
is a system component and add an event for now notifictions
for the notification server to use
2024-10-02 14:48:01 +02:00
Guido Günther 97ed5a2bdd event-naming-spec: Copy-edit
Gbp-Dch: Ignore
2024-10-02 14:48:01 +02:00
Guido Günther ec843deb13 event-naming-spec: Fix section description 2024-10-02 14:48:01 +02:00
Guido Günther d9877e7d5c packaging: Tweak package description a bit 2024-09-27 13:49:45 +02:00
Guido Günther b978509d29 treewide: Document changes and release 0.5.0 2024-09-27 13:47:09 +02:00
Guido Günther f4564a4fc8 packaging: Better handle RC version when updating changelog
This allows us to switch from RCs to releases without manual
effort.
2024-09-27 13:45:55 +02:00
Guido Günther d5b2042475 data: Add gnome-clocks to allow-important list
This will allow us to drop the override from phosh
2024-09-27 07:27:08 +00:00
Guido Günther 2293393999 data: Allow alert-slider to override the feedback level
This allows the alert-slider to also emit feedback when phone is in
silent mode.
2024-09-27 07:27:08 +00:00
Guido Günther 7ea55aeaf5 data: Add systemd unit to start alert slider service 2024-09-27 07:27:08 +00:00
Guido Günther 0a2392db3f fbd-alert-slider: Small service to track alert sliders
This tracks the alert slider on OnePlus 6/6T devices
and adjusts the profile level accordingly.

This is based on a script by "isyourbrain foss" in the Phosh matrix
channel.
2024-09-27 07:27:08 +00:00
Guido Günther 8c27a8f5d2 data: Allow logged in users to access the alert slider 2024-09-27 07:27:08 +00:00
Guido Günther dc12f3016f theme: Add events for cellbroadcast 2024-09-23 12:18:26 +00:00
Guido Günther 9007766fa9 udev: Add support for haptics on Oneplus Enchilada / Fajita
The spmi_haptics driver isn't in mainline Linux as of Linux 6.11.
2024-09-07 16:12:01 +02:00
Guido Günther 6f03552249 doc: Document gsettings used by feedbackd 2024-08-30 12:19:31 +02:00
Guido Günther 511fbd73e8 packaging: Use pkgconf
It's prefered over pkg-config in Debian
2024-08-20 15:44:33 +02:00
Guido Günther 8c209e6c47 packaging: Install NEWS and README
They contain useful information
2024-08-20 15:44:33 +02:00
Guido Günther 1cca52033c packaging: Update lintian overrides 2024-08-20 15:44:33 +02:00
Guido Günther fe51ceed9f packaging: Drop unused file
And fix typo while at that

Gbp-Dch: Ignore
2024-08-20 15:44:21 +02:00
Guido Günther 3331f179f9 treewide: Document changes and release 0.4.1 2024-08-12 22:56:17 +02:00
Guido Günther 47b0b1c0e7 build: Install udev rule
Don't hide it in the packaging as that makes it easier to miss.

This makes debian/ really only carry packaging information.
2024-08-07 12:14:26 +02:00
Guido GüntherandTomi Lähteenmäki 1f9ac79445 tests: Use decimal values
We don't rely on that anywhere anyway.

Co-authored-by: Tomi Lähteenmäki <lihis@lihis.net>
Closes: https://source.puri.sm/Librem5/feedbackd/-/issues/79
2024-07-24 17:35:42 +00:00
Guido Günther 91a153a2f4 not-intalled: Avoid gmobile on all arches
This only matters for the case where we use the embedded
gmobile but better to be correct.
2024-06-28 17:45:25 +02:00
Guido Günther ff26417de9 treewide: Document changes and release 0.4.0 2024-06-21 22:18:23 +02:00
Guido Günther 929d41b7db feedback-manager: End too noisy feedbacks on profile level change
When the profile gets lowered from e.g. quiet to silent we want to end
all ongoing feedbacks that belong to the quiet level.

This allows to e.g. silence an incoming phone call by switching the
feedback level via phosh's quick setting.

Closes: https://source.puri.sm/Librem5/feedbackd/-/issues/13
Closes: https://source.puri.sm/Librem5/feedbackd/-/issues/55
2024-06-21 19:57:29 +00:00
Guido Günther 3c02259156 event: Allow to end events by level
The level here is an abstract value but in fact matches the profile
level. Well make this a property when fixing #35.
2024-06-21 19:57:29 +00:00
Guido Günther 0a16ebe4af event: Make removing feedbacks more self contained
If the feedback is in our list of feedbacks disconnect signals
and drop the reference we hold.

As we have removed the signal handler that would invoke `check_ended()`
we invoke this manually when the list becomes empty.
2024-06-21 19:57:29 +00:00
Guido Günther e7c370a589 tests/fbd-event: Check if objects are finalized
This gives us more info than just using automatic cleanup
2024-06-21 19:57:29 +00:00
Guido Günther 924320bbf9 fbd-event: Fix some indent
Gbp-Dch: Ignore
2024-06-21 19:57:29 +00:00
Guido Günther 2b6a9508a0 feedback-theme: Fix indent
Gbp-Dch: Ignore
2024-06-21 19:57:29 +00:00
Guido Günther 212682fb0f cli: Inform user when no feedback was found
This might either be because the event doesn't exist or when the profile
doesn't have any feedback on the current level.

Closes: https://source.puri.sm/Librem5/feedbackd/-/issues/76
2024-06-21 09:25:55 +00:00
Guido Günther e2c9b530b9 cli: Reindent
Gbp-Dch: Ignore
2024-06-21 09:25:55 +00:00
Guido Günther 62c92b0b09 packaging: Build-depend on shared gmobile
This ensures we don't use the subproject in packaging builds
2024-06-21 08:05:51 +00:00
Guido Günther bdcbb08cd8 packaging: Don't require root for building
This helps the nightly builds
2024-06-21 09:50:37 +02:00
Guido Günther 6622444c78 udev: Allow to use flash devices 2024-06-15 11:14:40 +02:00
Guido Günther 8f67dbd120 feedback-led: Allow to prefer flash LEDs over notification LEDs 2024-06-15 11:14:40 +02:00
Guido Günther ffd939c536 leds: Probe flash LED 2024-06-15 11:14:40 +02:00
Guido Günther e47ce8e09e led: Add flash LED type
Camera flashes are also exported via the LED subsystem. We use a
separate LED type so they're not picked by default.

We don't use them as fallbacks either.
2024-06-15 11:14:40 +02:00
Guido Günther e16dc3cdab feedback-led: Check if at least one LED is available
So far we didn't create any FbdDevLeds if there wasn't at least one
usable LED. Once we introduce flash LEDs we might probe the LED but the
LED might not be usable as the user hasn't enabled using it. Prepare for
that scenario.
2024-06-15 11:14:40 +02:00
Guido Günther 417b34be89 led: Drop FBD_FEEDBACK_LED_COLOR_LAST
With new led types we might not loop over all of them. This makes
it a bit more obvious.
2024-06-15 11:14:40 +02:00
Guido Günther a71fd7d470 manager: Move schema name to header
This makes it available to other compilation units
2024-06-15 11:14:40 +02:00
Guido Günther afdeb8d56f theme: Use different colors for emails and calls
This makes them a bit simpler to distinguish
2024-06-13 15:19:08 +02:00
Guido Günther a4c35a8e61 led: Parse color values and pass them down the chain
We parse RGB color values as HEX ('#RRGGBB') and use those when a RGB
LED is available. Single color LEDs won't see a change.
2024-06-13 15:19:03 +02:00
Guido Günther efd088daa8 feedback-led: Document hw LED types 2024-06-13 15:17:52 +02:00
Guido Günther 4afc8398e2 feedbackd: Pass GMOBILE_USE_UNSTABLE_API to all files
No need to ack that individually
2024-06-13 15:17:52 +02:00
Guido Günther 5bd398ed18 feedback-led: Support colors as strings
The FbdDevLedColor enum defines the hardware color of the LED. We used
it for the feedbacks color value as long as the kernel mostly had
single color LEDs. As multicolor LEDs are common nowadays switch the
color to a string which will allow us to use RGB values later on.
2024-06-13 15:17:51 +02:00
Guido Günther 4551b1c939 fbd-feedback-led: Modernize property definitions
Adapt current phosh coding style before making other changes
2024-06-13 07:44:42 +02:00
Guido Günther 8d4c2590cb doc: Fix URLs
Don't use Markdown markup as it looks odd in the generated page.
2024-06-13 07:44:39 +02:00
Guido Günther 17d910651d doc: Document feedback types
This allows us to remove the list from the README
2024-06-13 07:44:36 +02:00
Guido Günther 6e9e5700c0 dev-led-multicolor: Use correct format specifier
The values are unsigned int
2024-06-13 07:44:34 +02:00
Guido Günther 9aa6696eb8 build: Let daemon dependency depend on generated enum headers
Otherwise it might not be available in the tests
2024-06-13 07:44:25 +02:00
Guido Günther 1c51eb20ec ci: Use common jobs from meta-phosh 2024-06-12 16:24:33 +02:00
Guido Günther e9743f3daa ci: Update common files from meta-phosh
This updates to commit f3c92e90dcc0d65322888217429b75dd101bd0d3
2024-06-12 16:24:33 +02:00
Guido Günther 3c588fdb8f led-qcom: Check for LED driver
The hw_pattern attribute is driver specific. Ensure we don't apply the
LED pattern to unknown drivers.

Closes: https://source.puri.sm/Librem5/feedbackd/-/issues/77
2024-06-10 15:50:50 +02:00
Guido Günther f581c15842 led-qcom-multicolor: Don't leak qcom_led 2024-06-10 10:33:05 +02:00
Guido Günther 255856822a led-qcom-multicolor: Drop unused defines 2024-06-10 10:33:03 +02:00
Guido Günther fcd210ef22 led-qcom: Use char instead of gchar
We prefer the C types in new code.
2024-06-10 10:33:03 +02:00
Guido Günther bc0449f79d lfb-event: Fix typo in docstring
Gbp-Dch: Ignore
2024-05-31 15:01:00 +02:00
Guido Günther d5b0f30205 tests: Add umockdev based tests for leds
This ensures we can probe the different led types correctly

The umockdev data was recoreded on an Librem 5 and Librem 14
2024-05-17 06:24:50 +00:00
Guido Günther 2db8e8f820 ci: Add clang build 2024-05-17 06:24:50 +00:00
Guido Günther a188cdde7c Build: Use meson instead of ninja 2024-05-17 06:24:50 +00:00
Guido Günther f6a92231db fbd-theme-validate: Use G_NORETURN 2024-05-17 06:24:50 +00:00
Guido Günther 95c51c021d fbd-dev-led-multicolor: Drop unused variable 2024-05-17 06:24:50 +00:00
Guido Günther 973c7e006e led: Don't forget to init variable 2024-05-17 06:24:50 +00:00
Guido Günther b8718992d1 led: Drop unused variable 2024-05-17 06:24:50 +00:00
Guido Günther 83f14a451a led: Add doc strings 2024-05-17 06:24:50 +00:00
Guido Günther 945435f0b5 docs: Expand the examples section a bit 2024-05-11 13:59:55 +02:00
Guido Günther ec6e86ee0c Document changes and release 0.3.0 2024-04-21 12:20:58 +02:00
Guido Günther 2d1d72c746 feedback-manager: Handle important hint
This allows blessed apps to override the per-app as well as the global
feedback level. This can e.g. be useful for alarm clocks.
2024-04-20 13:21:56 +00:00
Guido Günther f575d32651 cli: Allow to set important hint 2024-04-20 13:21:56 +00:00
Guido Günther 716f296ab8 feedback-manager: Parse important hint 2024-04-20 13:21:56 +00:00
Guido Günther 14ffd9722d libfeedback: Allow to set important hint 2024-04-20 13:21:56 +00:00
Guido Günther e6845a52d3 feedback-manager: Use MIN()
A bit easier to read
2024-04-20 13:21:56 +00:00
Guido Günther 6a5d558a83 fbcli: Allow to override app-id
Useful for testing
2024-04-20 13:21:56 +00:00
Guido Günther 7640a73e82 data/schema: Add 'allow-override' gsetting
This allows to list apps that can override the currently
effective feedback level by setting the 'impotant' hint in
the event.
2024-04-20 13:21:56 +00:00
Guido Günther f71ece5d8b data/dbus: Document important hint
The important hint can be used by apps to override the current per app
or system wide feedback level (if the feedback server allows it).
2024-04-20 13:21:56 +00:00