Author Topic: shutdown program lxde  (Read 3273 times)

Offline pclxd3os

  • Sr. Member
  • ****
  • Posts: 362
shutdown program lxde
« on: July 29, 2010, 02:53:43 PM »
hello
possible automatic shutdown program?
It's for version lxde
thanks
LINUX  = FREE OS

Pentium II 350 Mhz - 128 Mb Ram Sdram - GC Intel I740 8 Mb - DD 4Gb

Offline Rudge

  • Hero Member
  • *****
  • Posts: 9690
  • I'm Just A Dog.
Re: shutdown program lxde
« Reply #1 on: July 29, 2010, 03:04:00 PM »
What time do you want it to shutdown?


EDIT: to automatically shutdown your PC at 08:00 pm ( 20:00),

Log on as ROOT and add this line to crontab. (if you need help editing crontab, that's a different issue)

0 20 * * * /sbin/shutdown -h now
« Last Edit: July 29, 2010, 03:07:55 PM by Rudge »


-If you wish to make an apple pie from scratch, you must first invent the universe-  Carl Sagan

Offline pclxd3os

  • Sr. Member
  • ****
  • Posts: 362
Re: shutdown program lxde
« Reply #2 on: July 30, 2010, 03:25:01 PM »
is to see a movie before bed
I want to schedule automatic shutdown when the movie ends

thanks
LINUX  = FREE OS

Pentium II 350 Mhz - 128 Mb Ram Sdram - GC Intel I740 8 Mb - DD 4Gb

Offline pclxd3os

  • Sr. Member
  • ****
  • Posts: 362
Re: shutdown program lxde
« Reply #3 on: July 30, 2010, 03:26:01 PM »
60 minutes, 120 minutes .....
LINUX  = FREE OS

Pentium II 350 Mhz - 128 Mb Ram Sdram - GC Intel I740 8 Mb - DD 4Gb

Offline Rudge

  • Hero Member
  • *****
  • Posts: 9690
  • I'm Just A Dog.
Re: shutdown program lxde
« Reply #4 on: July 30, 2010, 03:33:37 PM »
Adding something to cron is NOT what you want in this situation. Sorry.


-If you wish to make an apple pie from scratch, you must first invent the universe-  Carl Sagan

Offline AndrzejL

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 12799
  • RLU #490933
    • Wordpress On The Wardrobe...
Re: shutdown program lxde
« Reply #5 on: July 31, 2010, 06:49:48 AM »
Maybe running this command from console or creating .desktop file with this command will do it?

Code: [Select]
sleep 180&&poweroff
It should wait 3 hours and then turn off the computer. Click on the .desktop file or run it from console before running the movie. 3 hours later machine is off ;). I bet its bit later then ordinary 90 mins movie BUT if You are Lord of the Rings movie fan... It may not be enough as the longest LOTR is about 195 mins including subtitles ;).

I don't know... Try it ;).

Andy
« Last Edit: July 31, 2010, 07:15:47 AM by AndrzejL »

Offline AndrzejL

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 12799
  • RLU #490933
    • Wordpress On The Wardrobe...
Re: shutdown program lxde
« Reply #6 on: July 31, 2010, 07:08:52 AM »
Oh and since I am the SMPlayer forum member too I suggested a sleep option to be added to the SMPlayer in the future...

If You are interested: +1 it ;)

Cheers.

Andy
« Last Edit: July 31, 2010, 07:12:53 AM by AndrzejL »

Offline pclxd3os

  • Sr. Member
  • ****
  • Posts: 362
Re: shutdown program lxde
« Reply #7 on: August 01, 2010, 05:28:24 PM »
Maybe running this command from console or creating .desktop file with this command will do it?

Code: [Select]
sleep 180&&poweroff
It should wait 3 hours and then turn off the computer. Click on the .desktop file or run it from console before running the movie. 3 hours later machine is off ;). I bet its bit later then ordinary 90 mins movie BUT if You are Lord of the Rings movie fan... It may not be enough as the longest LOTR is about 195 mins including subtitles ;).

I don't know... Try it ;).

Andy
I like the lord of the rings but was seen many times  :D

makes the test tonight

Thank you very much friend
« Last Edit: August 01, 2010, 05:31:25 PM by pclxd3os »
LINUX  = FREE OS

Pentium II 350 Mhz - 128 Mb Ram Sdram - GC Intel I740 8 Mb - DD 4Gb

Offline AndrzejL

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 12799
  • RLU #490933
    • Wordpress On The Wardrobe...
Re: shutdown program lxde
« Reply #8 on: August 01, 2010, 05:31:10 PM »
Maybe running this command from console or creating .desktop file with this command will do it?

Code: [Select]
sleep 180&&poweroff
It should wait 3 hours and then turn off the computer. Click on the .desktop file or run it from console before running the movie. 3 hours later machine is off ;). I bet its bit later then ordinary 90 mins movie BUT if You are Lord of the Rings movie fan... It may not be enough as the longest LOTR is about 195 mins including subtitles ;).

I don't know... Try it ;).

Andy
I like the lord of the rings but they are already seen many times  :D

makes the test tonight

Thank you very much friend

Waiting for results :D! Cheers friend :)

Andy

Offline AndrzejL

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 12799
  • RLU #490933
    • Wordpress On The Wardrobe...
Re: shutdown program lxde
« Reply #9 on: August 01, 2010, 05:37:10 PM »
OUCH... I messed up! 120 is in seconds LOLLLLLLLLLLLLLLLLLL!

It should be

Code: [Select]
sleep 7200&&poweroff
60 minutes times 60 seconds times 2 (hours)... = 7200... not 120 :D!

:P I hope it will be short movie :D!

Sorry Dude ;) my bad :D!

Andy
« Last Edit: August 01, 2010, 05:39:59 PM by AndrzejL »

Offline pclxd3os

  • Sr. Member
  • ****
  • Posts: 362
Re: shutdown program lxde
« Reply #10 on: August 01, 2010, 05:40:01 PM »
Oh and since I am the SMPlayer forum member too I suggested a sleep option to be added to the SMPlayer in the future...

If You are interested: +1 it ;)

Cheers.

Andy


very interesting
I join the cause  ;)

thank you very much friend
LINUX  = FREE OS

Pentium II 350 Mhz - 128 Mb Ram Sdram - GC Intel I740 8 Mb - DD 4Gb

Offline AndrzejL

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 12799
  • RLU #490933
    • Wordpress On The Wardrobe...
Re: shutdown program lxde
« Reply #11 on: August 01, 2010, 05:45:19 PM »
Oh and since I am the SMPlayer forum member too I suggested a sleep option to be added to the SMPlayer in the future...

If You are interested: +1 it ;)

Cheers.

Andy

very interesting
I join the cause  ;)

thank you very much friend

I am not sure will the smplayer devs be able to add this code. I was speaking to one of them on IRC and he told me that its not likely to happen.

Anyway we will see.

Check the post above for corrected timing otherwise Your laptop will turn off after 2 minutes not 2 hours :D!

Andy
« Last Edit: August 01, 2010, 05:47:33 PM by AndrzejL »

Offline pclxd3os

  • Sr. Member
  • ****
  • Posts: 362
Re: shutdown program lxde
« Reply #12 on: August 01, 2010, 05:51:09 PM »
OUCH... I messed up! 120 is in seconds LOLLLLLLLLLLLLLLLLLL!

It should be

Code: [Select]
sleep 7200&&poweroff
60 minutes times 60 seconds times 2 (hours)... = 7200... not 120 :D!

:P I hope it will be short movie :D!

Sorry Dude ;) my bad :D!


 
Andy

If i just put 60 seconds only see the credits  :D


thank you very much ,this will take into consideration
LINUX  = FREE OS

Pentium II 350 Mhz - 128 Mb Ram Sdram - GC Intel I740 8 Mb - DD 4Gb

Offline pclxd3os

  • Sr. Member
  • ****
  • Posts: 362
Re: shutdown program lxde
« Reply #13 on: August 01, 2010, 05:56:06 PM »
Oh and since I am the SMPlayer forum member too I suggested a sleep option to be added to the SMPlayer in the future...

If You are interested: +1 it ;)

Cheers.

Andy

very interesting
I join the cause  ;)

thank you very much friend

I am not sure will the smplayer devs be able to add this code. I was speaking to one of them on IRC and he told me that its not likely to happen.

Anyway we will see.

Check the post above for corrected timing otherwise Your laptop will turn off after 2 minutes not 2 hours :D!

Andy



That bad news I hope the developers can make

It's a good idea  :)
LINUX  = FREE OS

Pentium II 350 Mhz - 128 Mb Ram Sdram - GC Intel I740 8 Mb - DD 4Gb

Online daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3737
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: shutdown program lxde
« Reply #14 on: August 02, 2010, 12:46:00 PM »
a little question...
What is need for automic shutdown program?
Maybe two scripts...
First script for shutdown
Code: [Select]
#!/bin/bash

dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Shutdown

Second script
A script where can add the minutes to wait before shutdown the computer...

When it's needed, i can create a little app for it...


EDIT:
Done...
Tester can download it here
http://dl.dropbox.com/u/2077694/sleeptimer-0.01-1pclos2010.i586.rpm

Install it, and you find the app under Start>More Applications>Monitoring>sleeptimer

Any suggestion write here, thanks...
« Last Edit: August 02, 2010, 01:40:22 PM by Leiche »