Locking Auto-rotation


  • If you like the auto-rotation feature of the Raspad, but would like to be able to lock the current rotation (so you can read in bed without the screen switching on you every time you move around), here's how I accomplished this.

    Create a local bin file:

    ~/bin/raspad-auto-rotate-toggle

    toggle_file="${HOME}/.raspad-auto-rotate-off"

    if [[ -f "${toggle_file}" ]] ; then
        DISPLAY=:0.0 /usr/bin/python3 /usr/local/bin/auto-rotator &
      rm "${toggle_file}"
        notify-send --expire-time=2000 "Auto-rotation: ON"
    else
        kill $(pgrep --full auto-rotator)
        touch "${toggle_file}"
        notify-send --expire-time=2000 "Auto-rotation: OFF"
    fi

    Create this desktop file:

    ~/.local/share/applications/raspad-auto-rotate-toggle.desktop

    [Desktop Entry]
    Name=Raspad Auto-Rotate Toggle
    Comment=Toggle auto-rotation of Raspad screen and touchpad
    Exec=sh -c "${HOME}/bin/raspad-auto-rotate-toggle"
    Type=Application
    Icon=window-close
    Terminal=false
    StartupNotify=false
    Categories=Accessibility;Screen;

    You should now see Raspad Auto-Rotate Toggle in the Universal Access menu.  If you click on it, it will toggle screen locking on/off.

    I recommend adding it to an Applicaton Launch Bar for easy access.

    If you have a notification daemon installed (like xfce4-notifyd) and have libnotify-bin installed, you should also see a pop-up notification telling you if the lock is ON or OFF.

    If you would prefer the ability to manually rotate the screen, see my post about that.



  • @Kyle Sherman is there a way to change the angle the Raspad changes orientation? Mine seems pretty sensitive and wants to change with very little tilt.


  • @Steve Abdu Not sure.  I haven't look at the code to see if it can be changed or configured.  The code can be found here:

    https://github.com/sunfounder/python-sh3001


  • I've now tested this on RaspadOS and it's working fine.



Please login to reply this topic!