0

I am running Xubuntu 13.04, I got in the habbit of closing my Acer Netbook and forgetting about it for a week+. I open it up to find it has still been running. How do I set it to shutdown after 15 minutes of inactivity? I don't want to set it to lid close because I often get up and close the lid so kids don't get at it. Also, due to the sometimes long stretches I go without touching it, I would like to make sure it is completely shutdown.

I'm sure I'm just missing some little check box. I've never had a setup that didn't shut itself down, or wasn't able to with a few click.

I already Googled the question for a bit and wasn't able to get the keywords right to get a relevant answer.

user193857
  • 1
  • 1
  • 1

1 Answers1

1

Install xprintidle. This tool gives the idle time of a user.

sudo apt-get install xprintidle

Make a script autoshutdown.sh which checks for the idle time and instructs the computer to shutdown if idle for 30 minutes.

idle=$(xprintidle)
if [ $idle -gt 1800000 ]; then
    shutdown -h now
fi

Make a cronjob for this that checks from time to time if the system has been idle for too long and if it has been idle for a longer than 30 minutes it will shutdown. Note that the cronjob has to be made for the root user.

muru
  • 207,228