Homebrewο
- OS:
π§ Linux π macOS
The easiest way to set up Desomnia on Linux or macOS is to use Homebrew. Install it with the following command:
brew install mad0x20wizard/tools/desomnia
The software will be installed according to the standard Homebrew filesystem layout. The root of this layout differs by platform. To find your Homebrew prefix, run:
brew --prefix
On macOS running on Apple Silicon, this is /opt/homebrew. All paths below are relative to this base path.
Binary distributionο
Homebrew normally downloads source code and builds the project locally. Desomnia also provides pre-built binaries (known as βbottlesβ) for the following platforms:
linux/x64linux/arm64macos/sequoia/arm64macos/tahoe/arm64
The availability of pre-built bottles can be checked here.
Filesystem layoutο
Use these locations to customise your installation of Desomnia, relative to your Homebrew installation:
- /etc/desomnia
Put a suitable
monitor.xmlinto this location, to tell Desomnia what to do. You can also create aNLog.configfile here, to configure additional logging, beside the console output.- /var/lib/desomnia/plugins
Here you can drop your additional plugins, which will be loaded when the programs starts.
- /var/log/desomnia
Here you will find the log files, if you enabled file logging in the
NLog.configand used${var:logDir}as base path.
Running as background serviceο
Desomnia can only reach its full potential when run as a background service. Homebrew provides a platform-agnostic way to install and auto-start it:
sudo brew services start mad0x20wizard/tools/desomnia
To stop the service and remove it from auto-start:
sudo brew services stop mad0x20wizard/tools/desomnia
Attention
sudo is required so that Desomnia is installed and run as a system service with root privileges.
Error
A couple of problems can arise when running this on π§ Linux:
Running the brew command with
sudocan fail if brew is not on the default path of the root user. Specify an absolute path to work around this:sudo /home/linuxbrew/.linuxbrew/bin/brew services start mad0x20wizard/tools/desomnia
On some platforms, it is necessary to configure sudo to preserve the
HOMEenvironment variable:sudo --preserve-env=HOME brew services start mad0x20wizard/tools/desomnia
Use either or both of these workarounds as needed.
Plugins includedο
Desomnia installed via Homebrew includes all plugins from the main repository. To install additional plugins, place the ZIP file in .../var/lib/desomnia/plugins. The file must follow the naming convention plugin-*.zip, with an optional version specifier separated from the name by _.
Loggingο
The location of the default output of Desomnia depends on the platform:
Fileο
- OS:
π macOS
The standard output and error logs, as well as the extended logs are written to .../var/log/desomnia.
Journalο
- OS:
π§ Linux
The INFO-level console output shows the most important actions Desomnia takes β such as waking remote hosts or sending knock packets β giving a quick overview of what the service is doing at any point in time. Warnings and errors are included as well.
To follow the live output from the systemd journal, run:
journalctl -u desomnia -f -n 80
Extended Loggingο
To enable additional file-based logging, create a log configuration at .../etc/desomnia/NLog.config. Unless configured otherwise, these logs will be written to .../var/log/desomnia.
Uninstallationο
To remove Desomnia from your system:
brew uninstall mad0x20wizard/tools/desomnia
Note
This does not remove the configuration, custom plugins, or log files. Those must be deleted manually from their respective directories.