Fandom

Sawfish

Shutdown

773pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Scripts quick access edit this

Synopsis Edit

Closing windows gracefully.

Description Edit

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.

Installation Edit

  1. Save shutdown.jl in your load-path.
  2. Add the following line to your ~/.sawfishrc:
    (require 'shutdown)

Configuration Edit

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 then (quit) with that menu option. Notice the continuation-style handling of what to call once the windows have been destroyed.

Also on Fandom

Random Wiki