autorandr
autorandr copied to clipboard
[REQUEST] Add option to ignore postswitch
I would like an option to ignore the postswitch when running autorandr from the command line.
The reason for this is that I would like to use the command i3-msg restart
inside my postswitch to restart my window manager i3, whenever a change in my monitor setup is detected. But at the same time I would like to run the command autorandr --change
when booting the machine to detect my monitor setup at boot and applying the correct profile. This can be achieved by writing exec --no-startup-id autorandr --change
in the i3 config, where exec
means that the command is only run once at boot. This will however result in due to the postswitch that the exec_always
commands inside the i3 config are called twice at boot.
An option to run autorandr without executing the postswitch would solve the issue.
Could you just detect which case you are in from the script? E.g. through environment variables, or by inspecting which process called autorandr.
I solved it by rewriting my scripts and checking whether i3 is the active window manager. See here.