Acelerômetro do usuário para girar a tela

2
lsmod | grep acc
hp_accel               28672  0
lis3lv02d              20480  1 hp_accel

Como obtenho saída desta coisa?

e há xrandr --output eDP1 --rotate normal ou inverted ou left ou right . Eu quero usar a saída do sensor para acionar esses comandos & amp; fazer rotação de tela.

edit:

Depois de atualizar o kernel agora eu recebo isso quando eu corro lsmod | grep acc

hid_sensor_accel_3d    16384  1
hid_sensor_trigger     16384  15 hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_magn_3d,hid_sensor_gyro_3d,hid_sensor_rotation
industrialio_triggered_buffer    16384  5 hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_magn_3d,hid_sensor_gyro_3d,hid_sensor_rotation
hid_sensor_iio_common    16384  6 hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_trigger,hid_sensor_magn_3d,hid_sensor_gyro_3d,hid_sensor_rotation
industrialio           69632  10 hid_sensor_incl_3d,hid_sensor_accel_3d,acpi_als,hid_sensor_trigger,hid_sensor_magn_3d,hid_sensor_gyro_3d,hid_sensor_rotation,industrialio_triggered_buffer,kfifo_buf
hp_accel               28672  0
lis3lv02d              20480  1 hp_accel
hid_sensor_hub         20480  8 hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_iio_common,hid_sensor_trigger,hid_sensor_magn_3d,hid_sensor_gyro_3d,hid_sensor_rotation,hid_sensor_custom

edit2:

O iio-sensor-proxy não está sendo executado. Tentando sudo iio-sensor-proxy

** (process:2721): WARNING **: Failed to read float from /sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001F:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device6/in_scale

** (process:2721): WARNING **: Problem reading scan element information: /sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001F:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device6

e o terminal permanece em branco até eu ^C .

Tentar que sudo systemctl start iio-sensor-proxy não produza nada até o limite de tempo

Job for iio-sensor-proxy.service failed because a timeout was exceeded. See "systemctl status iio-sensor-proxy.service" and "journalctl -xe" for details.

systemctl status iio-sensor-proxy.service

● iio-sensor-proxy.service - IIO Sensor Proxy service
   Loaded: loaded (/lib/systemd/system/iio-sensor-proxy.service; static; vendor preset: enabled)
   Active: failed (Result: timeout) since Wed 2017-05-24 16:12:03 EET; 5min ago
  Process: 3335 ExecStart=/usr/sbin/iio-sensor-proxy (code=killed, signal=TERM)
 Main PID: 3335 (code=killed, signal=TERM)

May 24 16:10:33 gas systemd[1]: Starting IIO Sensor Proxy service...
May 24 16:12:03 gas systemd[1]: iio-sensor-proxy.service: Start operation timed out. Terminating.
May 24 16:12:03 gas systemd[1]: Failed to start IIO Sensor Proxy service.
May 24 16:12:03 gas systemd[1]: iio-sensor-proxy.service: Unit entered failed state.
May 24 16:12:03 gas systemd[1]: iio-sensor-proxy.service: Failed with result 'timeout'.

journalctl -xe (provavelmente não é muito útil)

May 24 16:11:26 gas kernel: intel-vbtn INT33D6:01: unknown event index 0xcd
May 24 16:12:03 gas systemd[1]: iio-sensor-proxy.service: Start operation timed out. Terminating.
May 24 16:12:03 gas systemd[1]: Failed to start IIO Sensor Proxy service.
-- Subject: Unit iio-sensor-proxy.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit iio-sensor-proxy.service has failed.
-- 
-- The result is failed.
May 24 16:12:03 gas systemd[1]: iio-sensor-proxy.service: Unit entered failed state.
May 24 16:12:03 gas systemd[1]: iio-sensor-proxy.service: Failed with result 'timeout'.
May 24 16:12:03 gas sudo[3855]: pam_unix(sudo:session): session closed for user root
May 24 16:12:17 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:12:17 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:12:17 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:12:17 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:12:17 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:12:17 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:12:17 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:12:17 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:12:17 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:13:40 gas anacron[775]: Job 'cron.daily' terminated
May 24 16:13:40 gas anacron[775]: Normal exit (1 job run)
May 24 16:13:50 gas org.gnome.zeitgeist.SimpleIndexer[1779]: ** (zeitgeist-fts:2514): WARNING **: Unable 
May 24 16:14:14 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:14:14 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:14:14 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:14:14 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:14:14 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:14:14 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:14:14 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:14:14 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:14:14 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:14:43 gas org.gnome.zeitgeist.SimpleIndexer[1779]: ** (zeitgeist-fts:2514): WARNING **: Unable 
May 24 16:15:01 gas CRON[4519]: pam_unix(cron:session): session opened for user root by (uid=0)
May 24 16:15:01 gas CRON[4520]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
May 24 16:15:01 gas CRON[4519]: pam_unix(cron:session): session closed for user root
May 24 16:15:02 gas org.gnome.zeitgeist.SimpleIndexer[1779]: ** (zeitgeist-fts:2514): WARNING **: Unable 
May 24 16:15:15 gas org.gnome.zeitgeist.SimpleIndexer[1779]: ** (zeitgeist-fts:2514): WARNING **: Unable 
May 24 16:15:26 gas org.gnome.zeitgeist.SimpleIndexer[1779]: ** (zeitgeist-fts:2514): WARNING **: Unable 
May 24 16:15:49 gas /usr/lib/snapd/snapd[790]: snapmgr.go:450: No snaps to auto-refresh found
May 24 16:15:49 gas snapd[790]: 2017/05/24 16:15:49.321528 snapmgr.go:450: No snaps to auto-refresh found
May 24 16:15:51 gas org.gnome.zeitgeist.SimpleIndexer[1779]: ** (zeitgeist-fts:2514): WARNING **: Unable 
May 24 16:16:13 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:16:13 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:16:13 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:16:13 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:16:13 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:16:13 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:16:13 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:16:13 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:16:13 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:16:58 gas org.gnome.zeitgeist.SimpleIndexer[1779]: ** (zeitgeist-fts:2514): WARNING **: Unable 
May 24 16:17:01 gas CRON[4669]: pam_unix(cron:session): session opened for user root by (uid=0)
May 24 16:17:01 gas CRON[4670]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
May 24 16:17:01 gas CRON[4669]: pam_unix(cron:session): session closed for user root
May 24 16:17:46 gas org.gnome.zeitgeist.SimpleIndexer[1779]: ** (zeitgeist-fts:2514): WARNING **: Unable 
May 24 16:18:00 gas org.gnome.zeitgeist.SimpleIndexer[1779]: ** (zeitgeist-fts:2514): WARNING **: Unable

... e sim o nome do meu computador é gás X'D

Espero que consigamos consertar essa coisa de sensor. Estou desesperado para fazer isso funcionar. Parece que estamos chegando lá:)

    
por Mina Michael 05.03.2017 / 17:29

1 resposta

2

Isso não é uma solução, mas um ponteiro na direção certa. Eu também procurei por um método para fazer isso. Eu encontrei o link do iio-sensor-proxy e estou no processo de escrever um pequeno daemon que vai resolver isso.

Isso é o que recebo quando executo o sensor do monitor e giro a tela 90 graus para a direita.

> monitor-sensor 
    Waiting for iio-sensor-proxy to appear
+++ iio-sensor-proxy appeared
=== Has accelerometer (orientation: undefined)
=== Has ambient light sensor (value: 0.000000, unit: lux)
    Accelerometer orientation changed: normal
    Light changed: 6.098000 (lux)
    Light changed: 168.823008 (lux)
    Light changed: 167.266008 (lux)
    Light changed: 161.816008 (lux)
    Light changed: 183.098009 (lux)
    Accelerometer orientation changed: left-up
    Light changed: 204.379010 (lux)
    Light changed: 214.241010 (lux)
    Light changed: 214.371010 (lux)
    Accelerometer orientation changed: normal
    Light changed: 179.724009 (lux)
    Light changed: 170.121008 (lux)
    Light changed: 170.900008 (lux)
    
por bengan 18.05.2017 / 09:26