2023-06-27 10:13:14 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Store the output of the command in an array, keeping only lines with '*'
|
|
|
|
readarray -t array <<< "$(eww windows | grep '^\*')"
|
|
|
|
|
|
|
|
# Remove the '*' from each element
|
|
|
|
for ((i=0; i<${#array[@]}; i++))
|
|
|
|
do
|
|
|
|
array[i]=${array[i]#'*'}
|
|
|
|
array[i]=${array[i]%-reveal}
|
|
|
|
done
|
|
|
|
|
|
|
|
# Close every window except permanent ones
|
|
|
|
for element in "${array[@]}"
|
|
|
|
do
|
2023-07-22 00:19:46 -04:00
|
|
|
if [[ "$element" != "left-bar" && "$element" != "right-bar" ]]; then
|
2023-07-21 22:49:27 -04:00
|
|
|
"$EWW_PATH"/close.sh "$element"
|
2023-06-27 10:13:14 -04:00
|
|
|
fi
|
|
|
|
done
|