Skip to content

almostearthling/whenever

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

416 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The whenever Automation Tool

HeaderImage

This is not the scheduler you are looking for...

Linux Standard Build Windows Standard Build

Documentation

whenever is a lightweight automation tool capable of executing tasks when specific conditions are verified. Conditions can be of several types, for example:

  • ⏰ time based, that is, verified at intervals or specific more-or-less defined instants,
  • 🔧 depending on the results of OS commands or Lua scripts,
  • 💻 based on the inspection of system properties, via DBus on Linux and WMI on Windows,
  • 💣 reactions to events, such as:
    • 📁 changes in specific files and directories,
    • 💤 session inactivity,
    • 🚨 DBus signals on Linux, and WMI event queries on Windows.

while tasks mostly consist in the execution of OS commands and Lua scripts. This is done within a desktop session, without the need for the user to have administrative rights.

✨ Purpose

whenever works on both Linux and Windows: on Linux it allows for a more flexible way of automating actions compared to the traditional cron method, and on Windows it offers a more streamlined way to schedule activities, compared to the system-provided Task Scheduler which is available through the system management console.

The ability to inspect DBus and WMI as well as react to the respective signals and events, and to use system commands to check their status and output, allows for conditions to be activated virtually at every possible change in the system status.

The tool intends to remain as frugal as possible in terms of used computational resources, and to possibly run at a low priority level, while still providing high flexibility and configurability. The configuration is provided by a TOML file, which must contain all definitions for conditions and associated tasks, as well as events that the application should listen to while running in the background.

💾 Installation

Even though whenever is a console application, it is designed for desktops: therefore it should be executed via a controlling GUI frontend. Currently, there are two companion wrappers available:

  • When, a Python based fully featured application to configure and run whenever,
  • whenever_tray, a minimal wrapper that displays an icon in the system tray and provides basic interaction.

Prebuilt binaries can be downloaded from the releases page, and basic installation instructions are provided in the online documentation. However, the easiest (and suggested) way to get whenever up and running, is to install When, use it to download and configure whenever, and set it up to start when the user session begins.

The provided binaries are self-contained on Windows, and almost so on Linux: on Linux they require the X.org subsystem to be installed, a prerequisite that is often satisfied. So, to just give a try to the console application you can:

  1. download the prebuilt binary archive suitable for your OS, and extract the whenever executable to a directory in your PATH, for example ~/.local/bin if present

  2. create and edit a file named whenever.toml, so that it contains the following text:

    [[task]]
    type = "lua"
    name = "TRACE"
    script = '''log.warn("Trace: *** VERIFIED CONDITION *** `" .. whenever_condition .. "`")'''
    
    [[condition]]
    name = "Periodic_15s"
    type = "interval"
    interval_seconds = 15
    recurring = true
    tasks = ["TRACE"]
  3. launch the following command, in the same directory where whenever.toml is located:

    whenever -L trace whenever.toml

The application will start to run in the background and to log to the terminal it is running within. Every 15th second a warning similar to the following will be shown:

[2026-03-31T11:38:45.986] (whenever) WARN  TASK exec_lua TRACE/1: [PROC/MSG] (trigger: Periodic_15s) (Lua) Trace: *** VERIFIED CONDITION *** `Periodic_15s`

To terminate the console application, just hit Ctrl+C and it will gracefully stop.

📖 Documentation

Detailed documentation is available, which explains how to configure whenever by manually editing its configuration file. However, the installation and the configuration via the When frontend are definitely easier, and the most useful resources are in this case the following:

Note that the documentation generally refers to the version of whenever currently in the main branch, that is, the latest stable version: it is usually published as a release as well, although sometimes the latest published release might still be some steps behind. Please check the version that the documentation refers to on the index page.

🐞 Bug Reporting

If there is a bug in the whenever application, please use the project issue tracker to report it.

⚖️ License

whenever is released under the terms of the LGPL v2.1.

Packages

 
 
 

Contributors

Languages