From ef2a15a2c0a530fefff1a40a84be2e9845b6fd04 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 27 Jan 2026 21:05:45 -0600 Subject: feat(hyprland): add focus-restore script to preserve master on mod+shift+o The xtra-dispatchers bringallfrom dispatcher doesn't preserve window positions, displacing the focused window from master. The new script captures the focused window address, brings all windows back, then swaps the original window back to master. Co-Authored-By: Claude Opus 4.5 --- dotfiles/hyprland/.local/bin/focus-restore | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 dotfiles/hyprland/.local/bin/focus-restore (limited to 'dotfiles/hyprland/.local/bin') diff --git a/dotfiles/hyprland/.local/bin/focus-restore b/dotfiles/hyprland/.local/bin/focus-restore new file mode 100755 index 0000000..7f87390 --- /dev/null +++ b/dotfiles/hyprland/.local/bin/focus-restore @@ -0,0 +1,9 @@ +#!/bin/sh +# Restore unfocused windows from workspace 10 without disrupting master position. +# Records the focused window, brings all back, then swaps it back to master. + +FOCUSED=$(hyprctl activewindow -j | jq -r '.address') +hyprctl dispatch plugin:xtd:bringallfrom 10 +sleep 0.1 +hyprctl dispatch focuswindow "address:$FOCUSED" +hyprctl dispatch layoutmsg swapwithmaster master -- cgit v1.2.3