Registered Member
|
I'm a student and I can't pay a 24/7 energy bill.
If the pc would shut down after downloading this would be very appreciated. Additionally a feature like "do command x then y then z after download" would be cool, too... Like: 1. scan Folder for virus, 2. extract multi .rar file, 3. shut down pc... Is that possible? |
Moderator
|
|
Registered Member
|
|
Registered Member
|
this script can do that
|
Registered Member
|
|
Registered Member
|
|
Registered Member
|
I think this should work but need some testing
with "sleep" you can change time of checking torrents in seconds
sorry for my bad english |
Registered Member
|
Thank you, I will test the new script soon.
By the way, is there a way to shutdown like KDE does? If I shutdown in KDE and reboot after that, all my programms are restored. If I shutdown with shutdown -h or halt command KTorrent and the other programs are gone...? ... bad english is no problem for me, because I am no native speaker as well (as you might have noticed) |
Registered Member
|
dcop ksmserver default logout 0 -1 -1
First parameter: confirm Obey the user's confirmation setting: -1 Don't confirm, shutdown without asking: 0 Always confirm, ask even if the user turned it off: 1 Second parameter: type Select previous action or the default if it's the first time: -1 Only log out: 0 Log out and reboot the machine: 1 Log out and halt the machine: 2 Third parameter: mode Select previous mode or the default if it's the first time: -1 Schedule a shutdown (halt or reboot) for the time all active sessions have exited: 0 Shut down, if no sessions are active. Otherwise do nothing: 1 Force shutdown. Kill any possibly active sessions: 2 Pop up a dialog asking the user what to do if sessions are still active: 3
just replace 0 0 0 with options that you prefer |
Registered Member
|
Awesome! KDE shuts down like I hoped for.
I tried to edit the code the way I need it. As I have no idea of scripting, The code is pretty messed up. But it works! It now checks, if there are active downloads (it waits for active DLs so you can start it right along with Ktorrent, even if you have no downloads at the moment), if there are completed downloads (it doesnt shut down the pc if there are no completed downloads, because this always means the user has deleted the active torrents manually) and checks if the user doesnt want the script to turn off the computer. Because I got so much help on this forum I would like to thank you all and espacially dvanaise for his code and info and let you participate on my experiments. Therefore I attched the code so you can check it out and maybe have some fun with it.
|
Registered Member
|
|
Registered Member
|
yeah of course, i enhanced the script about an "extract and scan for virus" feature:
This is the extract script. If you do not need it, just remove the line with the path to the script:
Thats it. I am testing it for several days now and it seems to work very well. The extract script is a great time saver. But be sure to get the right antivir settings to delete any found virus, because you won't be there to decide what to do (hope I found the right command). The translation was made under light time pressure, please feel free to correct the mistakes and have some fun in using and testing it. cu soon |
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell