aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/hyprland/.local/bin
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-01-27 21:05:45 -0600
committerCraig Jennings <c@cjennings.net>2026-01-27 21:05:45 -0600
commit24e1c3ce87e7997991b1a96bf5dd4e4fce892e77 (patch)
treed6cbd61d50e304231fe684c638eb701d12123d7a /dotfiles/hyprland/.local/bin
parent92e5e6cd41d7204693b4a9ef0027378ebff617db (diff)
downloadarchsetup-24e1c3ce87e7997991b1a96bf5dd4e4fce892e77.tar.gz
archsetup-24e1c3ce87e7997991b1a96bf5dd4e4fce892e77.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'dotfiles/hyprland/.local/bin')
-rwxr-xr-xdotfiles/hyprland/.local/bin/focus-restore9
1 files changed, 9 insertions, 0 deletions
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