From c6a8ca4a5a67dd6c80afbb3ccf0037856fa02001 Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Sat, 16 May 2026 23:53:51 +0200 Subject: [PATCH] nymph: add kanshi profiles for laptop / dock switching Two profiles, auto-selected from connected outputs: - solo: only eDP-1, all workspaces routed there. - dual: eDP-1 + DP-1 (3440x1440@100Hz dock), workspace 1 on the laptop panel and 2-10 on the dock; each profile reissues swaymsg "workspace N, move workspace to output X" on activation so workspaces follow. host.conf autostarts kanshi and drops the redundant gaps/corner_radius overrides, leaving the base sway/config values in effect. Co-Authored-By: Claude Opus 4.7 --- ansible/inventory/host_vars/nymph.yml | 3 +++ dotfiles/nymph/.config/kanshi/config | 17 +++++++++++++++++ dotfiles/nymph/.config/sway/host.conf | 5 ++--- 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 dotfiles/nymph/.config/kanshi/config diff --git a/ansible/inventory/host_vars/nymph.yml b/ansible/inventory/host_vars/nymph.yml index 97c2b03..9b06dc2 100644 --- a/ansible/inventory/host_vars/nymph.yml +++ b/ansible/inventory/host_vars/nymph.yml @@ -39,3 +39,6 @@ host_sway_dotfiles: - src: .config/sway/session-env dest: .config/sway/session-env mode: "0644" + - src: .config/kanshi/ + dest: .config/kanshi/ + mode: preserve diff --git a/dotfiles/nymph/.config/kanshi/config b/dotfiles/nymph/.config/kanshi/config new file mode 100644 index 0000000..a96e34a --- /dev/null +++ b/dotfiles/nymph/.config/kanshi/config @@ -0,0 +1,17 @@ +profile solo { + output DP-1 disable + output DP-2 disable + output HDMI-A-1 disable + output HDMI-A-2 disable + output eDP-1 enable mode 1920x1080 position 0,0 + exec swaymsg "workspace 1, move workspace to output eDP-1; workspace 2, move workspace to output eDP-1; workspace 3, move workspace to output eDP-1; workspace 4, move workspace to output eDP-1; workspace 5, move workspace to output eDP-1; workspace 6, move workspace to output eDP-1; workspace 7, move workspace to output eDP-1; workspace 8, move workspace to output eDP-1; workspace 9, move workspace to output eDP-1; workspace 10, move workspace to output eDP-1" +} + +profile dual { + output DP-2 disable + output HDMI-A-1 disable + output HDMI-A-2 disable + output eDP-1 enable mode 1920x1080 position 0,0 + output DP-1 enable mode 3440x1440@100Hz position 1920,0 + exec swaymsg "workspace 1, move workspace to output eDP-1; workspace 2, move workspace to output DP-1; workspace 3, move workspace to output DP-1; workspace 4, move workspace to output DP-1; workspace 5, move workspace to output DP-1; workspace 6, move workspace to output DP-1; workspace 7, move workspace to output DP-1; workspace 8, move workspace to output DP-1; workspace 9, move workspace to output DP-1; workspace 10, move workspace to output DP-1" +} diff --git a/dotfiles/nymph/.config/sway/host.conf b/dotfiles/nymph/.config/sway/host.conf index c51d06a..7e3acb5 100644 --- a/dotfiles/nymph/.config/sway/host.conf +++ b/dotfiles/nymph/.config/sway/host.conf @@ -1,8 +1,7 @@ set $terminal ~/.local/bin/prime-run /usr/bin/alacritty -gaps inner 10 -gaps outer 5 -corner_radius 10 +# Multi-monitor profile switching (laptop standalone vs dock) +exec kanshi workspace 1 output eDP-1 workspace 2 output DP-1