@thelinuxcast
You usually use swayidle for that. Put the following line in swayidle's config:
timeout 450 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"'
This should do the trick.
@thelinuxcast
Oh, yes, it can get tricky!
There is a nice little program named kanshi for handling multiple displays, like running certain commands when display with particular name is connected. I use it to shut off the built-in display of my laptop when external display is connected and to set scaling and padding on that display. Maybe it'll be of use to you too.
@m0xee Yeah, I did get it to work, but then when it came back it messed up and made the other monitor the primary monitor. Still messing around with it.