How can I close multiple instances of Gedit windows through the command line?
Some of the windows may contain changes to documents. So, I would like to be prompted to save them or not.
If I use pkill gedit
it will simply kill all instances without prompting to save changes.
Background info: Often, I have tons of windows open over multiple workspaces. Some of them are Gedit windows with notes. Thus, when running shutdown -h now
shutdown will block because some windows contain changes to files or unsaved notes. Saving all instances with changes would prevent me from inspecting and closing all windows one by one.
I do not think this is possible. You options are to enable backups and install gedit plugins. Session Saver (included in gedit-plugins) allows you to save you current workspace within gedit as it is, so that when you restore a session at a later time you can start right where you left your work.
There is also an additional package on sourceforge
http://sourceforge.net/projects/geditautosaves/
Gedit has an autosave mechanism built in that is turned off by default.
Perhaps it works for your situation to simply enable this and tune it to a sufficiently low number of minutes.
With this method chances are at least minimized you will get a dialog that blocks your shutdown procedure.