docker behaviour for multiple monitors

couldnt find anything out these

this is the best company i have seen for mac productivity on advanced capabilites
so i thought to ask here

i have a ultrawide screen - which when connected is the main - ie use the dock most
and i would like the dock to be there in the middle and hidden

when disconnecting, id like it to move to the left and not hidden

any ways of doing that?

That should be possible with an AppleScript and conditional activation groups. Create a CAG that is linked to the different screen resolutions you are using and run this or a similar script.

tell application "System Events"
try
set dockPreferences to dock preferences
if screen edge of dockPreferences is bottom then
set screen edge of dockPreferences to left
set autohide of dockPreferences to false
else if screen edge of dockPreferences is left then
set screen edge of dockPreferences to bottom
set autohide of dockPreferences to true
set animate of dockPreferences to true
else if screen edge of dockPreferences is missing value then
set screen edge of dockPreferences to left
set autohide of dockPreferences to false
end if
on error errMsg number errNum
display dialog "Error " & errNum & ": " & errMsg
end try
end tell