Bug 353463 - RFE: Make use of iio-sensor-proxy
Summary: RFE: Make use of iio-sensor-proxy
Status: RESOLVED FIXED
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 5.4.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Development Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-02 19:10 UTC by Jakub Bittner
Modified: 2020-07-22 21:17 UTC (History)
19 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Bittner 2015-10-02 19:10:19 UTC
Hello,

I have notebook with some sensors (light, rotation...) and I think, that KDE should be able to read those sensors and change its behavior if changed.

Gnome is going to use iio-sensor-proxy ( https://github.com/hadess/iio-sensor-proxy ) to change backlight.
Comment 1 David Edmundson 2015-10-03 21:37:02 UTC
I'll make sure the hardware people know.
Not a bug in plasmashell
Comment 2 Kai Uwe Broulik 2015-10-03 21:55:48 UTC
Looks interesting.
Comment 3 David Edmundson 2015-10-03 22:28:35 UTC
aye. DBus interface looks pretty easy.

Path is a bit odd it's /net/thedudesname on the system bus

Will need to be 2 fold. backlight stuff in powerdevil

accelerometer stuff in kscreen daemon
Comment 4 Vincent Petry 2015-11-25 07:32:19 UTC
I have a Dell XPS 13 9333 laptop and the acpi-als driver started working in recent kernel versions (4.2.3).

Adding self to CC to follow progress of this interesting feature :-)
Comment 5 adr.fantini 2017-12-18 19:58:07 UTC
This is still relevant. GNOME uses it and it works beautifully, especially for screen rotation for tablets and 2-in-1 laptops. An example implementation is given by:
https://github.com/mrquincle/yoga-900-auto-rotate

KDE will sooner or later need to have an autorotation feature and iio-sensor-proxy really seems the right way forward.
Comment 6 Kai Uwe Broulik 2017-12-18 20:06:29 UTC
We do have auto screen rotation on Wayland nowadays. Auto-brightness needs significant re-engineering effort in PowerDevil (needs to be done eventually, especially for Plasma Mobile) but that entire module needs to be completely overhauled.
Comment 7 Martin Flöser 2017-12-18 20:21:42 UTC
For the record there is no need to look at the dbus interface at all: QSensors wraps those with a nice API.
Comment 8 Kai Uwe Broulik 2017-12-18 20:23:13 UTC
QtSensors does not support ambient light sensor on Linux.
Comment 9 Martin Flöser 2017-12-18 20:30:28 UTC
(In reply to Kai Uwe Broulik from comment #8)
> QtSensors does not support ambient light sensor on Linux.

I think it does: https://code.qt.io/cgit/qt/qtsensors.git/tree/src/plugins/sensors/iio-sensor-proxy/iiosensorproxylightsensor.cpp
Comment 10 Kai Uwe Broulik 2017-12-18 20:32:31 UTC
Coooool. So their Wiki is out of date, who would have thought. I'll play around with it a bit, thanks.
Comment 11 Sebastian Krzyszkowiak 2018-01-24 01:55:30 UTC
I have written kded module for screen rotation already, tested with Yoga 2 Pro and Yoga 900. Uses Plasma's OSD to show that the rotation is about to occur, giving the user some time to cancel if he didn't mean to rotate and just tilted the device a bit too much.

It should probably use KScreen instead of shell script to rotate the screen; also "mediaPlayerVolumeChanged" may not be the best option for OSD :D The script also hardcodes the touchscreen device name in order to keep it in sync with rotation. So it's not exactly in upstreamable quality yet, but maybe someone will find it useful :)

https://github.com/dos1/kded_rotation
Comment 12 Ulf Bartholomäus 2020-04-17 20:33:30 UTC
Any news about this request?

So at my Fujitsu U939X - iio-sensor-proxy seems to work:
> monitor-sensor 
    Waiting for iio-sensor-proxy to appear
+++ iio-sensor-proxy appeared
=== Has accelerometer (orientation: normal)
=== No ambient light sensor
    Accelerometer orientation changed: left-up
    Accelerometer orientation changed: normal
    Accelerometer orientation changed: right-up
    Accelerometer orientation changed: normal
    Accelerometer orientation changed: bottom-up
Comment 13 Nate Graham 2020-07-22 20:41:40 UTC
Sebastian, would you be willing to consider upstreaming your kded module? Seems like it would be handy to have. We can help you polish it up, of course.
Comment 14 David Edmundson 2020-07-22 21:17:45 UTC
Kscreen currently supports QtSensors. QtSensors supports iio-sensor-proxy.

That has been merged. If there is a bug in that it needs to be addressed with more detail.