autorandr icon indicating copy to clipboard operation
autorandr copied to clipboard

[REQUEST] Add option to ignore postswitch

Open 9las opened this issue 3 years ago • 1 comments

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.

9las avatar Jan 28 '22 22:01 9las

Could you just detect which case you are in from the script? E.g. through environment variables, or by inspecting which process called autorandr.

phillipberndt avatar Jan 29 '22 07:01 phillipberndt

I solved it by rewriting my scripts and checking whether i3 is the active window manager. See here.

9las avatar Apr 23 '23 22:04 9las