|Scripts quick access edit this|
- Author: Ewan Mellor <firstname.lastname@example.org>
- Version: 1.0
- License: MIT License
- Download: shutdown.jl
- Homepage: http://www.ewanmellor.org.uk/sawfish.html
Closing windows gracefully.
This module contains one function (
shutdown) which shuts down each window
listed in the configuration variable
*shutdown-windows*. It does this by
sending the configured keypress to the window matching the given regular
expression, and then waiting for that window to be destroyed. This means
that, for example, Opera can be shutdown cleanly on logout, and won't complain
when you start back up again.
- Save shutdown.jl in your load-path.
- Add the following line to your ~/.sawfishrc:
The windows you want to be closed cleanly are stored in the
*shutdown-windows* variable along with their respective closing shortcuts. Here's an example for Opera (Control-q) and Firefox (Control-Shift-w). Put it into your ~/.sawfishrc to make it work.
(setq *shutdown-windows* '(("Opera " . "C-q") ("Firefox" . "C-W")) )
You can use the
shutdown function wherever you have your log-out
functionality. Sample code for ~/.sawfish/rc:
(nconc root-menu '(("_Quit" (shutdown quit))))
This adds a "Quit" option to the root menu, and calls shutdown and
(quit) with that menu option. Notice the continuation-style handling of
what to call once the windows have been destroyed.