Skip to content

A lightweight Zsh plugin that plays notification sounds when a long-running shell command completes.

License

Notifications You must be signed in to change notification settings

jessetipton/ding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ding

ding is a lightweight Zsh plugin that plays notification sounds when a long-running shell command completes.

Requirements

  • macOS
  • Zsh 5.4+

Installation

Clone this repository somewhere on your machine, then source the plugin from your .zshrc:

git clone https://github.com/jessetipton/ding.git ~/.zsh/ding
source ~/.zsh/ding/ding.plugin.zsh

Using a plugin manager:

  • Oh My Zsh: add ding as a custom plugin that sources the ding.plugin.zsh file.
  • Antidote / Znap / Zgenom / etc.: treat this repo as any other plugin by referencing its git URL.

Configuration

All configuration is done through environment variables that can be set before sourcing the plugin (or anytime in your .zshrc before the hook runs):

Variable Default Description
DING_MIN_DURATION 5 Minimum command runtime (in seconds) required before a sound plays.
DING_SUCCESS_SOUND Glass Name of the system sound (/System/Library/Sounds/<name>.aiff) to use for successful commands.
DING_FAILURE_SOUND Basso Name of the system sound to play when the command exits with a non-zero status.

Example configuration:

export DING_MIN_DURATION=3
export DING_SUCCESS_SOUND=Hero
export DING_FAILURE_SOUND=Sosumi

You can run ls /System/Library/Sounds to see the available sound names.

About

A lightweight Zsh plugin that plays notification sounds when a long-running shell command completes.

Topics

Resources

License

Stars

Watchers

Forks

Languages