I have this script to prevent screen blanking when the CPU usage is > 8% :
Code:
#!/usr/bin/env bash
sleep_period=8m
while true; do
if ps -eo %C --sort -%cpu | head -2 | awk 'NR==2 { exit !($1>8); }'; then
xdotool key Shift
fi
sleep ${sleep_period}
done
Can I have a sound play whenever xdotool key Shift is executed? I'm thinking of something like
Code:
mplayer --really-quiet /usr/share/sounds/freedesktop/stereo/bell.oga
My system is Lubuntu 13.04. It doesn't have Pulseaudio as far as I can tell and so paplay is not an option. I have alsa-utils but aplay gives a horrible sound, like white noise.
Edit: I'm reading a bit about Pulseaudio v/s alsa and some people feel that alsa can't handle two programs playing sound at the same time. So, I'm wondering whether my question is valid and if it is, whether alsa can do what I want when I watching a video, the most typical situation when I don't want to screen to blank.
Bookmarks