When I right click on an application's icon in the Unity launcher, I can press Quit to close all the windows corresponding to that application. Is it possible to do the same with a keyboard shortcut which operates on the active window (and all the other windows corresponding to the same application)?
I could do something similar with xkill
, but in that case I do not have the message that remembers me of unsaved files.
Best Answer
The answer by user72216 didn't work always. For example if I opened several Okular (a KDE PDF viewer) windows, the code won't close all windows, as different window ids are assigned to the windows. The following code extracts all window ids and closes them gracefully: