Recently my Linux box at work got b0rked, so Ihad to move the hd from that box to what was my Windoze box. Previously I listened to music on the Windoze box, and did everything else on the Linux box. This meant that my Linux box could make all the noises for various apps that it wanted to. No such luck when it’s the same box that you are listening to music on. Until I could figure out how to get all the apps to share the soundcard with XMMS, I came up with a neat workaround that uses xosd. xosd includes something called osd_cat which will display any text you want via OSD, in any color you want, and in any location. I have Gaim setup to run a short bash script whenever I receive an IM (you can specify the ’sound’ program that you want to use — nobody said it had to be something like ‘play’). In the bottom left corner of my screen, I see "IM!" flash for a second, pause, then again. The flashing part is reqd so it will catch my eye. That script looks like this:
#!/bin/bash
# appears to blink
echo "IM"| osd_cat -p bottom -o -30 -f lucidasans-18 -c yellow -d 1
sleep 1
sudo aplay -Dplug:ossmix /usr/share/sounds/gaim/receive.wav
echo "IM"| osd_cat -p bottom -o -30 -f lucidasans-18 -c yellow -d 2
sleep 1
echo "IM"| osd_cat -p bottom -o -30 -f lucidasans-18 -c yellow -d 1
I’m using the built-in email check function of GKrellm, which lets you choose a script to run when you have new mail. That script looks like this:
#!/bin/bash
echo "* New mail *"|osd_cat -p bottom -o -20 -c green -d 2
sleep 1;
sudo aplay -Dplug:ossmix ~/sounds/email_hs.wav
echo "* New mail *"|osd_cat -p bottom -o -20 -c green -d 2
I should probably mention that I don’t use a sound server like Arts or ESD because they usually come along with Gnome/KDE and I dont use them. That’s why I had the problem (with ALSA to begin with; I didn’t want to add yet another unnecessary item (sound server) to my box. I finally found the solution to sharing the sound card here:
http://www.groupsrv.com/linux/viewtopic.php?t=7237
Also, I am running aplay with sudo because of some permission errors on /dev/dsp that I can’t seem to resolve…yes I’m too lazy to worry about it.
One other thing I use OSD for is a quick monthly calendar, using ‘cal’:
#!/bin/bash
cal | osd_cat -p bottom -o -10 -d 30 -l 8
The ’showcal’ script is assigned to a key combo in my $HOME/.fluxbox/keys file. Whenever I want the calendar, I just do Shift-Ctrl-C. It hangs out for a nice long 30 seconds, just long enough for me to locate what I need