diff --git a/sway/.config/sway/config b/sway/.config/sway/config index d3573a4..6981be3 100644 --- a/sway/.config/sway/config +++ b/sway/.config/sway/config @@ -19,29 +19,15 @@ set $term foot set $menu wmenu-run default_border pixel -### Output configuration -# -# Default wallpaper (more resolutions are available in /run/current-system/sw/share/backgrounds/sway/) -# output * bg /run/current-system/sw/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill -# -# Example configuration: -# -# output HDMI-A-1 resolution 1920x1080 position 1920,0 -# -# You can get the names of your outputs by running: swaymsg -t get_outputs +# Default: enable laptop screen (internal panel) +output eDP-1 enable -### Idle configuration -# -# Example configuration: -# -# exec swayidle -w \ -# timeout 300 'swaylock -f -c 000000' \ -# timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ -# before-sleep 'swaylock -f -c 000000' -# -# This will lock your screen after 300 seconds of inactivity, then turn off -# your displays after another 300 seconds, and turn your screens back on when -# resumed. It will also lock your screen before your computer goes to sleep. +# If HDMI is plugged in, prefer it and disable laptop screen +exec_always { + swaymsg -t get_outputs | grep -q '"name": "HDMI-A-1"' \ + && swaymsg output HDMI-A-1 enable \ + && swaymsg output eDP-1 disable +} ### Input configuration #