summaryrefslogtreecommitdiff
path: root/dotfiles/hyprland/.local/bin/stash-others
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/hyprland/.local/bin/stash-others')
-rwxr-xr-xdotfiles/hyprland/.local/bin/stash-others12
1 files changed, 12 insertions, 0 deletions
diff --git a/dotfiles/hyprland/.local/bin/stash-others b/dotfiles/hyprland/.local/bin/stash-others
new file mode 100755
index 0000000..5af6743
--- /dev/null
+++ b/dotfiles/hyprland/.local/bin/stash-others
@@ -0,0 +1,12 @@
+#!/bin/bash
+# Stash all unfocused windows on current workspace to special:stash
+
+focused=$(hyprctl activewindow -j | jq -r '.address')
+workspace=$(hyprctl activewindow -j | jq -r '.workspace.id')
+
+# Get all windows on current workspace except the focused one
+hyprctl clients -j | jq -r --arg focused "$focused" --argjson ws "$workspace" \
+ '.[] | select(.workspace.id == $ws and .address != $focused) | .address' | \
+while read -r addr; do
+ hyprctl dispatch movetoworkspacesilent special:stash,address:"$addr"
+done