autorandr icon indicating copy to clipboard operation
autorandr copied to clipboard

Not switching on display plugged in (only when unplugged)

Open sarumont opened this issue 2 years ago • 2 comments

I have two profiles: mobile and docked. mobile is my laptop's internal display only, docked is my HDMI monitor only. When I unplug the monitor, autorandr switches to mobile just fine...but when I plug it back in, it does not switch. Here's the log from journalctl:

Aug 24 17:00:20 jenova systemd[1]: autorandr.service: Installed new job autorandr.service/start as 11852
Aug 24 17:00:20 jenova systemd[1]: autorandr.service: Enqueued job autorandr.service/start as 11852
Aug 24 17:00:20 jenova systemd[1]: autorandr.service: Passing 0 fds to service
Aug 24 17:00:20 jenova systemd[1]: autorandr.service: About to execute /usr/bin/autorandr --batch --change --default default
Aug 24 17:00:20 jenova systemd[1]: autorandr.service: Forked /usr/bin/autorandr as 3689018
Aug 24 17:00:20 jenova systemd[1]: autorandr.service: Changed dead -> start
Aug 24 17:00:20 jenova systemd[1]: Starting autorandr execution hook...
Aug 24 17:00:20 jenova systemd[3689018]: autorandr.service: Executing: /usr/bin/autorandr --batch --change --default default
Aug 24 17:00:21 jenova autorandr[3689019]: Failed to load profile 'default': Profile not found (line 1420)
Aug 24 17:00:21 jenova autorandr[3689019]: autorandr running as user sarumont (started from batch instance)
Aug 24 17:00:21 jenova autorandr[3689019]: docked
Aug 24 17:00:21 jenova autorandr[3689019]: mobile (current)
Aug 24 17:00:21 jenova systemd[1]: autorandr.service: Child 3689022 belongs to autorandr.service.
Aug 24 17:00:21 jenova autorandr[3689018]: Running autorandr as sarumont for display :0
Aug 24 17:00:21 jenova systemd[1]: autorandr.service: Child 3689018 belongs to autorandr.service.
Aug 24 17:00:21 jenova systemd[1]: autorandr.service: Main process exited, code=exited, status=0/SUCCESS (success)
Aug 24 17:00:21 jenova systemd[1]: autorandr.service: Deactivated successfully.
Aug 24 17:00:21 jenova systemd[1]: autorandr.service: Service will not restart (restart setting)
Aug 24 17:00:21 jenova systemd[1]: autorandr.service: Changed start -> dead
Aug 24 17:00:21 jenova systemd[1]: autorandr.service: Job 11852 autorandr.service/start finished, result=done
Aug 24 17:00:21 jenova systemd[1]: Finished autorandr execution hook.
Aug 24 17:00:21 jenova systemd[1]: autorandr.service: Consumed 195ms CPU time.
Aug 24 17:00:21 jenova systemd[1]: autorandr.service: Collecting.

Looks like it's looking for a profile called default, which I don't have. Is this a bug, or am I missing something here?

sarumont avatar Aug 25 '21 02:08 sarumont

I had a similar issue (for me it didn't switch back to mobile). I managed to "solve" it by creating just creating a profile named default in addition to the ones I actually use. First default was only the internal screen, this didn't solve it though so then I connected a second screen and user the vertical profile and saved that as default. This got it switching between internal and vertical properly. You might have to play around with it a little.

imLew avatar Nov 05 '21 09:11 imLew

I've had similar issues and didn't have a profile named default. Creating one seems to have worked for now (KDE is determined to forget my display arrangements), but the problem still appears in the logs. Output of systemctl status autorandr.service:

○ autorandr.service - autorandr execution hook
     Loaded: loaded (/lib/systemd/system/autorandr.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Tue 2022-06-21 10:51:59 AEST; 6s ago
    Process: 5449 ExecStart=/usr/bin/autorandr --batch --change --default default (code=exited, status=0/SUCCESS)
   Main PID: 5449 (code=exited, status=0/SUCCESS)
        CPU: 182ms

Jun 21 10:21:59 LappyX86_64 systemd[1]: Starting autorandr execution hook...
Jun 21 10:21:59 LappyX86_64 autorandr[5449]: /usr/bin/autorandr:42: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
Jun 21 10:21:59 LappyX86_64 autorandr[5449]:   from distutils.version import LooseVersion as Version
Jun 21 10:21:59 LappyX86_64 autorandr[5451]: /usr/bin/autorandr:42: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
Jun 21 10:21:59 LappyX86_64 autorandr[5451]:   from distutils.version import LooseVersion as Version
Jun 21 10:21:59 LappyX86_64 autorandr[5451]: Failed to load profile 'default': Profile not found (line 1420)
Jun 21 10:21:59 LappyX86_64 autorandr[5451]: autorandr running as user roy (started from batch instance)
Jun 21 10:21:59 LappyX86_64 autorandr[5449]: Running autorandr as roy for display :0
Jun 21 10:21:59 LappyX86_64 systemd[1]: autorandr.service: Deactivated successfully.
Jun 21 10:21:59 LappyX86_64 systemd[1]: Finished autorandr execution hook.

And of autorandr:

/usr/bin/autorandr:42: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.version import LooseVersion as Version
default
docked-right (detected) (current)
docked-left
docked-dual

Roy-Orbison avatar Jun 21 '22 01:06 Roy-Orbison