Skip to content

criscanedo/uhm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

u have mail
===========

uhm is a tiny C daemon, written in 50 lines of code, that plays an audio file
whenever new mail arrives to a user's system mailbox.

By default uhm uses OpenBSD's aucat(1) utility to playback the specified audio
file whenever the specified user's system mailbox grows in size. Realistically,
any file can be watched for growth it doesn't have to be a mailbox.

Configuration
-------------

uhm does not process any options or arguments so as to encourage the new
programmer to hack the program themselves to specify which mailbox to watch,
which audio file to play, and even which audio utility to use. This can all be
changed in a few keystrokes. The ambitious newbie programmer may even take this
opportunity to implement use of getopt(3).

Regardless, a patch has been provided alongside the source to obtain this
functionality, namely options to specify a mailbox, audio file, and the
interval, in milliseconds, at which uhm checks the mailbox for new mail. The
default interval is 1/10 of a second (100 ms).

The patch was generated using git-format-patch(1) and can therefore be applied
with git-am(1):

    $ git am getopt.diff

Install
-------

git:

    $ git clone https://git.sr.ht/~hackexe/uhm
    $ cd uhm
    $ make
    # make install

tarball:

    $ curl -O gopher://satorii.org/9/src/uhm.tar.gz
    $ tar -xzvf uhm.tar.gz
    $ cd tar
    $ make
    # make install

Run
---

    $ uhm

It's best to launch this automatically at boot time from a Unix rc.d(8) script.
An example OpenBSD rc.d(8) script has been provided.

You can sample uhm's true and original sound by retreiving the audio file from
satorii.org's gopherhole:

    $ sacc satorii.org/9/audio/mail.wav >mail.wav
    $ curl gopher://satorii.org/9/audio/mail.wav >mail.wav
    $ echo "/audio/mail.wav" | nc satorii.org 70 >mail.wav