LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-26-2012, 06:32 AM   #1
werner291
Member
 
Registered: Feb 2012
Distribution: Debian (Ans soon Ubuntu and Android)
Posts: 48

Rep: Reputation: Disabled
Auto-shutdown when idle? (Debian)


Hello, I often forget to turn my computer off. Is it possible to make my it automatically turn itself off after some time?

I'm using Debian Linux and the GNOME desktop program.
 
Old 02-26-2012, 07:04 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
Yes it is.... You just need to write a very small shell script with the poweroff command, and use cron to execute it. For a good guide, have a look here - http://www.linuxhelp.net/guides/cron/
For your script, it would just be as simple as the following:
Code:
#!/bin/bash
poweroff
You will just need to "chmod +x FILENAME" where FILENAME is the name of your script.

Cheers,

Josh
 
Old 02-26-2012, 08:03 AM   #3
werner291
Member
 
Registered: Feb 2012
Distribution: Debian (Ans soon Ubuntu and Android)
Posts: 48

Original Poster
Rep: Reputation: Disabled
Actually, I mean to have the computer turn itself off whenever it isn't used for more than X minutes. Can Cron also do that?
 
Old 02-28-2012, 05:56 AM   #4
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
Oh, I see what you mean. You can configure your screensaver to run a command when it activates the screensaver, so to speak.
 
Old 02-28-2012, 06:07 AM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
Or simply use the power-manager of Gnome for that, it is perfectly able to do that.
 
Old 02-28-2012, 06:30 AM   #6
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
Quote:
Originally Posted by TobiSGD View Post
Or simply use the power-manager of Gnome for that, it is perfectly able to do that.
Yes, the power manager. I meant to say that.... Still waking up, leave me alone lol...
 
Old 02-28-2012, 11:47 AM   #7
werner291
Member
 
Registered: Feb 2012
Distribution: Debian (Ans soon Ubuntu and Android)
Posts: 48

Original Poster
Rep: Reputation: Disabled
I have found the power manager, and I found the options to auto-activate sleep and to turn the screen off, but not an option to turn the computer off completely.
 
Old 02-28-2012, 03:34 PM   #8
SecretCode
Member
 
Registered: Apr 2011
Location: UK
Distribution: Kubuntu 11.10
Posts: 562

Rep: Reputation: 102Reputation: 102
Some things are configurable in GNOME but not via the GUI. Have a look in gconf / Configuration Editor. Unfortunately I can't look myself for what keys to check under as I'm running KDE - which supports sleep, hibernate or shutdown after an idle period directly from the power profiles settings.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic System Shutdown (On Idle) Megatog615 Linux - Laptop and Netbook 3 08-15-2013 05:31 PM
Tweaking the idle/shutdown timeout valunthar Linux - Server 0 01-29-2012 05:18 PM
Shutdown The Linux PC when idle for a time being vikki Linux - Desktop 1 08-25-2009 04:41 AM
Auto log off idle users? uid0sd Linux - Software 2 03-20-2007 04:31 PM
auto-completion in idle/idlefork? Guest1234 Programming 1 08-28-2005 05:13 PM


All times are GMT -5. The time now is 06:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration