We can use command
pactl - Control a running PulseAudio sound server on terminal
first, list our available properties in our machine using this command:
pactl list cards
based on my hardware above, i set output:hdmi-stereo as my default profile using this command:
pactl set-card-profile 0 output:hdmi-stereo
if we want to set to internal ...
The idea would be to tell lightdm to use the same settings that you use for the monitors.
So, login into elementary with the external monitor connected, set up your displays the way you want in System Settings -> Displays (mark the external display as primary by clicking its star in the upper left corner). Save you configuration.
Now, copy the ~/.config/...
Instead of closing the lid of the laptop you can use the cycle display modes shortcut Super+p. On both of the laptops I use there is such a function key also. If I do it like this after the resume of suspend it enables the same monitor as before the suspend. Also, if you want to skip logging in on wakeup, you can set this using System settings > Security &...