Insomnia Clinic

Insomnia Clinic is a set of AppleScripts to easily load and unload the Insomnia.kext kernel extension by the binaervarianz collective. For more info (and the source code if you're interested) go read the Insomnia homepage.


The default way to load the extension (apart from putting it in /System/Library/Extensions, I presume) is to run

kextload Insomnia.kext

to load it and

kextunload Insomnia.kext

to unload it. Both must be run as root (either log in as root or use the sudo command). The kext file also must be set to be owned by the user root and the group wheel.

This set of scripts aims to make it easier to quickly load and unload it without switching to the terminal, navigating to the folder kontaining the extension and executing the kext(un)load command.


  • Download Insomnia Clinic (see above).
  • Unpack the file Double-clicking it should do the trick.
  • Copy the folder Insomnia Clinic from the disk image to whereever you want to put it. The Applications folder is a good idea, generally. Anywhere else is fine, too. You can eject the disk image afterwards.
  • Download the Insomnia extension from the Insomnia web page.
  • Unpack the downloaded file and move Insomnia.kext to the Insomnia Clinic you just copied down from the disk image. This is important! The scripts will only find the extension if it is located in the same folder.
  • You are done. Read the usage info below and have fun.


Upon first running Suffer Insomnia or Insomnia Clinic the user may be told that permissions on the file Insomnia.kext are incorrect and it's required to enter the administrator password to change this. This runs the command

chown root:wheel Insomnia.kext

to correct the access permissions. The extension cannot be loaded otherwise.

Diagnose Insomnia

This script merely displays a message telling you whether the extension is loaded or not.

Suffer Insomnia

When run promts the user for the administrator password, then attempts to load the Insomnia extension. Does nothing when it's already loaded.

Cure Insomnia

Unloads the extension after asking for the administrator password. If the extension is not loaded, this script does nothing.

Insomnia Clinic

This script basically combines all of the above. When run it tells you whether the extension is loaded or not amd asks if this should be changed. If this is confirmed, the script asks for the administrator password and attempts to load/unload the Insomnia extension. Afterwards the output of the kextload or kextunload command is shown.

Version History

  • 1.0 (2005-03-03) First release. This version was tested with the 0.9 version of Insomnia.


These scripts were built by Lasar Liepins

The Insomnia/nosleep/meltmac kernel extension was developed by the binaervarianz collective.