This is half "this'd be useful for me" and half "hobby project" - I was wondering if it's possible to send a command via a
gnome-terminal that will quit all instances of a program without using
Essentially I'd like to write a script, which I will put in my
$PATH, that will try and exit all open terminal windows as if the close button had been clicked on each, rather than killing. The reason being that I have a terrible habit of opening many terminal windows at once and it's a hassle to go through each of them and quit all of them individually. Simply typing
exeunt (because let's face it, there's no better name for a command to "exit all") and having them all quit would be far better for me. However, I don't want to accidentally close any programs that are still running from within a terminal - I still want to see any "There is still a process running in this terminal" prompts, so the command
killall gnome-terminal would be out of the question.
The ideal I suppose would be a command-line / bash equivalent of rightclicking on the Dash icon and pressing "quit". Possibly a slightly unorthodox request, but I'd be interested to know if it's somehow possible.