feat: Adds close-windows script, need to remove close-all-windows script and update keybinds to use new script.

This commit is contained in:
2025-10-02 16:26:10 -04:00
parent 45bcf8771c
commit e23e861101
4 changed files with 152 additions and 27 deletions

View File

@@ -25,14 +25,19 @@ special_flag="0"
workspace_name=""
workspace_id=""
windows=()
SCRIPTS=${SCRIPTS}
if [[ -z $SCRIPTS ]]; then
echo "SCRIPTS not set in the environment."
echo "Using: ~/.local/scripts"
SCRIPTS=~/.local/scripts
fi
while [[ $# -gt 0 ]]; do
if [[ $1 =~ ^-s ]] || [[ $1 =~ ^--special ]]; then
shift
special_flag="1"
workspace_name=$1
elif [[ $1 =~ ^-h ]] || [[ $1 =~ ^--help ]]; then
usage && exit 0
elif [[ $1 =~ ^-a ]] || [[ $1 =~ ^--active-workspace ]]; then
@@ -56,7 +61,4 @@ else
windows+=($(hyprctl clients -j | jq -r ".[] | .address"))
fi
for w in ${windows[@]}; do
echo "Closing window address: $w"
hyprctl dispatch closewindow address:$w
done
$SCRIPTS/close-window $windows