autorandr
autorandr copied to clipboard
Profile priority in case multiple profiles are detected
Let's say I have two profiles: usb-c, laptop, plus a default profile which is symlinked to laptop:
usb-c (detected) (1st match)
laptop (detected) (2nd match) (current)
default (detected) (3rd match)
If all profiles are detected, I want autorandr --change to prioritize usb-c, and give it precedence before laptop. Current behavior doesn't do anything, and stays on laptop. Is there a way to achieve that?
It's been some time since I used autorandr since I'm mostly sitting at a desk without laptop these days, but back in 2015 I got some behavior introduced so when faced with multiple valid profiles for a setup, would pick the last profile used (https://github.com/phillipberndt/autorandr/issues/16).
That doesn't solve your problem, but maybe can lead you in the right direction? :)
@RasmusWL thanks. Indeed it doesn't solve my problem though. :)
The possibility of configuring the desired "match sequence" would be great! Meanwhile I just renamed my profiles putting numbers at the beginning. 1- External 2- Dual Mobile (fallback/default)
The behavior will still change after loading a configuration, because ordering is by time of last load, not name.
What do you have in mind? Something like a priority file with a number in it?
Blocking the profiles that you don't want using the blocked hook might also be a simple solution.
What do you have in mind?
@phillipberndt I think sorting by name makes sense. It would encourage using a pattern seen in other Linux projects like Xorg with conf.d directories: 10-usbc-display, 20-hdmi-display, 30-laptop-display etc. Just naming autorandr profiles this way and that's it. I don't mind linking profile dirs to one another so i could just call autorandr laptop-display instead of autorandr 30-laptop-display in cases I want to manually switch to a lower priority profile.
I'm currently having problems and would also really need profile priority. When I plugin a screen to my laptop two configurations are detected but autorandr defaults to only using the built in screen one and not the one with the external monitor plugged in making me always have to run the command myself to get it to swap over to the correct profile.
autorandr: mobile (detected) (1st match) (current)
autorandr: office (detected) (2nd match)
autorandr: home
In this case I would like it to pick the second match over the first one.