feat(desktop): overhaul multi-monitor docking UX
Some checks failed
Check / eval (push) Has been cancelled

This commit is contained in:
Bernardo Magri
2026-07-08 22:29:44 +01:00
parent 05c7c7b54f
commit 8a5714f330
4 changed files with 50 additions and 31 deletions

View File

@@ -197,17 +197,35 @@ ${lib.concatStringsSep "\n" (lib.mapAttrsToList
case "$v" in true|True) return 0 ;; *) return 1 ;; esac
}
outputs() { hyprctl monitors all -j 2>/dev/null | jq -r '.[].name' | sort; }
prev=$(outputs)
while :; do
sleep 3
check_monitors() {
cur=$(outputs)
[ "$cur" = "$prev" ] && continue
prev=$cur
[ -n "$cur" ] || continue
auto_on || continue
target=$(nomarchy-display-profile match $cur) || continue
[ "$target" = "$(nomarchy-display-profile active)" ] && continue
nomarchy-display-profile apply "$target"
[ "$cur" = "$1" ] && return
[ -n "$cur" ] || return
auto_on || return
target=$(nomarchy-display-profile match $cur) || target="base"
if [ "$target" = "base" ]; then
[ "$(nomarchy-display-profile active)" = "none" ] && return
nomarchy-display-profile base
else
[ "$target" = "$(nomarchy-display-profile active)" ] && return
nomarchy-display-profile apply "$target"
fi
echo "$cur"
}
prev=$(outputs)
# Listen to Hyprland's IPC socket for instant hotplug reaction
${pkgs.socat}/bin/socat -U - UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | while read -r line; do
case "$line" in
monitoradded*|monitorremoved*)
res=$(check_monitors "$prev")
[ -n "$res" ] && prev="$res"
;;
esac
done
'';

View File

@@ -61,6 +61,12 @@
{ mods = "$mod"; key = "up"; action = "movefocus, u"; desc = "Focus up"; }
{ mods = "$mod"; key = "down"; action = "movefocus, d"; desc = "Focus down"; }
# Multi-monitor workspace movement — SUPER + ALT + arrow keys.
{ mods = "$mod ALT"; key = "left"; action = "movecurrentworkspacetomonitor, l"; desc = "Move workspace to left monitor"; }
{ mods = "$mod ALT"; key = "right"; action = "movecurrentworkspacetomonitor, r"; desc = "Move workspace to right monitor"; }
{ mods = "$mod ALT"; key = "up"; action = "movecurrentworkspacetomonitor, u"; desc = "Move workspace to upper monitor"; }
{ mods = "$mod ALT"; key = "down"; action = "movecurrentworkspacetomonitor, d"; desc = "Move workspace to lower monitor"; }
# Screenshots (the menu's Capture module has the rest: OCR, recording).
# Bare Print → region to clipboard; the two → file binds save a
# timestamped PNG under ~/Pictures/Screenshots and toast the path, the