colcon-notification
colcon-notification is an extension for the `colcon` meta build tool, primarily used within the Robot Operating System (ROS) ecosystem, to provide status notifications. It enables desktop notifications and updates a status line in the terminal title during `colcon` invocations like `build` or `test`. The current version is 0.3.1, and it maintains an active development and release cadence in line with the broader `colcon` and ROS projects.
Common errors
-
ERROR:Could not find the colcon-terminal-notifier.app in the install prefix '/usr/local
cause Mismatch in the application name (colcon_terminal_notifier.app vs colcon-terminal-notifier.app) for the macOS notification tool, typically on older versions or specific build setups.fixUpdate `colcon-notification` to a newer version (post-0.2.19) where this was resolved. If updating is not an option, manually verify and correct the application name in the install prefix or in the `terminal_notifier.py` file. -
Exception in desktop notification extension 'notify2':org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying.
cause The `notify2` backend (used for desktop notifications on Linux) failed to connect or send a message via the D-Bus message bus, often due to a misconfigured desktop environment or D-Bus service.fixCheck your desktop environment's D-Bus setup and notification service. If the issue persists, disable desktop notifications for `colcon` using `colcon <verb> --event-handlers desktop_notification-` or set `COLCON_EXTENSION_BLOCKLIST=colcon_core.event_handler.desktop_notification`. -
Unwanted or annoying desktop notifications pop up during colcon builds.
cause Desktop notifications are enabled by default through the `desktop_notification` event handler within colcon-notification.fixDisable them per invocation with `colcon <verb> --event-handlers desktop_notification-`. For a system-wide disable, set the environment variable `COLCON_EXTENSION_BLOCKLIST=colcon_core.event_handler.desktop_notification`.
Warnings
- breaking The environment variable to blacklist/block extensions was renamed from `COLCON_EXTENSION_BLACKLIST` to `COLCON_EXTENSION_BLOCKLIST`.
- gotcha Desktop notifications can be intrusive and are often enabled by default. Users frequently want to disable them.
- gotcha On some Linux desktop environments (e.g., Pop OS + Regolith), desktop notifications might fail with D-Bus related errors.
- gotcha On macOS, older versions had an issue with the `terminal-notifier.app` path due to a mismatch in naming conventions (underscore vs. dash).
Install
-
pip install colcon-notification
Imports
- Extension functionality
colcon build --event-handlers desktop_notification+
Quickstart
# This is not a Python import, but how to use the notification feature through colcon CLI. # To build a workspace and enable desktop notifications: mkdir -p ~/my_ros2_ws/src cd ~/my_ros2_ws # Populate src/ with colcon-compatible packages (e.g., ROS 2 examples) # git clone https://github.com/ros2/examples src/examples # Build with desktop notifications enabled colcon build --event-handlers desktop_notification+ # Or to only show a status line in the terminal title colcon build --event-handlers status+