Saturday, 8 June 2013

Script acting strange in bash_profile (but just under X)

Script acting strange in bash_profile (but just under X)

I have made a simple .sh script which checks every minute whether a particular file is empty or not, and if it is not empty, makes a led on my laptop blink at 0.5Hz. I call this script from my .bash_profile.
Whenever I am in TTY, the thing works flawlessly (to say: when the file is not empty the led on my lappy blinks at that precise frequency).
But when I run X (I use Xmonad/urxvt, invoked via startx if that could help) something strange happens. The frequency of the blink is erratic, it slows down (a bit) the machine and when I call top I see various sudo processes (the one I call to turn the led on or off).
It is the same behavior as if I called the script three or four times.
I don't know how to diagnose the problem. The manual says .bash_profile gets read once (at login time). Can you help me out?

No comments:

Post a Comment