#sway #x11 #display #rotation

app rot8

automatic display rotation using built-in accelerometer

4 releases

new 0.1.4 May 12, 2022
0.1.3 Jan 4, 2020
0.1.2 Sep 14, 2019
0.1.1 Aug 17, 2019

#68 in Unix APIs

Download history 1/week @ 2022-01-27 6/week @ 2022-02-03 5/week @ 2022-02-17 3/week @ 2022-02-24 3/week @ 2022-03-03 3/week @ 2022-03-10 19/week @ 2022-03-17 1/week @ 2022-03-24 2/week @ 2022-04-07 1/week @ 2022-04-14 26/week @ 2022-04-28 18/week @ 2022-05-05 85/week @ 2022-05-12

130 downloads per month

MIT license

17KB
361 lines

rot8

automatic display rotation using built-in accelerometer

Automatic rotate modern Linux desktop screen and input devices. Handy for convertible touchscreen notebooks like HP Spectre x360, Lenovo IdeaPad Flex or Linux phone like Pinephone.

Compatible with sway and X11.

Available in:

Arch User Repository: rot8-git

Void Package: rot8

Rust language and the cargo package manager are required to build the binary.

$ git clone https://github.com/efernau/rot8
$ cd rot8 && cargo build --release
$ cp target/release/rot8  /usr/bin/rot8

or

$ cargo install rot8

For Sway map your input to the output device:


$ swaymsg input <INPUTDEVICE> map_to_output <OUTPUTDEVICE>

Call rot8 from sway configuration file ~/.config/sway/config:


exec rot8

For X11 set Touchscreen Device


rot8 --touchscreen <TOUCHSCREEN>

there are the following args.


--sleep // Set sleep millis (500)
--display // Set Display Device (eDP-1)
--touchscreen // Set Touchscreen Device X11 (ELAN0732:00 04F3:22E1)
--keyboard // Set keyboard to deactivate upon rotation
--threshold // Set a rotation threshold between 0 and 1 (0.5)
--normalization-factor // Set factor for sensor value normalization (1e6)
--invert-x // Invert readings from the HW x axis
--invert-y // Invert readings from the HW y axis
--invert-z // Invert readings from the HW z axis

Dependencies

~2.4–3.5MB
~85K SLoC