Enabling autorotate in Lubuntu 20.10

Hello everyone, I’ve switched from Ubuntu Budgie 20.10 (which I had updated from 20.04) to Lubuntu 20.10 (fresh install). I like how snappy it is compared to Budgie, but I’ve hit a snag in my workflow.

Budgie was able to rotate by itself until I installed Anbox on 20.10 and rebooted at some point. But does anybody know by any chance what software was used to enable that? Another workaround for me would be to know which incantation ‘monitor settings’ uses to rotate the display, so I can script it and bind it to a key combination? Because if I use xrandr it elongates my PDFs ¯_(ツ)_/¯

I’ve already established that monitor-sensor is running fine in terminal, which is a prerequisite for autorotation AFAIK

1 Like

Update:

After some hints from the #lubuntu irc/matrix channel I found the lxqt-config-monitor command with the --load-last flag and it works from “Normal” to “Music” session. But it doesn’t work the other way around, but the command prompt doesn’t give any hints. I’m not certain if that is expected behaviour or a bug, but I think I’m on the right track.

ryukurisu@phoenix ~ $ lxqt-config-monitor -h 
Usage: lxqt-config-monitor [options]

LXQt Config Monitor

Options:

-l, --load-last     Load last settings.

-v, --version        Displays version information.

-h, --help             Displays help on commandline options.

--help-all             Displays help including Qt specific options.

ryukurisu@phoenix ~ $ lxqt-config-monitor -l Music

[load.applyBestSettings()] Finished

Lxqt-config-monitor: Applying current settings...

Output: "eDP-1"

Output: "DP1"

Output: "HDMI-1"

Output: "HDMI-2" 
Lxqt-config-monitor: Settings applied.

ryukurisu@phoenix ~ $ lxqt-config-monitor -l Normal

[load.applyBestSettings()] Finished Lxqt-config-monitor: Applying current settings...

Output: "eDP-1"

Output: "DP-1"

Output: "HDMI -1"

Output: "HDMI-2"

Lxqt-config-monitor: Settings applied.

Apparently I needed to add additional parameters to xrandr in order for it to keep the monitor “sane”.
It still doesn’t autorotate, but at least I’ve got Shortcut Keys to rotate my screen and input devices (which didn’t rotate along in Ubuntu Budgie anyway (but the screen wasn’t seen as a “mouse” so that “worked”)).

In case anyone else wants to rotate their screen and mice, here are my scripts, but you’ll need to change your input devices and output devices. To find your input device(s) you’ll have to execute:
xinput list
It’ll list your devices under the Virtual Core Pointer (named Mouse and Touchpad respectively in my case).
For your monitor all you’ve got to do is:
xrandr --listactivemonitors
The last part of that string is what you need for xrandr.

Here are the scripts:
normal.sh
#!/bin/sh
#This rotates the screen and mice to normal orientation
xinput set-prop “SYNA3602:00 0911:5288 Touchpad” “Coordinate Transformation Matrix” 1 0 0 0 1 0 0 0 1
xinput set-prop “FTSC1000:00 2808:50C5” “Coordinate Transformation Matrix” 1 0 0 0 1 0 0 0 1
xrandr --output eDP-1 --mode 1920x1080 --rotate normal

right.sh
#!/bin/sh
#This rotates the screen and mice with the right-side facing up
xinput set-prop “SYNA3602:00 0911:5288 Touchpad” “Coordinate Transformation Matrix” 0 1 0 -1 0 1 0 0 1
xinput set-prop “FTSC1000:00 2808:50C5” “Coordinate Transformation Matrix” 0 1 0 -1 0 1 0 0 1
xrandr --output eDP-1 --mode 1920x1080 --rotate right

left.sh
#!/bin/sh
#This rotates the screen and mice with the left-side facing up
xinput set-prop “SYNA3602:00 0911:5288 Touchpad” “Coordinate Transformation Matrix” 0 -1 1 1 0 0 0 0 1
xinput set-prop “FTSC1000:00 2808:50C5” “Coordinate Transformation Matrix” 0 -1 1 1 0 0 0 0 1
xrandr --output eDP-1 --mode 1920x1080 --rotate left

inverted.sh
#!/bin/sh
#This rotates the screen and mice with the bottom facing up
xinput set-prop “SYNA3602:00 0911:5288 Touchpad” “Coordinate Transformation Matrix” -1 0 1 0 -1 1 0 0 1
xinput set-prop “FTSC1000:00 2808:50C5” “Coordinate Transformation Matrix” -1 0 1 0 -1 1 0 0 1
xrandr --output eDP-1 --mode 1920x1080 --rotate inverted

Save them, make them executable and assign keyboard shurtcuts to them. As a suggestion I did Crtl+Shift+"arrow key".

2 Likes

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.

@RyuKurisu as this topic is solved and closed, there’s really not much else to say. …except that this autorotate feature may be something we want to have in future Lubuntu versions, if possible. It may be worth exploring which Ubuntu flavors support it and which ones don’t. If all of the GNOME-ish (I’d include Budgie in this, though that may be a little inappropriate) ones are the only ones that do (or worse, if it’s just Budgie), it may be hard to implement without some heavy lifting, but if we see it especially in Xubuntu, that would be pretty simple. Post up a thread on #development if you come up with anything interesting. Thanks!

2 Likes