accelerometer + screen rotation on non-touchscreen laptop?












4














I've recently got a non-touchscreen hp laptop with a hdd accelerometer. After upgrading it to Debian testing I noticed that whenever I tilt my laptop upwards past +45 deg, the screen rotates upside down. The opposite happens when I tilt my laptop -45 deg. To clarify, I am facing my laptop with the screen facing me with the keyboard parallel to the ground. The screen also rotates whenever I tilt my laptop clockwise or counterclockwise.



Is there a file where I can edit to change the screen's rotational direction?



The accelerometer in /proc/bus/input/devices shows this:



    I: Bus=0019 Vendor=0000 Product=0000 Version=0000
N: Name="ST LIS3LV02DL Accelerometer"
P: Phys=lis3lv02d/input0
S: Sysfs=/devices/platform/lis3lv02d/input/input7
U: Uniq=
H: Handlers=event6 js0
B: PROP=0
B: EV=9
B: ABS=7


EDIT:



I found that watch -n 1 'cat /sys/devices/platform/lis3lv02d/position' is similar to what is found with the command below. Except it just displays coordinates such as (18,18,1098).



evtest /dev/input/event6 shows this:



    william@wksp0:~/Downloads$ sudo evtest /dev/input/event6
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0
Input device name: "ST LIS3LV02DL Accelerometer"
Supported events:
Event type 0 (EV_SYN)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 20
Min -2304
Max 2304
Fuzz 18
Flat 18
Event code 1 (ABS_Y)
Value -38
Min -2304
Max 2304
Fuzz 18
Flat 18
Event code 2 (ABS_Z)
Value 1105
Min -2304
Max 2304
Fuzz 18
Flat 18
Properties:
Testing ... (interrupt to exit)
Event: time 1483747056.088195, type 3 (EV_ABS), code 1 (ABS_Y), value -23
Event: time 1483747056.088195, -------------- SYN_REPORT ------------
Event: time 1483747056.124189, type 3 (EV_ABS), code 0 (ABS_X), value 20
Event: time 1483747056.124189, type 3 (EV_ABS), code 1 (ABS_Y), value -38
Event: time 1483747056.124189, type 3 (EV_ABS), code 2 (ABS_Z), value 1105
Event: time 1483747056.124189, -------------- SYN_REPORT ------------
Event: time 1483747056.210931, type 3 (EV_ABS), code 0 (ABS_X), value -18
Event: time 1483747056.210931, type 3 (EV_ABS), code 1 (ABS_Y), value -28
Event: time 1483747056.210931, type 3 (EV_ABS), code 2 (ABS_Z), value 1107...


EDIT2:



After some googling, I've come across this which lead me to some interesting files that have little to no help on this. :P










share|improve this question
























  • note: I am not looking to disable or blacklist the accelerometer. I just want the screen to rotate the other direction
    – MrWm
    Jan 6 '17 at 2:30










  • First I'd try to find out what is causing the behaviour: BIOS, some system program, .... Does xrandr show a rotated screen if the screen is rotated? What kind of events do you get for``evtest /dev/input/event6`? (assuming it's event6 on every boot, check the path).
    – dirkt
    Jan 6 '17 at 6:26










  • yup, xrandr shows that the screen is rotated when the event happens. From what I can tell, it's not a BIOS thing but either a kernel thing or a program thing.
    – MrWm
    Jan 6 '17 at 23:59










  • Are you using gnome 3.18 or 3.20 in combination with iio-sensor-proxy (comes to gnome by default)?
    – George Vasiliou
    Jan 7 '17 at 0:17










  • I'm using cinnamon and yes, I also have iio-sensor-proxy installed.
    – MrWm
    Jan 7 '17 at 0:22
















4














I've recently got a non-touchscreen hp laptop with a hdd accelerometer. After upgrading it to Debian testing I noticed that whenever I tilt my laptop upwards past +45 deg, the screen rotates upside down. The opposite happens when I tilt my laptop -45 deg. To clarify, I am facing my laptop with the screen facing me with the keyboard parallel to the ground. The screen also rotates whenever I tilt my laptop clockwise or counterclockwise.



Is there a file where I can edit to change the screen's rotational direction?



The accelerometer in /proc/bus/input/devices shows this:



    I: Bus=0019 Vendor=0000 Product=0000 Version=0000
N: Name="ST LIS3LV02DL Accelerometer"
P: Phys=lis3lv02d/input0
S: Sysfs=/devices/platform/lis3lv02d/input/input7
U: Uniq=
H: Handlers=event6 js0
B: PROP=0
B: EV=9
B: ABS=7


EDIT:



I found that watch -n 1 'cat /sys/devices/platform/lis3lv02d/position' is similar to what is found with the command below. Except it just displays coordinates such as (18,18,1098).



evtest /dev/input/event6 shows this:



    william@wksp0:~/Downloads$ sudo evtest /dev/input/event6
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0
Input device name: "ST LIS3LV02DL Accelerometer"
Supported events:
Event type 0 (EV_SYN)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 20
Min -2304
Max 2304
Fuzz 18
Flat 18
Event code 1 (ABS_Y)
Value -38
Min -2304
Max 2304
Fuzz 18
Flat 18
Event code 2 (ABS_Z)
Value 1105
Min -2304
Max 2304
Fuzz 18
Flat 18
Properties:
Testing ... (interrupt to exit)
Event: time 1483747056.088195, type 3 (EV_ABS), code 1 (ABS_Y), value -23
Event: time 1483747056.088195, -------------- SYN_REPORT ------------
Event: time 1483747056.124189, type 3 (EV_ABS), code 0 (ABS_X), value 20
Event: time 1483747056.124189, type 3 (EV_ABS), code 1 (ABS_Y), value -38
Event: time 1483747056.124189, type 3 (EV_ABS), code 2 (ABS_Z), value 1105
Event: time 1483747056.124189, -------------- SYN_REPORT ------------
Event: time 1483747056.210931, type 3 (EV_ABS), code 0 (ABS_X), value -18
Event: time 1483747056.210931, type 3 (EV_ABS), code 1 (ABS_Y), value -28
Event: time 1483747056.210931, type 3 (EV_ABS), code 2 (ABS_Z), value 1107...


EDIT2:



After some googling, I've come across this which lead me to some interesting files that have little to no help on this. :P










share|improve this question
























  • note: I am not looking to disable or blacklist the accelerometer. I just want the screen to rotate the other direction
    – MrWm
    Jan 6 '17 at 2:30










  • First I'd try to find out what is causing the behaviour: BIOS, some system program, .... Does xrandr show a rotated screen if the screen is rotated? What kind of events do you get for``evtest /dev/input/event6`? (assuming it's event6 on every boot, check the path).
    – dirkt
    Jan 6 '17 at 6:26










  • yup, xrandr shows that the screen is rotated when the event happens. From what I can tell, it's not a BIOS thing but either a kernel thing or a program thing.
    – MrWm
    Jan 6 '17 at 23:59










  • Are you using gnome 3.18 or 3.20 in combination with iio-sensor-proxy (comes to gnome by default)?
    – George Vasiliou
    Jan 7 '17 at 0:17










  • I'm using cinnamon and yes, I also have iio-sensor-proxy installed.
    – MrWm
    Jan 7 '17 at 0:22














4












4








4


1





I've recently got a non-touchscreen hp laptop with a hdd accelerometer. After upgrading it to Debian testing I noticed that whenever I tilt my laptop upwards past +45 deg, the screen rotates upside down. The opposite happens when I tilt my laptop -45 deg. To clarify, I am facing my laptop with the screen facing me with the keyboard parallel to the ground. The screen also rotates whenever I tilt my laptop clockwise or counterclockwise.



Is there a file where I can edit to change the screen's rotational direction?



The accelerometer in /proc/bus/input/devices shows this:



    I: Bus=0019 Vendor=0000 Product=0000 Version=0000
N: Name="ST LIS3LV02DL Accelerometer"
P: Phys=lis3lv02d/input0
S: Sysfs=/devices/platform/lis3lv02d/input/input7
U: Uniq=
H: Handlers=event6 js0
B: PROP=0
B: EV=9
B: ABS=7


EDIT:



I found that watch -n 1 'cat /sys/devices/platform/lis3lv02d/position' is similar to what is found with the command below. Except it just displays coordinates such as (18,18,1098).



evtest /dev/input/event6 shows this:



    william@wksp0:~/Downloads$ sudo evtest /dev/input/event6
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0
Input device name: "ST LIS3LV02DL Accelerometer"
Supported events:
Event type 0 (EV_SYN)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 20
Min -2304
Max 2304
Fuzz 18
Flat 18
Event code 1 (ABS_Y)
Value -38
Min -2304
Max 2304
Fuzz 18
Flat 18
Event code 2 (ABS_Z)
Value 1105
Min -2304
Max 2304
Fuzz 18
Flat 18
Properties:
Testing ... (interrupt to exit)
Event: time 1483747056.088195, type 3 (EV_ABS), code 1 (ABS_Y), value -23
Event: time 1483747056.088195, -------------- SYN_REPORT ------------
Event: time 1483747056.124189, type 3 (EV_ABS), code 0 (ABS_X), value 20
Event: time 1483747056.124189, type 3 (EV_ABS), code 1 (ABS_Y), value -38
Event: time 1483747056.124189, type 3 (EV_ABS), code 2 (ABS_Z), value 1105
Event: time 1483747056.124189, -------------- SYN_REPORT ------------
Event: time 1483747056.210931, type 3 (EV_ABS), code 0 (ABS_X), value -18
Event: time 1483747056.210931, type 3 (EV_ABS), code 1 (ABS_Y), value -28
Event: time 1483747056.210931, type 3 (EV_ABS), code 2 (ABS_Z), value 1107...


EDIT2:



After some googling, I've come across this which lead me to some interesting files that have little to no help on this. :P










share|improve this question















I've recently got a non-touchscreen hp laptop with a hdd accelerometer. After upgrading it to Debian testing I noticed that whenever I tilt my laptop upwards past +45 deg, the screen rotates upside down. The opposite happens when I tilt my laptop -45 deg. To clarify, I am facing my laptop with the screen facing me with the keyboard parallel to the ground. The screen also rotates whenever I tilt my laptop clockwise or counterclockwise.



Is there a file where I can edit to change the screen's rotational direction?



The accelerometer in /proc/bus/input/devices shows this:



    I: Bus=0019 Vendor=0000 Product=0000 Version=0000
N: Name="ST LIS3LV02DL Accelerometer"
P: Phys=lis3lv02d/input0
S: Sysfs=/devices/platform/lis3lv02d/input/input7
U: Uniq=
H: Handlers=event6 js0
B: PROP=0
B: EV=9
B: ABS=7


EDIT:



I found that watch -n 1 'cat /sys/devices/platform/lis3lv02d/position' is similar to what is found with the command below. Except it just displays coordinates such as (18,18,1098).



evtest /dev/input/event6 shows this:



    william@wksp0:~/Downloads$ sudo evtest /dev/input/event6
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0
Input device name: "ST LIS3LV02DL Accelerometer"
Supported events:
Event type 0 (EV_SYN)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 20
Min -2304
Max 2304
Fuzz 18
Flat 18
Event code 1 (ABS_Y)
Value -38
Min -2304
Max 2304
Fuzz 18
Flat 18
Event code 2 (ABS_Z)
Value 1105
Min -2304
Max 2304
Fuzz 18
Flat 18
Properties:
Testing ... (interrupt to exit)
Event: time 1483747056.088195, type 3 (EV_ABS), code 1 (ABS_Y), value -23
Event: time 1483747056.088195, -------------- SYN_REPORT ------------
Event: time 1483747056.124189, type 3 (EV_ABS), code 0 (ABS_X), value 20
Event: time 1483747056.124189, type 3 (EV_ABS), code 1 (ABS_Y), value -38
Event: time 1483747056.124189, type 3 (EV_ABS), code 2 (ABS_Z), value 1105
Event: time 1483747056.124189, -------------- SYN_REPORT ------------
Event: time 1483747056.210931, type 3 (EV_ABS), code 0 (ABS_X), value -18
Event: time 1483747056.210931, type 3 (EV_ABS), code 1 (ABS_Y), value -28
Event: time 1483747056.210931, type 3 (EV_ABS), code 2 (ABS_Z), value 1107...


EDIT2:



After some googling, I've come across this which lead me to some interesting files that have little to no help on this. :P







debian hard-disk sensors joystick






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 7 '17 at 0:20

























asked Jan 6 '17 at 2:27









MrWm

53127




53127












  • note: I am not looking to disable or blacklist the accelerometer. I just want the screen to rotate the other direction
    – MrWm
    Jan 6 '17 at 2:30










  • First I'd try to find out what is causing the behaviour: BIOS, some system program, .... Does xrandr show a rotated screen if the screen is rotated? What kind of events do you get for``evtest /dev/input/event6`? (assuming it's event6 on every boot, check the path).
    – dirkt
    Jan 6 '17 at 6:26










  • yup, xrandr shows that the screen is rotated when the event happens. From what I can tell, it's not a BIOS thing but either a kernel thing or a program thing.
    – MrWm
    Jan 6 '17 at 23:59










  • Are you using gnome 3.18 or 3.20 in combination with iio-sensor-proxy (comes to gnome by default)?
    – George Vasiliou
    Jan 7 '17 at 0:17










  • I'm using cinnamon and yes, I also have iio-sensor-proxy installed.
    – MrWm
    Jan 7 '17 at 0:22


















  • note: I am not looking to disable or blacklist the accelerometer. I just want the screen to rotate the other direction
    – MrWm
    Jan 6 '17 at 2:30










  • First I'd try to find out what is causing the behaviour: BIOS, some system program, .... Does xrandr show a rotated screen if the screen is rotated? What kind of events do you get for``evtest /dev/input/event6`? (assuming it's event6 on every boot, check the path).
    – dirkt
    Jan 6 '17 at 6:26










  • yup, xrandr shows that the screen is rotated when the event happens. From what I can tell, it's not a BIOS thing but either a kernel thing or a program thing.
    – MrWm
    Jan 6 '17 at 23:59










  • Are you using gnome 3.18 or 3.20 in combination with iio-sensor-proxy (comes to gnome by default)?
    – George Vasiliou
    Jan 7 '17 at 0:17










  • I'm using cinnamon and yes, I also have iio-sensor-proxy installed.
    – MrWm
    Jan 7 '17 at 0:22
















note: I am not looking to disable or blacklist the accelerometer. I just want the screen to rotate the other direction
– MrWm
Jan 6 '17 at 2:30




note: I am not looking to disable or blacklist the accelerometer. I just want the screen to rotate the other direction
– MrWm
Jan 6 '17 at 2:30












First I'd try to find out what is causing the behaviour: BIOS, some system program, .... Does xrandr show a rotated screen if the screen is rotated? What kind of events do you get for``evtest /dev/input/event6`? (assuming it's event6 on every boot, check the path).
– dirkt
Jan 6 '17 at 6:26




First I'd try to find out what is causing the behaviour: BIOS, some system program, .... Does xrandr show a rotated screen if the screen is rotated? What kind of events do you get for``evtest /dev/input/event6`? (assuming it's event6 on every boot, check the path).
– dirkt
Jan 6 '17 at 6:26












yup, xrandr shows that the screen is rotated when the event happens. From what I can tell, it's not a BIOS thing but either a kernel thing or a program thing.
– MrWm
Jan 6 '17 at 23:59




yup, xrandr shows that the screen is rotated when the event happens. From what I can tell, it's not a BIOS thing but either a kernel thing or a program thing.
– MrWm
Jan 6 '17 at 23:59












Are you using gnome 3.18 or 3.20 in combination with iio-sensor-proxy (comes to gnome by default)?
– George Vasiliou
Jan 7 '17 at 0:17




Are you using gnome 3.18 or 3.20 in combination with iio-sensor-proxy (comes to gnome by default)?
– George Vasiliou
Jan 7 '17 at 0:17












I'm using cinnamon and yes, I also have iio-sensor-proxy installed.
– MrWm
Jan 7 '17 at 0:22




I'm using cinnamon and yes, I also have iio-sensor-proxy installed.
– MrWm
Jan 7 '17 at 0:22










3 Answers
3






active

oldest

votes


















3














The whole story you mention is actually a kind of bug in iio-sensor-proxy or in your DE code who makes use of iio-sensor-proxy info.



Is not bios or kernel that does the rotation but the marriage between iio-sensor-proxy and your Desktop Environment.



DE like Gnome (and Cinnamon as turns out) does screen auto rotate based on the data provided by iio-sensor-proxy in dbus.



You can try to remove/purge iio-sensor-proxy and screen rotation will go away completely.



It is not clear if this is a iio-sensor-proxy bug or a Cinnamon bug. It could be iio-sensor-proxy that is reading in a wrong way your accelerometer data or could be Cinnamon who even if it receives correct data by sensor-proxy, rotates the screen wrongly.



You can clarify this issue by running monitor-sensor in root terminal.
This utility comes with iio-sensor-proxy package and displays in terminal the current state of accelerometer / current screen orientation.

If orientation is correctly displayed by monitor-sensor then it is a Cinnamon bug. But i'm 90% sure that this is an iio-sensor-proxy bug and you should report it to the developer.



PS: It had been also mentioned that sensor-proxy had been working well with kernels up to version 4.7 but had some problems with kernel 4.8 and above. You could try to install an older kernel (i.e 4.7) for testing.



If monitor-sensor reports correctly the orientation and this is a Cinnamon bug, as a workaround you could disable Cinnamon auto screen rotation feature and run a kind of shell script that will make the correct rotation based on the data of monitor-sensor.



PS: Gnome gives the option to completely disable auto screen rotation, i'm not sure if Cinnamon has this option too.



In XFCE that iio-sensor-proxy is installed but XFCE devs are not performing auto screen rotation (yet) we apply this script to have auto screen rotation: https://linuxappfinder.com/blog/auto_screen_rotation_in_ubuntu



PS: Improved version for touch screens with transformation matrix: https://github.com/gevasiliou/PythonTests/blob/master/autorot.sh



Update for future reference / future "google searches"



As advised in comments, by running monitor-sensor in a root terminal and observing the messages provided by iio-sensor-proxy it proved that iio-sensor-proxy is correctly understood the real screen orientation.

As a result this seems to be a Cinnamon bug that though it gets correct info by iio-sensor-proxy is rotating the screen wrongly.



You can disable the Cinnamon auto rotation feature and try the auto-rotation script as advised above (https://linuxappfinder.com/blog/auto_screen_rotation_in_ubuntu).



To disable Cinnamon internal autorotation you need to apply settings set org.cinnamon.settings-daemon.plugins.orientation active false as advised in OP's comment.






share|improve this answer























  • I see that monitor-sensor has the right orientations. Now all I just need to figure out is how to disable the auto screen rotation on this. :P
    – MrWm
    Jan 7 '17 at 7:17










  • finally found it: settings set org.cinnamon.settings-daemon.plugins.orientation active false
    – MrWm
    Jan 10 '17 at 7:59










  • @MrWm Good job! Does it work ? I mean does it disables auto rotation as expected? PS: If you like you could file this bug to Cinnamon people to have this issue fixed. It is very nice that Desktop Environments start to support auto screen rotation (some months ago was only Gnome3) , so it is important to be made right!
    – George Vasiliou
    Jan 10 '17 at 8:59










  • yep, it disables the screen rotation. It's basically the same command used in gnome except the "gnome" is swapped with "cinnamon". :)
    – MrWm
    Jan 11 '17 at 23:55





















3














Using dconf-editor, change the key value for



/org/cinnamon/settings-daemon/plugins/orientation/active


to False.



This is identical to the command line solution presented above, but uses the gui tool dconf-editor.






share|improve this answer































    0














    The iio-sensor-proxy issue doesn't explain all these problems.



    On my Unbuntu 18.04 build when ever the screen randomly rotated the mouse input coordinates did not rotate in unison. Mouse X/Y was always the the same direction meaning the direction of the screen and mouse coordinates could be inverted to each other.



    I'm sure if the screen was flipped by the GUI it would also flip the mouse!






    share|improve this answer








    New contributor




    Walter ZAMBOTTI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.


















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "106"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f335260%2faccelerometer-screen-rotation-on-non-touchscreen-laptop%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      3














      The whole story you mention is actually a kind of bug in iio-sensor-proxy or in your DE code who makes use of iio-sensor-proxy info.



      Is not bios or kernel that does the rotation but the marriage between iio-sensor-proxy and your Desktop Environment.



      DE like Gnome (and Cinnamon as turns out) does screen auto rotate based on the data provided by iio-sensor-proxy in dbus.



      You can try to remove/purge iio-sensor-proxy and screen rotation will go away completely.



      It is not clear if this is a iio-sensor-proxy bug or a Cinnamon bug. It could be iio-sensor-proxy that is reading in a wrong way your accelerometer data or could be Cinnamon who even if it receives correct data by sensor-proxy, rotates the screen wrongly.



      You can clarify this issue by running monitor-sensor in root terminal.
      This utility comes with iio-sensor-proxy package and displays in terminal the current state of accelerometer / current screen orientation.

      If orientation is correctly displayed by monitor-sensor then it is a Cinnamon bug. But i'm 90% sure that this is an iio-sensor-proxy bug and you should report it to the developer.



      PS: It had been also mentioned that sensor-proxy had been working well with kernels up to version 4.7 but had some problems with kernel 4.8 and above. You could try to install an older kernel (i.e 4.7) for testing.



      If monitor-sensor reports correctly the orientation and this is a Cinnamon bug, as a workaround you could disable Cinnamon auto screen rotation feature and run a kind of shell script that will make the correct rotation based on the data of monitor-sensor.



      PS: Gnome gives the option to completely disable auto screen rotation, i'm not sure if Cinnamon has this option too.



      In XFCE that iio-sensor-proxy is installed but XFCE devs are not performing auto screen rotation (yet) we apply this script to have auto screen rotation: https://linuxappfinder.com/blog/auto_screen_rotation_in_ubuntu



      PS: Improved version for touch screens with transformation matrix: https://github.com/gevasiliou/PythonTests/blob/master/autorot.sh



      Update for future reference / future "google searches"



      As advised in comments, by running monitor-sensor in a root terminal and observing the messages provided by iio-sensor-proxy it proved that iio-sensor-proxy is correctly understood the real screen orientation.

      As a result this seems to be a Cinnamon bug that though it gets correct info by iio-sensor-proxy is rotating the screen wrongly.



      You can disable the Cinnamon auto rotation feature and try the auto-rotation script as advised above (https://linuxappfinder.com/blog/auto_screen_rotation_in_ubuntu).



      To disable Cinnamon internal autorotation you need to apply settings set org.cinnamon.settings-daemon.plugins.orientation active false as advised in OP's comment.






      share|improve this answer























      • I see that monitor-sensor has the right orientations. Now all I just need to figure out is how to disable the auto screen rotation on this. :P
        – MrWm
        Jan 7 '17 at 7:17










      • finally found it: settings set org.cinnamon.settings-daemon.plugins.orientation active false
        – MrWm
        Jan 10 '17 at 7:59










      • @MrWm Good job! Does it work ? I mean does it disables auto rotation as expected? PS: If you like you could file this bug to Cinnamon people to have this issue fixed. It is very nice that Desktop Environments start to support auto screen rotation (some months ago was only Gnome3) , so it is important to be made right!
        – George Vasiliou
        Jan 10 '17 at 8:59










      • yep, it disables the screen rotation. It's basically the same command used in gnome except the "gnome" is swapped with "cinnamon". :)
        – MrWm
        Jan 11 '17 at 23:55


















      3














      The whole story you mention is actually a kind of bug in iio-sensor-proxy or in your DE code who makes use of iio-sensor-proxy info.



      Is not bios or kernel that does the rotation but the marriage between iio-sensor-proxy and your Desktop Environment.



      DE like Gnome (and Cinnamon as turns out) does screen auto rotate based on the data provided by iio-sensor-proxy in dbus.



      You can try to remove/purge iio-sensor-proxy and screen rotation will go away completely.



      It is not clear if this is a iio-sensor-proxy bug or a Cinnamon bug. It could be iio-sensor-proxy that is reading in a wrong way your accelerometer data or could be Cinnamon who even if it receives correct data by sensor-proxy, rotates the screen wrongly.



      You can clarify this issue by running monitor-sensor in root terminal.
      This utility comes with iio-sensor-proxy package and displays in terminal the current state of accelerometer / current screen orientation.

      If orientation is correctly displayed by monitor-sensor then it is a Cinnamon bug. But i'm 90% sure that this is an iio-sensor-proxy bug and you should report it to the developer.



      PS: It had been also mentioned that sensor-proxy had been working well with kernels up to version 4.7 but had some problems with kernel 4.8 and above. You could try to install an older kernel (i.e 4.7) for testing.



      If monitor-sensor reports correctly the orientation and this is a Cinnamon bug, as a workaround you could disable Cinnamon auto screen rotation feature and run a kind of shell script that will make the correct rotation based on the data of monitor-sensor.



      PS: Gnome gives the option to completely disable auto screen rotation, i'm not sure if Cinnamon has this option too.



      In XFCE that iio-sensor-proxy is installed but XFCE devs are not performing auto screen rotation (yet) we apply this script to have auto screen rotation: https://linuxappfinder.com/blog/auto_screen_rotation_in_ubuntu



      PS: Improved version for touch screens with transformation matrix: https://github.com/gevasiliou/PythonTests/blob/master/autorot.sh



      Update for future reference / future "google searches"



      As advised in comments, by running monitor-sensor in a root terminal and observing the messages provided by iio-sensor-proxy it proved that iio-sensor-proxy is correctly understood the real screen orientation.

      As a result this seems to be a Cinnamon bug that though it gets correct info by iio-sensor-proxy is rotating the screen wrongly.



      You can disable the Cinnamon auto rotation feature and try the auto-rotation script as advised above (https://linuxappfinder.com/blog/auto_screen_rotation_in_ubuntu).



      To disable Cinnamon internal autorotation you need to apply settings set org.cinnamon.settings-daemon.plugins.orientation active false as advised in OP's comment.






      share|improve this answer























      • I see that monitor-sensor has the right orientations. Now all I just need to figure out is how to disable the auto screen rotation on this. :P
        – MrWm
        Jan 7 '17 at 7:17










      • finally found it: settings set org.cinnamon.settings-daemon.plugins.orientation active false
        – MrWm
        Jan 10 '17 at 7:59










      • @MrWm Good job! Does it work ? I mean does it disables auto rotation as expected? PS: If you like you could file this bug to Cinnamon people to have this issue fixed. It is very nice that Desktop Environments start to support auto screen rotation (some months ago was only Gnome3) , so it is important to be made right!
        – George Vasiliou
        Jan 10 '17 at 8:59










      • yep, it disables the screen rotation. It's basically the same command used in gnome except the "gnome" is swapped with "cinnamon". :)
        – MrWm
        Jan 11 '17 at 23:55
















      3












      3








      3






      The whole story you mention is actually a kind of bug in iio-sensor-proxy or in your DE code who makes use of iio-sensor-proxy info.



      Is not bios or kernel that does the rotation but the marriage between iio-sensor-proxy and your Desktop Environment.



      DE like Gnome (and Cinnamon as turns out) does screen auto rotate based on the data provided by iio-sensor-proxy in dbus.



      You can try to remove/purge iio-sensor-proxy and screen rotation will go away completely.



      It is not clear if this is a iio-sensor-proxy bug or a Cinnamon bug. It could be iio-sensor-proxy that is reading in a wrong way your accelerometer data or could be Cinnamon who even if it receives correct data by sensor-proxy, rotates the screen wrongly.



      You can clarify this issue by running monitor-sensor in root terminal.
      This utility comes with iio-sensor-proxy package and displays in terminal the current state of accelerometer / current screen orientation.

      If orientation is correctly displayed by monitor-sensor then it is a Cinnamon bug. But i'm 90% sure that this is an iio-sensor-proxy bug and you should report it to the developer.



      PS: It had been also mentioned that sensor-proxy had been working well with kernels up to version 4.7 but had some problems with kernel 4.8 and above. You could try to install an older kernel (i.e 4.7) for testing.



      If monitor-sensor reports correctly the orientation and this is a Cinnamon bug, as a workaround you could disable Cinnamon auto screen rotation feature and run a kind of shell script that will make the correct rotation based on the data of monitor-sensor.



      PS: Gnome gives the option to completely disable auto screen rotation, i'm not sure if Cinnamon has this option too.



      In XFCE that iio-sensor-proxy is installed but XFCE devs are not performing auto screen rotation (yet) we apply this script to have auto screen rotation: https://linuxappfinder.com/blog/auto_screen_rotation_in_ubuntu



      PS: Improved version for touch screens with transformation matrix: https://github.com/gevasiliou/PythonTests/blob/master/autorot.sh



      Update for future reference / future "google searches"



      As advised in comments, by running monitor-sensor in a root terminal and observing the messages provided by iio-sensor-proxy it proved that iio-sensor-proxy is correctly understood the real screen orientation.

      As a result this seems to be a Cinnamon bug that though it gets correct info by iio-sensor-proxy is rotating the screen wrongly.



      You can disable the Cinnamon auto rotation feature and try the auto-rotation script as advised above (https://linuxappfinder.com/blog/auto_screen_rotation_in_ubuntu).



      To disable Cinnamon internal autorotation you need to apply settings set org.cinnamon.settings-daemon.plugins.orientation active false as advised in OP's comment.






      share|improve this answer














      The whole story you mention is actually a kind of bug in iio-sensor-proxy or in your DE code who makes use of iio-sensor-proxy info.



      Is not bios or kernel that does the rotation but the marriage between iio-sensor-proxy and your Desktop Environment.



      DE like Gnome (and Cinnamon as turns out) does screen auto rotate based on the data provided by iio-sensor-proxy in dbus.



      You can try to remove/purge iio-sensor-proxy and screen rotation will go away completely.



      It is not clear if this is a iio-sensor-proxy bug or a Cinnamon bug. It could be iio-sensor-proxy that is reading in a wrong way your accelerometer data or could be Cinnamon who even if it receives correct data by sensor-proxy, rotates the screen wrongly.



      You can clarify this issue by running monitor-sensor in root terminal.
      This utility comes with iio-sensor-proxy package and displays in terminal the current state of accelerometer / current screen orientation.

      If orientation is correctly displayed by monitor-sensor then it is a Cinnamon bug. But i'm 90% sure that this is an iio-sensor-proxy bug and you should report it to the developer.



      PS: It had been also mentioned that sensor-proxy had been working well with kernels up to version 4.7 but had some problems with kernel 4.8 and above. You could try to install an older kernel (i.e 4.7) for testing.



      If monitor-sensor reports correctly the orientation and this is a Cinnamon bug, as a workaround you could disable Cinnamon auto screen rotation feature and run a kind of shell script that will make the correct rotation based on the data of monitor-sensor.



      PS: Gnome gives the option to completely disable auto screen rotation, i'm not sure if Cinnamon has this option too.



      In XFCE that iio-sensor-proxy is installed but XFCE devs are not performing auto screen rotation (yet) we apply this script to have auto screen rotation: https://linuxappfinder.com/blog/auto_screen_rotation_in_ubuntu



      PS: Improved version for touch screens with transformation matrix: https://github.com/gevasiliou/PythonTests/blob/master/autorot.sh



      Update for future reference / future "google searches"



      As advised in comments, by running monitor-sensor in a root terminal and observing the messages provided by iio-sensor-proxy it proved that iio-sensor-proxy is correctly understood the real screen orientation.

      As a result this seems to be a Cinnamon bug that though it gets correct info by iio-sensor-proxy is rotating the screen wrongly.



      You can disable the Cinnamon auto rotation feature and try the auto-rotation script as advised above (https://linuxappfinder.com/blog/auto_screen_rotation_in_ubuntu).



      To disable Cinnamon internal autorotation you need to apply settings set org.cinnamon.settings-daemon.plugins.orientation active false as advised in OP's comment.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Jan 12 '17 at 14:43

























      answered Jan 7 '17 at 2:36









      George Vasiliou

      5,59531028




      5,59531028












      • I see that monitor-sensor has the right orientations. Now all I just need to figure out is how to disable the auto screen rotation on this. :P
        – MrWm
        Jan 7 '17 at 7:17










      • finally found it: settings set org.cinnamon.settings-daemon.plugins.orientation active false
        – MrWm
        Jan 10 '17 at 7:59










      • @MrWm Good job! Does it work ? I mean does it disables auto rotation as expected? PS: If you like you could file this bug to Cinnamon people to have this issue fixed. It is very nice that Desktop Environments start to support auto screen rotation (some months ago was only Gnome3) , so it is important to be made right!
        – George Vasiliou
        Jan 10 '17 at 8:59










      • yep, it disables the screen rotation. It's basically the same command used in gnome except the "gnome" is swapped with "cinnamon". :)
        – MrWm
        Jan 11 '17 at 23:55




















      • I see that monitor-sensor has the right orientations. Now all I just need to figure out is how to disable the auto screen rotation on this. :P
        – MrWm
        Jan 7 '17 at 7:17










      • finally found it: settings set org.cinnamon.settings-daemon.plugins.orientation active false
        – MrWm
        Jan 10 '17 at 7:59










      • @MrWm Good job! Does it work ? I mean does it disables auto rotation as expected? PS: If you like you could file this bug to Cinnamon people to have this issue fixed. It is very nice that Desktop Environments start to support auto screen rotation (some months ago was only Gnome3) , so it is important to be made right!
        – George Vasiliou
        Jan 10 '17 at 8:59










      • yep, it disables the screen rotation. It's basically the same command used in gnome except the "gnome" is swapped with "cinnamon". :)
        – MrWm
        Jan 11 '17 at 23:55


















      I see that monitor-sensor has the right orientations. Now all I just need to figure out is how to disable the auto screen rotation on this. :P
      – MrWm
      Jan 7 '17 at 7:17




      I see that monitor-sensor has the right orientations. Now all I just need to figure out is how to disable the auto screen rotation on this. :P
      – MrWm
      Jan 7 '17 at 7:17












      finally found it: settings set org.cinnamon.settings-daemon.plugins.orientation active false
      – MrWm
      Jan 10 '17 at 7:59




      finally found it: settings set org.cinnamon.settings-daemon.plugins.orientation active false
      – MrWm
      Jan 10 '17 at 7:59












      @MrWm Good job! Does it work ? I mean does it disables auto rotation as expected? PS: If you like you could file this bug to Cinnamon people to have this issue fixed. It is very nice that Desktop Environments start to support auto screen rotation (some months ago was only Gnome3) , so it is important to be made right!
      – George Vasiliou
      Jan 10 '17 at 8:59




      @MrWm Good job! Does it work ? I mean does it disables auto rotation as expected? PS: If you like you could file this bug to Cinnamon people to have this issue fixed. It is very nice that Desktop Environments start to support auto screen rotation (some months ago was only Gnome3) , so it is important to be made right!
      – George Vasiliou
      Jan 10 '17 at 8:59












      yep, it disables the screen rotation. It's basically the same command used in gnome except the "gnome" is swapped with "cinnamon". :)
      – MrWm
      Jan 11 '17 at 23:55






      yep, it disables the screen rotation. It's basically the same command used in gnome except the "gnome" is swapped with "cinnamon". :)
      – MrWm
      Jan 11 '17 at 23:55















      3














      Using dconf-editor, change the key value for



      /org/cinnamon/settings-daemon/plugins/orientation/active


      to False.



      This is identical to the command line solution presented above, but uses the gui tool dconf-editor.






      share|improve this answer




























        3














        Using dconf-editor, change the key value for



        /org/cinnamon/settings-daemon/plugins/orientation/active


        to False.



        This is identical to the command line solution presented above, but uses the gui tool dconf-editor.






        share|improve this answer


























          3












          3








          3






          Using dconf-editor, change the key value for



          /org/cinnamon/settings-daemon/plugins/orientation/active


          to False.



          This is identical to the command line solution presented above, but uses the gui tool dconf-editor.






          share|improve this answer














          Using dconf-editor, change the key value for



          /org/cinnamon/settings-daemon/plugins/orientation/active


          to False.



          This is identical to the command line solution presented above, but uses the gui tool dconf-editor.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jun 16 '17 at 21:37









          Stephen Rauch

          3,328101428




          3,328101428










          answered Jun 16 '17 at 21:18









          ransur0t

          312




          312























              0














              The iio-sensor-proxy issue doesn't explain all these problems.



              On my Unbuntu 18.04 build when ever the screen randomly rotated the mouse input coordinates did not rotate in unison. Mouse X/Y was always the the same direction meaning the direction of the screen and mouse coordinates could be inverted to each other.



              I'm sure if the screen was flipped by the GUI it would also flip the mouse!






              share|improve this answer








              New contributor




              Walter ZAMBOTTI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.























                0














                The iio-sensor-proxy issue doesn't explain all these problems.



                On my Unbuntu 18.04 build when ever the screen randomly rotated the mouse input coordinates did not rotate in unison. Mouse X/Y was always the the same direction meaning the direction of the screen and mouse coordinates could be inverted to each other.



                I'm sure if the screen was flipped by the GUI it would also flip the mouse!






                share|improve this answer








                New contributor




                Walter ZAMBOTTI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





















                  0












                  0








                  0






                  The iio-sensor-proxy issue doesn't explain all these problems.



                  On my Unbuntu 18.04 build when ever the screen randomly rotated the mouse input coordinates did not rotate in unison. Mouse X/Y was always the the same direction meaning the direction of the screen and mouse coordinates could be inverted to each other.



                  I'm sure if the screen was flipped by the GUI it would also flip the mouse!






                  share|improve this answer








                  New contributor




                  Walter ZAMBOTTI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  The iio-sensor-proxy issue doesn't explain all these problems.



                  On my Unbuntu 18.04 build when ever the screen randomly rotated the mouse input coordinates did not rotate in unison. Mouse X/Y was always the the same direction meaning the direction of the screen and mouse coordinates could be inverted to each other.



                  I'm sure if the screen was flipped by the GUI it would also flip the mouse!







                  share|improve this answer








                  New contributor




                  Walter ZAMBOTTI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer






                  New contributor




                  Walter ZAMBOTTI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered 21 mins ago









                  Walter ZAMBOTTI

                  1




                  1




                  New contributor




                  Walter ZAMBOTTI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  Walter ZAMBOTTI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  Walter ZAMBOTTI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Unix & Linux Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f335260%2faccelerometer-screen-rotation-on-non-touchscreen-laptop%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      CARDNET

                      Boot-repair Failure: Unable to locate package grub-common:i386

                      Aws NAT - Aws IGW- Aws router