Package: onhold
🔊 Play sounds while and after shell jobs completeonholdis a command-line utility that allows you to play music while a long job completes.dingis 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 intoonholdanddingwill be piped right back out.$echo"Hello!"|onhold
Hello!As a result, you can build pipelines withonholdandding.For example, you can download an ISO withhttp, visualize the progress withpv, play music withonholdwhile writing to/dev/null, and when it's finished, play a sound withding.$exportURL="https://releases.ubuntu.com/20.04.1/ubuntu-20.04.1-desktop-amd64.iso"$http"$URL"|pv|onhold|ding>/dev/nullThis project usesplay_sounds, a wrapper overplaysoundandboombox.onholdYou can either set the$ONHOLDenvironment variable to the song you'd like to play, or supply the song with the-sflag.$exportONHOLD="~/Music/song.mp3"$pv/dev/zero|onhold>/dev/nullThis allows you to set$ONHOLDin your~/.bashrc.You can also specify it with a flag.$pv/dev/zero|onhold-ssong.mp3>/dev/nullonholdcomes with a default song that will play if neither$ONHOLDor-sare set. You can use the-wflag to show warnings if$ONHOLDor-sare not set.$echo"Hello!"|onhold
Hello!dingYou can either set the$DINGenvironment variable to the sound you'd like to play, or supply the sound with the-sflag.# You can run ding after a command or as part of a pipeline$exportDING="~/Music/ding.mp3"$sleep5;ding
$echo"Hello!"|ding
Hello!This allows you to set$DINGin your~/.bashrc.You can also specify it with a flag.$echo"Hello!"|ding-sding.mp3
Hello!dingcomes with a default sound that will play if neither$DINGor-sare set. You can use the-wflag to show warnings if$DINGor-sare not set.$echo"Hello!"|ding
Hello!dingis its own package, tooYou can installdingby itself. Future versions ofonholdwill not ship withding.Click here to visitding's project page with installation instructions.InstallationDependenciesA Unix shell like Bash, or PowerShell or Command Prompt on WindowsPython 3.6+requirements.txtLinuxYou'll need to install GStreamer on Linux, or theplaybinary fromsox.UbuntuOn Ubuntu, you will need to installPyGObject,gstreamer1.0-python3-plugin-loaderandpython3-gst-1.0.$sudoaptinstallpython3-gigstreamer1.0-python3-plugin-loaderpython3-gst-1.0ArchOn Arch, you can installonholdoronhold-gitand its prerequisitesdirectly from the AUR. Thanks,@jfrcom!$yay-Sonhold# replace yay with your aur helperPyPI$python3-mpipinstallonholdGitHub$python3-mpipinstall-rrequirements.txt
$python3setup.pyinstallHelponhold$onhold--help
Usage:onhold[OPTIONS]Playthespecifiedsoundfilewhiledataispassedinthroughstandardinputandpassedthroughstandardoutput.

Options:-s,--sound_pathPATHPathtosoundtoplay.-b,--bellRingtheterminalbell,aswell.[default:False]-w,--warnShowwarnings.--helpShowthismessageandexit.ding$ding--help
Usage:ding[OPTIONS]Playspecifiedsoundafterjobiscomplete.

Options:-s,--sound_pathPATHPathtosoundtoplay.-b,--bellRingtheterminalbell,aswell.[default:False]-w,--warnShowwarnings.--helpShowthismessageandexit.LicenseSeeLICENSE. If you'd like to use this project with a different license, please get in touch.