diff options
Diffstat (limited to 'dotfiles/hyprland/.local/bin')
| -rwxr-xr-x | dotfiles/hyprland/.local/bin/stash-others | 12 | ||||
| -rwxr-xr-x | dotfiles/hyprland/.local/bin/stash-restore | 10 | ||||
| -rwxr-xr-x | dotfiles/hyprland/.local/bin/stash-window | 4 |
3 files changed, 26 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 diff --git a/dotfiles/hyprland/.local/bin/stash-restore b/dotfiles/hyprland/.local/bin/stash-restore new file mode 100755 index 0000000..e04945a --- /dev/null +++ b/dotfiles/hyprland/.local/bin/stash-restore @@ -0,0 +1,10 @@ +#!/bin/bash +# Restore all windows from special:stash to current workspace + +workspace=$(hyprctl activeworkspace -j | jq -r '.id') + +# Get all windows in special:stash and move them to current workspace +hyprctl clients -j | jq -r '.[] | select(.workspace.name == "special:stash") | .address' | \ +while read -r addr; do + hyprctl dispatch movetoworkspacesilent "$workspace",address:"$addr" +done diff --git a/dotfiles/hyprland/.local/bin/stash-window b/dotfiles/hyprland/.local/bin/stash-window new file mode 100755 index 0000000..1ffab8c --- /dev/null +++ b/dotfiles/hyprland/.local/bin/stash-window @@ -0,0 +1,4 @@ +#!/bin/bash +# Stash the focused window to a special workspace + +hyprctl dispatch movetoworkspacesilent special:stash |
