When - Plan task depending on various conditions on Linux Mint
All articles
Last comments
Will, 16-11-2014, 19:21
Didnt see when this post was originally made....but still works in Mint 'Sarah' in 2017
Jesús, for "libpackagekit" run: sudo apt-get install packagekit-backend-aptcc
Guest Michael
This is my favorite GUI text editor for Linux, I use the Windows version all the time too. I also covered this topic here.
I'm using Mint Cinnamone installed on virtual machine VMWare. The instruction helped me to adjust my mouse scroll wheel speed. I set the value to 6. Now it's comfortable to use the mouse. Thanks a lot!
«    January 2017    »
» » When - Plan task depending on various conditions

When - Plan task depending on various conditions

When - Plan task depending on various conditions

"When" (or "when-command") is a task scheduler, which allows you to perform different actions under different circumstances. You can force your desktop to perform various tasks depending on various conditions.

Sorry for the spelling and phonetic errors in the text.
Owner and main writer of MintGuide.org is not a native English speaker.

For example, you can synchronize files, perform some cleaning, import photos from external devices, and perform many other tasks (this requires adding the appropriate commands or scripts When), all this under such conditions, as the output from the console app, the timer, the changes to the file or folder and so on.

Even though for some tasks you will have to write your own scripts, thanks to When it is much easier to use them because you don't need to include all conditions that are supported When, in your scripts.

According to the developer, the app is not aimed at complete replacement of cron and task scheduler Gnome, although in some sense the capabilities of these tools may overlap.

The developer claims that When aimed at more flexibility, although in some ways less accurate, and provide an alternative to more complex solutionsfor example, implementation of cron tasks that check some condition and execute the corresponding commands if the condition is fulfilled.

When using, you can create tasks that are dependent on the following conditions:

  • Command: the exit code, standard output, standard error with options for an exact match, the register or account is not taken of the register and regular expressions
  • Specified date or time
  • Downtime session Event: startup, shutdown, sleep, resume, system, connection or disconnection of a storage device, connection, or out of the network, the start or exit of the screensaver, locking or unlocking the session, and trigger the command line (some conditions like lock and unlocking of the session and the events of the screensaver may not work on a Linux distribution different from Ubuntu because of the way they are defined)
  • The changes to the file or directory A user-defined event (dbusadvanced)

For each task you can define a command, the working folder, add environment variables and check the command on success or an error (or do not check anything and just run, ignoring the output). From application settings you can change the theme of icons of the system tray or indicator, a logging level, enable or disable alerts of a file or directory and much more:


When - Plan task depending on various conditionsWhen - Plan task depending on various conditions

Other possibilities include the option to suspend all tasks (it can be accessed from the system tray or menu of the indicator) and the window task history, which includes output codes for each executed at a given moment of the task and the result of the command.

To use the app, first you need to create a new task (from the system tray or menu of the indicator, select "Edit Tasks", enter the task name, command, and other information and click OK.

Then you will need to define a condition for the newly created task is to do this from the tray menu or indicator Edit Conditions, select, enter the name for your new condition type and other information and in Tasks select the task you created from the drop down menu.

Important: do not use spaces for the name of the task or conditions, as it will not work (the OK button becomes inactive, if the name contains spaces).
For more information about When and how to use it, see its page on GitHub, guidance for When, and more examples are available here.

Installation latest version into Linux Mint:

1. Download the latest version When in the form of deb package from Github and install it (two deb package).

When - Plan task depending on various conditionsWhen - Plan task depending on various conditions

2. To complete the installation When run in terminal the following command:

/opt/when-command/when-command --install

(without executing the following command not appears in the menu When option to autorun will not work and so on).

3. (optional) Install the "python3-pyinotify" to support alerts files and folders.

sudo apt-get install python3-pyinotify

Note that on some desktop environments (this happened to me when using Linux Mint Cinnamon) item When the menu may not be displayed until you restart the system.

To report any bugs you found on the application page on GitHub.

Good Luck!!!


Related Articles

Add a comment

  • bowtiesmilelaughingblushsmileyrelaxedsmirk
Login via
Name of our planet