#Linux hive mind. I asked this of off one of the LLMs. I don't code. All I want is to run a script that closes everything in the desktop
#!/bin/bash
# Check if wmctrl is installed, if not, install it
if ! command -v wmctrl &> /dev/null
then
echo "wmctrl could not be found, installing..."
sudo apt-get install wmctrl -y
fi
# Get a list of all window IDs and close each one
for win_id in $(wmctrl -l | awk '{print $1}')
do
wmctrl -ic "$win_id"
done
echo "All windows have been closed."