2019-05-18 20:27:15 +00:00
|
|
|
# rot8
|
|
|
|
|
2019-08-16 23:47:36 +00:00
|
|
|
## automatic display rotation using built-in accelerometer
|
2019-05-18 20:27:15 +00:00
|
|
|
|
|
|
|
Automatic rotate modern Linux desktop screen and input devices. Handy for
|
|
|
|
convertible touchscreen notebooks like the Kaby Lake model of the HP Spectre x360.
|
|
|
|
|
2019-08-16 23:47:36 +00:00
|
|
|
Compatible with [sway](http://swaywm.org/) and [X11](https://www.x.org/wiki/Releases/7.7/).
|
|
|
|
|
2019-09-14 03:30:02 +00:00
|
|
|
Available in the Arch User Repository: [rot8-git](https://aur.archlinux.org/packages/rot8-git/).
|
|
|
|
|
2019-05-18 20:27:15 +00:00
|
|
|
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
|
|
|
|
```
|
|
|
|
|
2019-09-14 03:30:02 +00:00
|
|
|
or
|
|
|
|
|
|
|
|
```
|
|
|
|
$ cargo install rot8
|
|
|
|
|
|
|
|
```
|
|
|
|
|
2019-08-16 23:47:36 +00:00
|
|
|
For Sway map your input to the output device:
|
|
|
|
|
|
|
|
```
|
2019-09-14 03:30:02 +00:00
|
|
|
|
2021-06-08 15:32:21 +00:00
|
|
|
$ swaymsg input <INPUTDEVICE> map_to_output <OUTPUTDEVICE>
|
2019-09-14 03:30:02 +00:00
|
|
|
|
2019-08-16 23:47:36 +00:00
|
|
|
```
|
|
|
|
|
2019-09-14 03:30:02 +00:00
|
|
|
Call rot8 from sway configuration file ~/.config/sway/config:
|
2019-05-18 20:27:15 +00:00
|
|
|
|
|
|
|
```
|
2019-09-14 03:30:02 +00:00
|
|
|
|
2019-05-18 20:27:15 +00:00
|
|
|
exec rot8
|
2019-09-14 03:30:02 +00:00
|
|
|
|
2019-05-18 20:27:15 +00:00
|
|
|
```
|
2019-08-16 23:47:36 +00:00
|
|
|
|
|
|
|
For X11 set Touchscreen Device
|
|
|
|
|
|
|
|
```
|
2019-09-14 03:30:02 +00:00
|
|
|
|
2019-08-16 23:47:36 +00:00
|
|
|
rot8 --touchscreen <TOUCHSCREEN>
|
2019-09-14 03:30:02 +00:00
|
|
|
|
2019-08-16 23:47:36 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
there are the following args.
|
|
|
|
|
|
|
|
```
|
2019-09-14 03:30:02 +00:00
|
|
|
|
|
|
|
--sleep // Set sleep millis (500)
|
|
|
|
--display // Set Display Device (eDP-1)
|
|
|
|
--touchscreen // Set Touchscreen Device X11 (ELAN0732:00 04F3:22E1)
|
2019-12-27 15:03:55 +00:00
|
|
|
--keyboard // Set keyboard to deactivate upon rotation
|
2020-01-04 22:27:54 +00:00
|
|
|
--threshold // Set a rotation threshold between 0 and 1 (0.5)
|
2019-09-14 03:30:02 +00:00
|
|
|
|
2019-08-16 23:47:36 +00:00
|
|
|
```
|