Script to automatically close windows titled 'Error'

The following script will use wmctrl to close all windows that have the title “Error”. Make sure you have wmctrl installed on your system (sudo apt -y install wmctrl).

wmctrl -l | grep "Error" | awk '{print $1}' | xargs -I {} wmctrl -i -c {}