Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Script to show notification for a block device with mount action

Project Description


![GPL v3.0](

This is a script that displays a notification for a drive with a button to mount it.

It might be wise to call the script from a listeners that fires every time a new block device is detected (see [examples](#examples)).

Table of Contents

* [notification-mount](#notification-mount)
* [Table of Contents](#table-of-contents)
* [Installation](#installation)
* [Requirements](#requirements)
* [Non-Arch Systems](#non-arch-systems)
* [Arch Linux](#arch-linux)
* [Examples](#examples)
* [Devmon Script](#devmon-script)
* [Systemd Unit](#systemd-unit)


## Requirements
* Linux
* python3
* [python-gobject](
* [python-notify2](
* [udevil][udevil]

## Non-Arch Systems

If you are not using **Arch**, then you will need to copy or symlink the `notification-mount` file to somewhere that is in your `PATH` (see below in the systemd example for more info on wĥat you need to pay attention to when placing it somewhere in the `PATH`).

For how to install and start the system service see the [example](#systemd-unit) below.

## Arch Linux
If you are using **Arch Linux** either install [notification-mount][notification-mount] or [notification-mount-git][notification-mount-git] from the AUR.
You should now also have a user systemd service which you can enable and start like this:
systemctl --user enable notification-mount.service
systemctl --user start notification-mount.service
This service is the same as the one in the example below.


## Devmon Script
If you have [udevil][udevil] installed, you can run the following script and it will show a notification whenever a new device is detected:

devmon --no-mount --no-unmount --exec-on-drive "./notification-mount -d %f" &
You could at this to your `.xinitrc` or any other script that runs whenever your system starts up.

You may need to change the path to the script depending on where you run this piece of code from.
## Systemd Unit
Systemd service using the previous example and [udevil][udevil]:
Description=Notification when new block device is detected with button to mount

ExecStart=/usr/bin/devmon --no-mount --no-unmount --exec-on-drive "notification-mount -d %%f"

Fot this you will need to have the `notification-mount` in a folder that is part of the `PATH`

**Note:** This should be the default `PATH`. Alternatively you can set your modified `PATH` on the systemd environment like described [here](

After that just enable and start the service:
systemctl --user enable notification-mount.service
systemctl --user start notification-mount.service


Release History

This version
History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(15.8 kB) Copy SHA256 Hash SHA256
Source None Sep 12, 2016

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers