Installation
The easiest way to install When is using pipx: this works both on Windows and Linux, at least in the tested distributions. Installation on Linux is somewhat more complicated due to the need of fulfilling the requirements before successfully running the application. On Windows the requirements are easier to deal with, in the sense that only Python and pipx need to be installed.
Requirements:
Python in a recent release (at least version 3.11)
Note that even though a recent release of whenever is required for When to work as intended, When itself can be used to properly install and configure the core scheduler as described below.
Windows
These steps can be followed on both Windows 10 and Windows 11:
install Python using one of the official installation methods
install pipx by issuing the command
py -m pip install --user pipx
in a console window: after installation launchpipx ensurepath
from the command promptinstall the latest release of When, using pipx:
pipx install https://github.com/almostearthling/when-command/releases/latest/download/when-command-latest.zip
close the current console window, and open a new one: this is to ensure that the updated
PATH
environemnt variable is activeinstall whenever using the When installation tool:
when tool --install-whenever
launch the configuration utility, by typing
when config
on the command line: create a task and a condition of your choice, and save the configuration file by clicking the Save button. The simple trace example in the tutorial can be a good choice to verify that everything works as expected.
Once a configuration is available, the resident application can be started from the command line using the when start
command. A shortcut can be created as described below. On Windows, the when-bg
command can be used instead of when
to launch the application detached from a console window.
Linux
These steps can be followed on recent Linux distributions that derive from Debian, using a terminal:
install, as root or via sudo, the common requirements:
sudo apt install build-essential libdbus-1-dev pkg-config \ libx11-dev libxss-dev libglib2.0-dev libdbus-1-dev \ python3-tk python3-pip pipx
on Debian, install the Gnome Shell Extension Manager (which will appear in the activities dashboard as Extension Manager):
sudo apt install gnome-shell-extension-manager
while on Ubuntu and derivatives, the AppIndicator support libraries are needed:
sudo apt install libcairo2-dev libgirepository-2.0-dev gir1.2-ayatanaappindicator3-0.1
(the gir1.2-ayatanaappindicator3-0.1 might be already present on the system)
launch
pipx ensurepath
from the terminal: it should be done as the current user and not as rooton Debian, start the Gnome shell extension manager, choose the Browse tab, scroll down to AppIndicator and KStatusNotifierItem Support (you can use the search bar to find the entry) and install it
install the latest release of When, using pipx:
pipx install https://github.com/almostearthling/when-command/releases/latest/download/when-command-latest.zip
close the current console window, and open a new one: this is to ensure that the updated
PATH
environemnt variable is activeinstall whenever using the When installation tool:
when tool --install-whenever
launch the configuration utility, by typing
when config
on the command line: create a task and a condition of your choice, and save the configuration file by clicking the Save button. The simple trace example in the tutorial can be a good choice to verify that everything works as expected.
Once a configuration is available, the resident application can be started from the command line using the when start
command. A shortcut can be created as described below. The when-bg
command also exists on Linux, but its behavior is absolutely identical to when
.
On non-Debian-based distributions, the package manager and the package names in steps 1 and 2 will be different, while everything else should work exactly as described above.
Note: in case the appearance of When is quirky, for example the text elements in the interface are unreadable, you might need to start the desktop environment in an X.org session instead of Wayland that is the default on many Linux distributions:
Older editions of Wayland have incomplete support for the GUI library used by When, which on the other side is the one that ships with Python by default.
Create Application Icons
The --create-icons
subcommand can be used to create icons in the Start or Applications menu, and on the user desktop. In particular, the following subcommand:
when tool --create-icons --autostart
will create the appropriate icons in the menu and create a shortcut that launches When and activates the whenever scheduler each time the desktop session is started.
Upgrade
The upgrade process is quite easy with this type of setup, and it just consists in the following command, issued from a terminal or command window (depending on the host operating system):
pipx upgrade when
and there is no need to recreate the program icons, as the existing ones will continue to work. It might be necessary to stop When during the upgrade process. To upgrade whenever it is sufficient to repeat its installation step, that is:
when tool --install-whenever
which will always download and install the most recent binary release.
Installation Scope
Both the installation of When using the pipx method and the installation of whenever using the --install-whenever
tool are performed at the user level: neither one requires other privileges than write in the home directory. However, this also means that no other user, except the one performing the above defined actions, will be able to access either When or whenever.