2023-06-14 03:16:26 -04:00
|
|
|
#!/usr/bin/env bash
|
2023-05-31 02:29:22 -04:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2023-06-03 23:10:30 -04:00
|
|
|
# Close every window except permanent ones
|
2023-05-31 02:29:22 -04:00
|
|
|
for element in "${array[@]}"
|
|
|
|
do
|
2023-06-03 23:10:30 -04:00
|
|
|
if [[ "$element" != "tablet-toggle" ]]; then
|
|
|
|
$HOME/.config/eww/scripts/close.sh "$element"
|
|
|
|
fi
|
2023-05-31 02:29:22 -04:00
|
|
|
done
|