theogf / Ding.jl

Make some sounds after an expression has been evaluated in the REPL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ding

Stable Dev Build Status Coverage Code Style: Blue ColPrac: Contributor's Guide on Collaborative Practices for Community Packages

Sounds alerts when long-duration commands are run on the REPL

Macros

There are for now three exported macros: @ding, @ohno and @elevator:

  • @ding ex will play a random bell sound at the end of the execution of ex.
  • @elevator ex will play a random elevator music while ex is running.
  • @ohno ex will play an error sound if the ex process is failing

Examples

@ding sleep(3)
@elevator sleep(10)
@ohno sqrt(-1)

REPL integration

To avoid having to write these macros everywhere, there are two functions to directly integrate the sounds to your workflow: ding_repl(activate=true) ohno_repl and elevator_repl(activate=true). If the execution in the REPL takes more than a (configurable) time, a ding will play at the end and an elevator music will play during the execution respectively.

Configuration

Although meager, the different options such as the minimum running time for the sound trigger and the refresh rate can be configured in a Ding.toml file present in the current working folder.

Details

All sounds will be downloaded in the first execution of using Ding. These files are royalty free and come from the sound bank pixabay.com. The sounds are played using FFplay which is a library of FFmpeg.

List of CLI music players

TODO

  • Allow to add new music files -> Source for many open-source sound files
  • Allow to play another song when process finishes
  • Introduce fading between songs
  • Add "failure" sound, when execution returns an error
  • Ensure order of sound playing (elevator -> ding)
  • Search for config file in more different paths.
  • Add more options such as
    • Exclude/Include list of sounds
    • Sound level

About

Make some sounds after an expression has been evaluated in the REPL

License:MIT License


Languages

Language:Julia 100.0%