This question is similar, but different of How can I get an audio notification when a long running command has finished?.

I am looking for a command that can be used like

mayberunlongtime; bell

I vaguely remember a command working and used like this exist, without remembering the name.

There is an ASCII character for ringing the bell, but using '\a' printf for this would look somewhat non-obvious, or even opaque. And it did not work when I tried.

I use zsh in a KDE konsole.

  • Some terminals support notification on no console activity (no output). Does this replace what you're looking for? – argle Jun 2 '18 at 11:32
  • i found a previous posted question at this link: unix.stackexchange.com/questions/1974/… i hope it will be of some help. – D'Arcy Nader Jun 2 '18 at 11:35

The command line program mpg123 can be used to play an MP3 file from a script:

High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
    version 1.22.4; written and copyright by Michael Hipp and others
    free software (LGPL) without any warranty but with best wishes

usage: mpg123 [option(s)] [file(s) | URL(s) | -]
supported options [defaults in brackets]:
   -v    increase verbosity level       -q    quiet (don't print title)
   -t    testmode (no output)           -s    write to stdout
   -w f  write output as WAV file
   -k n  skip first n frames [0]        -n n  decode only n frames [all]
   -c    check range violations         -y    DISABLE resync on errors
   -b n  output buffer: n Kbytes [0]    -f n  change scalefactor [32768]
   -r n  set/force samplerate [auto]
   -o m  select output module           -a d  set audio device
   -2    downsample 1:2 (22 kHz)        -4    downsample 1:4 (11 kHz)
   -d n  play every n'th frame only     -h n  play every frame n times
   -0    decode channel 0 (left) only   -1    decode channel 1 (right) only
   -m    mix both channels (mono)       -p p  use HTTP proxy p [$HTTP_PROXY]
   -@ f  read filenames/URLs from f     -T get realtime priority
   -z    shuffle play (with wildcards)  -Z    random play
   -u a  HTTP authentication string     -E f  Equalizer, data from file
   -C    enable control keys            --no-gapless  not skip junk/padding in mp3s
   -?    this help                      --version  print name + version

You can use <command>; xkbbell -force. You may need to run modprobe pcspkr as root.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.