Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

🔊 Play music after jobs complete

Project description

🔊 Play sounds after shell jobs complete

ding is command-line utility that will play a sound after a long job completes.

The utility will take data that is piped into its standard inputs and pipe it to standard output. That is to say that data piped into ding will be piped right back out.

$ echo "Hello!" | ding

As a result, you can build pipelines with ding.

For example, you can download an ISO with http, visualize the progress with pv, and when it's finished, play a sound with ding.

$ export URL=""
$ http "$URL" | pv | ding > /dev/null


You can either set the $DING environment variable to the sound you'd like to play, or supply the sound with the -s flag.

# You can run ding after a command or as part of a pipeline
$ export DING="~/Music/ding.ogg"
$ sleep 5; ding
$ echo "Hello!" | ding

This allows you to set $DING in your ~/.bashrc.

You can also specify it with a flag.

$ echo "Hello!" | ding -s ding.ogg

ding comes with a default sound that will play if neither $DING or -s are set. You can use the -w flag to show warnings if $DING or -s are not set.

$ echo "Hello!" | ding



  • A Unix shell like Bash
  • Python 3.8+
  • requirements.txt


This project uses the assignment expression feature that was introduced in Python 3.8. Read below if you'd like to use this project in an older version of Python.

Older Python Versions

Use this project's Python 3.6 branch named python3.6, which was tested on Python 3.6. It might work on older versions, too.


  • GStreamer

On Ubuntu, you will need to install PyGObject, gstreamer1.0-python3-plugin-loader and python3-gst-1.0.

sudo apt install python3-gi gstreamer1.0-python3-plugin-loader python3-gst-1.0


$ python3 -m pip install ding


$ python3 -m pip install -r requirements.txt
$ python3 install



$ ding --help
Usage: ding [OPTIONS]

  Play specified sound after job is complete.

  -s, --sound_path PATH  Path to sound to play.
  -i, --ignore           Suppress warnings.
  --help                 Show this message and exit.


See LICENSE. If you'd like to use this project with a different license, please get in touch.




Project details

Download files

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

Files for onhold-ding, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size onhold_ding-0.0.1-py2.py3-none-any.whl (15.3 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size onhold-ding-0.0.1.tar.gz (3.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page