Program to resume all your transmission torrent downloads when your computer is idle and pauses when it's active!



Hai, Recently I changed my broadband plan to unlimited. The new plan is much slower than the old one and I can't browse pages smoothly when my torrents are active. So I have to pause all downloads when I'm using my computer and resume before I go somewhere. The problem is, most of the times I forgot to do this; At last I decided to write a program to automate it :)

You must enable your screensaver before running this program and turn on the web client of transmission torrent [ edit > preferences > web ]
# This program automatically resumes your transmission torrent downloads 
# when your computer is idle and pause when its active.
# ( you must enable your screensaver and turn on webclient of transmission torrent )
# [ Author : Sreekumar ]
#
#
import gobject
import dbus
import os
from dbus.mainloop.glib import DBusGMainLoop

DBusGMainLoop(set_as_default = True)
session_bus = dbus.SessionBus()

def stateChanged(state):
#state : represents wheather the screensaver is avtive or not
if state == 1:
print "Resuming Downloads..."
#resumes all transmissions
os.system("transmission-remote --torrent all --start")
else:
print "Downloads Paused!"
#pause all transmisssions
os.system("transmission-remote --torrent all --stop")

session_bus.add_signal_receiver(stateChanged,"ActiveChanged","org.gnome.ScreenSaver")

#this is to check for new events from each of the event sources and dispatch them
mainloop = gobject.MainLoop()
mainloop.run()





Hope you like it :)

1 comment:

  1. i am a successful business owner and father. I got one of these already programmed blank ATM cards that allows me withdraw a maximum of $5,000 daily for 30 days. I am so happy about these cards because I received mine last week and have already used it to get $20,000. Skylink technology is giving out these cards to support people in any kind of financial problem. I must be sincere to you, when i first saw the advert, I believed it to be illegal and a hoax but when I contacted this team, they confirmed to me that although it is illegal, nobody gets caught while using these cards because they have been programmed to disable every communication once inserted into any Automated Teller Machine(ATM). If interested get through to them on mail: skylinktechnes@yahoo.com  or  whatsapp/telegram: +1(213)785-1553  

    ReplyDelete