summaryrefslogtreecommitdiff
path: root/dotfiles/hyprland/.local/bin/stash-others
blob: 5af6743d55c23ff9518b68156d3ab58da874490b (plain)
1
2
3
4
5
6
7
8
9
10
11
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