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.