This repository is a fork of GuLinux's ScreenRotator.
Extra functionalities:
- lock, unlock or reset screen rotation with inter process communication
- run shell commands on changing or locking orientation
See more in the Messaging and Commands section.
Similar to the current solution implemented in Gnome, but works on all other X11 desktop environments as well (KDE, XFCE, I3, etc).
- cmake
- gcc
- Qt5 (with modules x11extras, sensors)
- xrandr
- XInput (Xi)
On ubuntu, run the following command to install dependencies:
sudo apt install -y git cmake build-essential qtbase5-dev libxrandr-dev libxi-dev libqt5x11extras5-dev libqt5sensors5-dev
To build and install ScreanRot, run the following commands:
git clone https://github.com/coddra/screanRot
cd screanRot
./install.sh
You can run the program by calling sreenrotator
.
Main icon: https://www.iconfinder.com/icons/326583/orientation_rotation_screen_icon#size=256
To send messages to an active screenrotator
, use sreenrotator-msg
. It accepts the following commands:
lock
unlock
toggle-lock
reset
You can send multiple commands like this:
screenrotator-msg reset lock
You can pass the commands to execute on entering landscape or portrait mode or locking or unlocking orientation as command line arguments. Prefix the commands with three dashes, like this:
screenrotator --- ~/.config/polybar/mode landscape --- ~/.config/polybar/mode portrait --- polybar-msg action lock hook 0 --- polybar-msg action lock hook 1