Kanshi

Install kanshi to automatically switch from display configurations

Create a file in ~/.config/systemd/user/kanshi.service, with the following contents:

[Unit]
Description=Dynamic output configuration for Wayland compositors
Documentation=https://sr.ht/~emersion/kanshi
BindsTo=sway-session.target

[Service]
Type=simple
ExecStart=/usr/bin/kanshi

[Install]
WantedBy=sway-session.target

Create an empty configuration with mkdir -p ~/.config/kanshi && touch ~/.config/kanshi/config. And write the following contents:

profile {
	output eDP-1 position 0,0
}

profile docked {
	output eDP-1 disable
	output "Dell Inc. DELL P2719H HFZNV13" enable
	output "Dell Inc. DELL P2719H 75L7223" enable
}

Then issue systemctl --user enable --now kanshi.