---
# System prepended metadata

title: PDI-1210

---

To use notification hooks in Sxmo, you need to create a shell script that performs the desired action and it is usually placed in the `/usr/share/sxmo/hooks` directory [1]. The script should be named after the application that generates the notification, with the `.hook` extension. For example, to create a hook for the `signal-desktop` application, you would create a script named `signal-desktop.hook` in the `/usr/share/sxmo/hooks` directory [1].

Here's an example of a simple notification hook script that displays a notification on the screen using the `dunst` notification daemon:
```sh
#!/bin/sh
# Display a notification on the screen
dunstify -u low -a "$2" "$1"
```
This is a simple shell script designed to display notifications on a Linux desktop environment using the `dunstify` command. This script takes two arguments: the first argument is the notification message, and the second argument is the name of the application that generated the notification.

The `dunstify` command is used to create the notification. It accepts various options, and in this script, it is configured to set the notification urgency level to "low" using the -u low option.

The `-a "$2"` option is used to set the application name for the notification. The application name is dynamic and is determined by the second argument passed to the script ($2). This allows you to associate the notification with a specific application.

Finally, the content of the notification is specified as "$1", where the message text is enclosed in double quotes to ensure that it is treated as a single argument, even if it contains spaces or special characters.

Once you have created a notification hook script, you need to make sure that it is executable by running the following command:
```sh
chmod +x /usr/share/sxmo/hooks/<app-name>.hook
```
Replace `<app-name>` with the name of the application that the hook is for [1].

Note that notification hooks are only executed if the `sxmo_notifications` script is running. You can start the script by running the following command:
```sh
sxmo_notifications &
```
This command starts the `sxmo_notifications` script in the background [1].