From af84673c80ae02091009a901770b505e756d002e Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Wed, 13 May 2026 13:43:38 +0100 Subject: refactor(sway): apply display layout natively via include file Persist the layout as a sway-include file (~/.config/sway/outputs.conf) so sway's own parser applies output directives natively on every reload. Eliminates the side-by-side flash that came from sway's default "enable everything side-by-side" before exec_always could override it. - display-toggle.sh: write outputs.conf alongside the live swaymsg commands, mirroring the same enable/disable/pos directives. - sway/config: `include ~/.config/sway/outputs.conf` next to the background line; downgrade exec_always back to plain exec since the include handles reloads now (script only needs to run once at startup to bootstrap the include file on first boot). --- dot_config/sway/config | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'dot_config/sway/config') diff --git a/dot_config/sway/config b/dot_config/sway/config index 73283c9..ac7acb3 100644 --- a/dot_config/sway/config +++ b/dot_config/sway/config @@ -40,6 +40,10 @@ seat * xcursor_theme Adwaita 24 # ── Output ──────────────────────────────────────────────────────────────────── output * bg #282828 solid_color +# Per-output enable/disable/position is written by display-toggle.sh and +# re-read by sway on every reload. Sway's `include` silently no-ops if the +# file doesn't exist (first boot, before the script has run). +include ~/.config/sway/outputs.conf # ── Window rules ────────────────────────────────────────────────────────────── for_window [class="feh"] floating enable @@ -238,7 +242,7 @@ bindsym $mod+t exec ~/.config/sway/tb-toggle.sh # ── Autostart ───────────────────────────────────────────────────────────────── exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE XDG_SESSION_DESKTOP PASSWORD_STORE_DIR exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE XDG_SESSION_DESKTOP PASSWORD_STORE_DIR -exec_always "sleep 2 && ~/.config/sway/display-toggle.sh apply" +exec "sleep 2 && ~/.config/sway/display-toggle.sh apply" exec systemctl --user start sway-session.target exec ~/.config/sway/tb-autostart.sh -- cgit v1.3.1