Skip to main content

🔊 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
Hello!

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="https://releases.ubuntu.com/20.04.1/ubuntu-20.04.1-desktop-amd64.iso"
$ http "$URL" | pv | ding > /dev/null

This project uses play_sounds, a wrapper over playsound and boombox.

ding

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
Hello!

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

You can also specify it with a flag.

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

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
Hello!

Installation

Dependencies

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

Linux

  • 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

PyPI

$ python3 -m pip install onhold_ding

GitHub

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

Help

ding

$ ding --help
Usage: ding [OPTIONS]

  Play specified sound after job is complete.

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

License

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

Credit

Music

See CREDIT.md.

Metadata

Release files for onhold-ding 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onhold-ding 0.1.0
File Size Uploaded Provenance Actions
onhold-ding-0.1.0.tar.gz 3.4 kB Without provenance Details for onhold-ding-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for onhold-ding 0.1.0
File Interpreter ABI Platform Actions
onhold_ding-0.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for onhold_ding-0.1.0-py2.py3-none-any.whl

Total release size: 18.9 kB

Release files / onhold-ding-0.1.0.tar.gz

Download URL onhold-ding-0.1.0.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
587b55a043ddd2c550f8790bc9af7ca72e45e662d3ccbc5682f082263c405355
BLAKE2b-256 checksum
How to use checksums
e3631fdfde522c23ed238c5b9c51d2f0c0cb372f4844541afc81067c02770ba3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.6

Release files / onhold_ding-0.1.0-py2.py3-none-any.whl

Download URL onhold_ding-0.1.0-py2.py3-none-any.whl
Size 15.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
318594491feb6dc593c4f4aa5bd3504c060e9a4d9623671868ed6c7b5e472a8c
BLAKE2b-256 checksum
How to use checksums
226498acf588e4441530f0b3115624ddbd6b067ba9849eeb5db5e6427dc94887
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.6

Security for onhold-ding 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page