diff options
| -rw-r--r-- | dotfiles/hyprland/.config/hypr/hyprland.conf | 2 | ||||
| -rwxr-xr-x | dotfiles/hyprland/.local/bin/focus-restore | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/dotfiles/hyprland/.config/hypr/hyprland.conf b/dotfiles/hyprland/.config/hypr/hyprland.conf index 585147e..34e44b6 100644 --- a/dotfiles/hyprland/.config/hypr/hyprland.conf +++ b/dotfiles/hyprland/.config/hypr/hyprland.conf @@ -197,7 +197,7 @@ bind = $mod, D, layoutmsg, removemaster # Focus mode (xtra-dispatchers plugin) # O = "Only this window" / "bring back Others" / "close Others" bind = $mod, O, exec, hyprctl dispatch plugin:xtd:throwunfocused 10 -bind = $mod SHIFT, O, exec, hyprctl dispatch plugin:xtd:bringallfrom 10 +bind = $mod SHIFT, O, exec, focus-restore bind = $mod CTRL, O, exec, hyprctl dispatch plugin:xtd:closeunfocused # Gaps (from DWM) 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 |
