Changing the way automatic screen rotation works in Gnome shell












7















I recently acquired a Lenovo Yoga 3 11" convertible notebook. It works really with out-of-the-box with Ubuntu Gnome LTS 16.04.2 - WiFi, Bluetooth, even suspend and resume work without any issues so far.



I noticed that Gnome 3 even allows the screen to auto-rotate based on the built-in rotation sensors. The Yoga 3 11" does offer rotation sensors via iio-sensor-proxy which is already installed by default in Ubuntu Gnome. As it happens, the orientation reported by iio-sensor-proxy seems to be off by 90°.



https://askubuntu.com/questions/634151/auto-rotate-screen-on-dell-13-7000-with-15-04-gnome has a solution in terms of a custom shell script which handles the screen rotation. I would rather not use this solution as it disables the "disable screen rotation" button in Gnome Shell.



I did some research already and found that iio-sensor-proxy should cause udev to trigger an event which is then used by Gnome 3 to set the screen orientation via xrandr. I cannot, however, find a way to tell either udev or Gnome 3 that the accelerometer is mounted in an orientation different from the display, which requires the directions to be translated in between.



So, the question is: How can that be done? The orientation remapping should be possible in either iio-sensor-proxy, udev or Gnome 3, and I actually don't care that much where it is done. I don't seem to find any config files I can easily change to achieve what I need.



As a workaround for now I am using the script from the ask ubuntu question linked above, with modifications to account for the misaligned display/accelerometer issue. For this to work, I have to disable the automatic screen rotation in Gnome 3. Although this solution also allows automatically starting and killing onboard (on-screen keyboard) depending on current orientation, it kind of defeats the purpose of the Gnome 3 screen rotation setting.










share|improve this question




















  • 1





    github.com/hadess/iio-sensor-proxy/issues/57

    – don_crissti
    Apr 26 '17 at 18:40
















7















I recently acquired a Lenovo Yoga 3 11" convertible notebook. It works really with out-of-the-box with Ubuntu Gnome LTS 16.04.2 - WiFi, Bluetooth, even suspend and resume work without any issues so far.



I noticed that Gnome 3 even allows the screen to auto-rotate based on the built-in rotation sensors. The Yoga 3 11" does offer rotation sensors via iio-sensor-proxy which is already installed by default in Ubuntu Gnome. As it happens, the orientation reported by iio-sensor-proxy seems to be off by 90°.



https://askubuntu.com/questions/634151/auto-rotate-screen-on-dell-13-7000-with-15-04-gnome has a solution in terms of a custom shell script which handles the screen rotation. I would rather not use this solution as it disables the "disable screen rotation" button in Gnome Shell.



I did some research already and found that iio-sensor-proxy should cause udev to trigger an event which is then used by Gnome 3 to set the screen orientation via xrandr. I cannot, however, find a way to tell either udev or Gnome 3 that the accelerometer is mounted in an orientation different from the display, which requires the directions to be translated in between.



So, the question is: How can that be done? The orientation remapping should be possible in either iio-sensor-proxy, udev or Gnome 3, and I actually don't care that much where it is done. I don't seem to find any config files I can easily change to achieve what I need.



As a workaround for now I am using the script from the ask ubuntu question linked above, with modifications to account for the misaligned display/accelerometer issue. For this to work, I have to disable the automatic screen rotation in Gnome 3. Although this solution also allows automatically starting and killing onboard (on-screen keyboard) depending on current orientation, it kind of defeats the purpose of the Gnome 3 screen rotation setting.










share|improve this question




















  • 1





    github.com/hadess/iio-sensor-proxy/issues/57

    – don_crissti
    Apr 26 '17 at 18:40














7












7








7


1






I recently acquired a Lenovo Yoga 3 11" convertible notebook. It works really with out-of-the-box with Ubuntu Gnome LTS 16.04.2 - WiFi, Bluetooth, even suspend and resume work without any issues so far.



I noticed that Gnome 3 even allows the screen to auto-rotate based on the built-in rotation sensors. The Yoga 3 11" does offer rotation sensors via iio-sensor-proxy which is already installed by default in Ubuntu Gnome. As it happens, the orientation reported by iio-sensor-proxy seems to be off by 90°.



https://askubuntu.com/questions/634151/auto-rotate-screen-on-dell-13-7000-with-15-04-gnome has a solution in terms of a custom shell script which handles the screen rotation. I would rather not use this solution as it disables the "disable screen rotation" button in Gnome Shell.



I did some research already and found that iio-sensor-proxy should cause udev to trigger an event which is then used by Gnome 3 to set the screen orientation via xrandr. I cannot, however, find a way to tell either udev or Gnome 3 that the accelerometer is mounted in an orientation different from the display, which requires the directions to be translated in between.



So, the question is: How can that be done? The orientation remapping should be possible in either iio-sensor-proxy, udev or Gnome 3, and I actually don't care that much where it is done. I don't seem to find any config files I can easily change to achieve what I need.



As a workaround for now I am using the script from the ask ubuntu question linked above, with modifications to account for the misaligned display/accelerometer issue. For this to work, I have to disable the automatic screen rotation in Gnome 3. Although this solution also allows automatically starting and killing onboard (on-screen keyboard) depending on current orientation, it kind of defeats the purpose of the Gnome 3 screen rotation setting.










share|improve this question
















I recently acquired a Lenovo Yoga 3 11" convertible notebook. It works really with out-of-the-box with Ubuntu Gnome LTS 16.04.2 - WiFi, Bluetooth, even suspend and resume work without any issues so far.



I noticed that Gnome 3 even allows the screen to auto-rotate based on the built-in rotation sensors. The Yoga 3 11" does offer rotation sensors via iio-sensor-proxy which is already installed by default in Ubuntu Gnome. As it happens, the orientation reported by iio-sensor-proxy seems to be off by 90°.



https://askubuntu.com/questions/634151/auto-rotate-screen-on-dell-13-7000-with-15-04-gnome has a solution in terms of a custom shell script which handles the screen rotation. I would rather not use this solution as it disables the "disable screen rotation" button in Gnome Shell.



I did some research already and found that iio-sensor-proxy should cause udev to trigger an event which is then used by Gnome 3 to set the screen orientation via xrandr. I cannot, however, find a way to tell either udev or Gnome 3 that the accelerometer is mounted in an orientation different from the display, which requires the directions to be translated in between.



So, the question is: How can that be done? The orientation remapping should be possible in either iio-sensor-proxy, udev or Gnome 3, and I actually don't care that much where it is done. I don't seem to find any config files I can easily change to achieve what I need.



As a workaround for now I am using the script from the ask ubuntu question linked above, with modifications to account for the misaligned display/accelerometer issue. For this to work, I have to disable the automatic screen rotation in Gnome 3. Although this solution also allows automatically starting and killing onboard (on-screen keyboard) depending on current orientation, it kind of defeats the purpose of the Gnome 3 screen rotation setting.







gnome3 udev xrandr touch-screen






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 27 '17 at 8:42







hoe

















asked Apr 26 '17 at 17:29









hoehoe

20625




20625








  • 1





    github.com/hadess/iio-sensor-proxy/issues/57

    – don_crissti
    Apr 26 '17 at 18:40














  • 1





    github.com/hadess/iio-sensor-proxy/issues/57

    – don_crissti
    Apr 26 '17 at 18:40








1




1





github.com/hadess/iio-sensor-proxy/issues/57

– don_crissti
Apr 26 '17 at 18:40





github.com/hadess/iio-sensor-proxy/issues/57

– don_crissti
Apr 26 '17 at 18:40










1 Answer
1






active

oldest

votes


















1














From GITHUB iio-sensor-proxy site
When the accelerometer is not mounted the same way as the screen, we need to modify the readings from the accelerometer to make sure that the computed orientation matches the screen one.



iio-sensor-proxy reads this information from the device's ACCEL_MOUNT_MATRIX udev property. See 60-sensor.hwdb for details.






share|improve this answer























    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%2f361472%2fchanging-the-way-automatic-screen-rotation-works-in-gnome-shell%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    From GITHUB iio-sensor-proxy site
    When the accelerometer is not mounted the same way as the screen, we need to modify the readings from the accelerometer to make sure that the computed orientation matches the screen one.



    iio-sensor-proxy reads this information from the device's ACCEL_MOUNT_MATRIX udev property. See 60-sensor.hwdb for details.






    share|improve this answer




























      1














      From GITHUB iio-sensor-proxy site
      When the accelerometer is not mounted the same way as the screen, we need to modify the readings from the accelerometer to make sure that the computed orientation matches the screen one.



      iio-sensor-proxy reads this information from the device's ACCEL_MOUNT_MATRIX udev property. See 60-sensor.hwdb for details.






      share|improve this answer


























        1












        1








        1







        From GITHUB iio-sensor-proxy site
        When the accelerometer is not mounted the same way as the screen, we need to modify the readings from the accelerometer to make sure that the computed orientation matches the screen one.



        iio-sensor-proxy reads this information from the device's ACCEL_MOUNT_MATRIX udev property. See 60-sensor.hwdb for details.






        share|improve this answer













        From GITHUB iio-sensor-proxy site
        When the accelerometer is not mounted the same way as the screen, we need to modify the readings from the accelerometer to make sure that the computed orientation matches the screen one.



        iio-sensor-proxy reads this information from the device's ACCEL_MOUNT_MATRIX udev property. See 60-sensor.hwdb for details.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jun 9 '17 at 9:22









        Krzysztof StasiakKrzysztof Stasiak

        488114




        488114






























            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f361472%2fchanging-the-way-automatic-screen-rotation-works-in-gnome-shell%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

            How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

            is 'sed' thread safe

            How to make a Squid Proxy server?