All Projects → alexdelorenzo → Onhold

alexdelorenzo / Onhold

Licence: agpl-3.0
🔊 Play sounds while and after shell jobs complete

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects
python3
1442 projects
bash
514 projects

Projects that are alternatives of or similar to Onhold

Ttyplot
a realtime plotting utility for terminal/console with data input from stdin
Stars: ✭ 532 (+264.38%)
Mutual labels:  command-line-tool, pipe, pipeline
Hmap
hmap is a command line tool written in Swift to work with Clang header maps produced by Xcode.
Stars: ✭ 110 (-24.66%)
Mutual labels:  command-line-tool, command-line
Artisan Menu
📝 Artisan Menu - Use Artisan via an elegant console GUI
Stars: ✭ 141 (-3.42%)
Mutual labels:  command-line-tool, command-line
Desktoppr
Simple command line tool to set the desktop picture on macOS
Stars: ✭ 127 (-13.01%)
Mutual labels:  command-line-tool, command-line
Ask Cli
Alexa Skills Kit Command Line Interface
Stars: ✭ 100 (-31.51%)
Mutual labels:  command-line-tool, command-line
Csv2db
The CSV to database command line loader
Stars: ✭ 102 (-30.14%)
Mutual labels:  command-line-tool, command-line
Typin
Declarative framework for interactive CLI applications
Stars: ✭ 126 (-13.7%)
Mutual labels:  command-line-tool, command-line
Forge Node App
🛠📦🎉 Generate Node.js boilerplate with optional libraries & tools
Stars: ✭ 90 (-38.36%)
Mutual labels:  command-line-tool, command-line
Asciigraph
Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.
Stars: ✭ 1,805 (+1136.3%)
Mutual labels:  command-line, command-line-tool
Git Tidy
Tidy up stale git branches.
Stars: ✭ 137 (-6.16%)
Mutual labels:  command-line-tool, command-line
Brotab
Control your browser's tabs from the command line
Stars: ✭ 137 (-6.16%)
Mutual labels:  command-line-tool, command-line
Tooling
Advancing Node.js as a framework for writing great tools
Stars: ✭ 98 (-32.88%)
Mutual labels:  command-line-tool, command-line
Terminal layout
The project help you to quickly build layouts in terminal,cross-platform(一个跨平台的命令行ui布局工具)
Stars: ✭ 98 (-32.88%)
Mutual labels:  command-line-tool, command-line
Awesome Cli
A curated list of awesome resources for building immersive CLI experiences.
Stars: ✭ 104 (-28.77%)
Mutual labels:  command-line-tool, command-line
Gocd Slack Build Notifier
GoCD (gocd.org) plugin to push build notifications to Slack
Stars: ✭ 96 (-34.25%)
Mutual labels:  pipeline, notifications
Dynein
DynamoDB CLI written in Rust.
Stars: ✭ 126 (-13.7%)
Mutual labels:  command-line-tool, command-line
Gossed
Push the standard output of ANY program to browsers as Server Sent Events
Stars: ✭ 138 (-5.48%)
Mutual labels:  command-line-tool, command-line
Pypistats
Command-line interface to PyPI Stats API to get download stats for Python packages
Stars: ✭ 86 (-41.1%)
Mutual labels:  command-line-tool, command-line
Certificaat
General-purpose ACME client
Stars: ✭ 88 (-39.73%)
Mutual labels:  command-line-tool, command-line
Check It Out
A command line interface for Git Checkout. See branches available for checkout.
Stars: ✭ 127 (-13.01%)
Mutual labels:  command-line-tool, command-line

🔊 Play sounds while and after shell jobs complete

onhold is a command-line utility that allows you to play music while a long job completes.

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

Both utilities will take data that is piped into their standard inputs and pipe it to standard output. That is to say that data piped into onhold and ding will be piped right back out.

$ echo "Hello!" | onhold
Hello!

As a result, you can build pipelines with onhold and ding.

For example, you can download an ISO with http, visualize the progress with pv, play music with onhold while writing to /dev/null, 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 | onhold | ding > /dev/null

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

onhold

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

$ export ONHOLD="~/Music/song.mp3"
$ pv /dev/zero | onhold > /dev/null

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

You can also specify it with a flag.

$ pv /dev/zero | onhold -s song.mp3 > /dev/null

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

$ echo "Hello!" | onhold
Hello!

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.mp3"
$ 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.mp3
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!

ding is its own package, too

You can install ding by itself. Future versions of onhold will not ship with ding. Click here to visit ding's project page with installation instructions.

Installation

Dependencies

  • A Unix shell like Bash, or PowerShell or Command Prompt on Windows
  • Python 3.6+
  • requirements.txt

Linux

You'll need to install GStreamer on Linux, or the play binary from sox.

Ubuntu

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

Arch

On Arch, you can install onhold or onhold-git and its prerequisites directly from the AUR. Thanks, @jfrcom!

$ yay -S onhold # replace yay with your aur helper

PyPI

$ python3 -m pip install onhold

GitHub

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

Help

onhold

$ onhold --help
Usage: onhold [OPTIONS]

  Play the specified sound file while data is passed in through standard
  input and passed through standard output.

Options:
  -s, --sound_path PATH  Path to sound to play.
  -b, --bell             Ring the terminal bell, as well.  [default: False]
  -w, --warn             Show warnings.
  --help                 Show this message and exit.

ding

$ ding --help
Usage: ding [OPTIONS]

  Play specified sound after job is complete.

Options:
  -s, --sound_path PATH  Path to sound to play.
  -b, --bell             Ring the terminal bell, as well.  [default: False]
  -w, --warn             Show warnings.
  --help                 Show this message and exit.

Support

Want to support this project and other open-source projects like it?

Buy Me A Coffee

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].