#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
# 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."
eshep
in reply to Joel Pomales • •WOW ...so many things (potentially) wrong with that 😆
What specifically did you ask it to receive such a definitive result? Did it know you'd be using apt to install things? Did it know what window manager you use, or that it was one running under X, not wayland? If it knew the window manager you were asking about, why not suggest a native solution instead of installing another program?
This is the problem I have with current AI chats for most inquiries. For all the resources they have at their little robot fingertips, they seem to offer answers far less knowledgeable than what you can find yourself by simply searching through most any technical forum.