mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 14:12:41 +00:00
feat: Adds close-windows script, need to remove close-all-windows script and update keybinds to use new script.
This commit is contained in:
14
env/.local/scripts/close-all-windows
vendored
14
env/.local/scripts/close-all-windows
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user