yay -S kanshi
hyprctl monitors
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.
profile external-dell {
output eDP-1 disable
# Dell P2416D, 23.8 inches, 123.41 PPI (see https://www.sven.de/dpi/)
# "make model serial" from `swaymsg -t get_outputs`
output "Dell Inc. DELL P2416D 6RC2C54O0NWS" mode 2560x1440 position 0,0 scale 1.75
}
profile external-dell-4k {
output eDP-1 disable
# DELL U3219Q 9RSG413, 31.5 inches, 139.87 PPI (see https://www.sven.de/dpi/)
# "make model serial" from `swaymsg -t get_outputs`
output "Dell Inc. DELL U3219Q 9RSG413" mode 3840x2160 position 0,0 scale 2
}
profile external-hp1 {
output eDP-1 disable
# HP E243, 23 inches, 95.78 PPI (see https://www.sven.de/dpi/)
# "make model serial" from `swaymsg -t get_outputs`
output "Unknown HP E243 CNK0470PZR" mode 1920x1080 position 0,0 scale 1.33
}
profile external-hp2 {
output eDP-1 disable
# HP E231, 23 inches, 95.78 PPI (see https://www.sven.de/dpi/)
# "make model serial" from `swaymsg -t get_outputs`
output "Hewlett Packard HP E231 6CM3472DH4" mode 1920x1080 position 0,0 scale 1.33
}
profile internal {
{%@@ if profile == "knafeh" @@%}
output eDP-1 enable mode 2560x1440 scale 1.75 position 0,0
{%@@ elif profile == "balozi" @@%}
output eDP-1 enable mode 1920x1080 scale 1.33 position 0,0
{%@@ endif @@%}
}