fortune cookie with internal pc speaker

If you have the programmes strfile, fortune and beep, you can have fortune cookies with music coming out of your pc speaker!

Here is how it goes.

1) Create a file, say MyMusicCookies, with some beep melodies, separated by %, see for example one previous post here.

2) run
strfile MyMusicCookies MyMusicCookies.dat

3) enjoy a random music piece with
fortune MyMusicCookies | bash

You can also make a mixed file with text and beep music and let yourself be surprised!

Have fun!

UPDATE: And if you use Arch Linux, then you can activate your fortune-music player on boot by writing a file as

/etc/systemd/system/boot-music.service

with a content like


[Unit]
Description=Set boot music

[Service]
Type=oneshot
RemainAfterExit=no
ExecStart=/usr/bin/fortune /directory/to/MyMusicCookies | /bin/bash

[Install]
WantedBy=multi-user.target

and activating it with

systemctl enable boot-music

😉

Leave a Reply

Your email address will not be published. Required fields are marked *