I want the beep to alert me so that sometimes I can nudge the mouse a bit just to keep the system running. (I've set the inactivity time to be very short).

How can this be done?

I'm using Lubuntu 16.04 to be exact.

1 Answer 1


First install beep package:

sudo apt install beep

Then load pcspkr module, by default pc speaker is not enable (module is not loaded):

sudo modprobe pcspkr

Now install xprintidle, it's a utility to print user's idle time.

Finally we need a command to check if idle time was bigger than of X, runs beep:

if [ `xprintidle` -ge 3000 ]; then beep; fi
  • 3000 means 3 second, e.g: if your system goes to sleep after 10 Minutes you should use something around "540000" (9 Min) so it is able to make a alert 1 Min before system goes to sleep.

After all create a line in /etc/crontab to run this command every minute:

* * * * *   username   if [ `xprintidle` -ge 540000 ]; then beep; fi

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .