feat: Updates keybinds and removes close-all-windows script.

This commit is contained in:
2025-10-02 16:28:04 -04:00
parent e23e861101
commit 93fe3b6864
2 changed files with 2 additions and 66 deletions

View File

@@ -1,64 +0,0 @@
#!/usr/bin/env bash
usage() {
cat <<EOF
Close all windows for a workspace id, special workspace name, or all windows.
USAGE:
$ close-all-windows [OPTIONS] <ID (optional)>
OPTIONS:
-a | --active-workspace: Close all windows in the active workspace.
-s | --special <name>: The name of the special workspace.
-h | --help: Show this help page.
NOTE:
If no options or workspace id is passed in, it will close all windows in all workspaces.
EOF
}
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
workspace_id=$(hyprctl activeworkspace -j | jq -r '.id')
else
workspace_id=$1
fi
shift
done
if [[ $special_flag == "1" ]] && [[ -z $workspace_name ]]; then
echo -e "\n[ERROR]: must supply name of the special workspace.\n"
usage && exit 1
fi
if [[ -n $workspace_id ]]; then
windows+=($(hyprctl clients -j | jq -r ".[] | select(.workspace.id == $workspace_id) | .address"))
elif [[ -n $workspace_name ]]; then
windows+=($(hyprctl clients -j | jq -r ".[] | select(.workspace.name | contains(\"$workspace_name\")) | .address"))
else
windows+=($(hyprctl clients -j | jq -r ".[] | .address"))
fi
$SCRIPTS/close-window $windows