XBMC Scrrensaver for raspberry
Posted: Sun Jun 08, 2014 5:39 pm
I am using deluge to my raspberry pi. I have deluge running with xbmc at the same time with the following settings in deluge:
active torrents : 4, max downloading : 2, max uploading : 4, max speed : 800kb
I also have the scheduler plugin and I have set it so that in the time zone between 1:00am until 8:00am the above settings become
active torrents : 8, max downloading : 8, max uploading : 8, max speed : 1024kb
So at night I have deluge running fast and at day it is running slow.
The question is : Could deluge config module http://deluge-torrent.org/docs/current/ ... onfig.html be implemented into a xbmc screensaver frame like this https://github.com/dersphere/script.screensaver.test ?
Since they are both in python my idea is that a scrrensaver could be made so that when xbmc does not work and it is in scrrenasaver mode it could switch deluge to a fast setting. When the screensaver exits it could send from the config manager the command to deluge to enter to a slow setting. The idea is that since xbmc is in scrrensaver mode and obviously not in use, deluge could run faster.
The problem is that I don't know python otherwise I could do it myself.
Any interested reader to combine these two things for the creation of a delugesaver?
So the screensaver frame could be like that (in pseudocode)
active torrents : 4, max downloading : 2, max uploading : 4, max speed : 800kb
I also have the scheduler plugin and I have set it so that in the time zone between 1:00am until 8:00am the above settings become
active torrents : 8, max downloading : 8, max uploading : 8, max speed : 1024kb
So at night I have deluge running fast and at day it is running slow.
The question is : Could deluge config module http://deluge-torrent.org/docs/current/ ... onfig.html be implemented into a xbmc screensaver frame like this https://github.com/dersphere/script.screensaver.test ?
Since they are both in python my idea is that a scrrensaver could be made so that when xbmc does not work and it is in scrrenasaver mode it could switch deluge to a fast setting. When the screensaver exits it could send from the config manager the command to deluge to enter to a slow setting. The idea is that since xbmc is in scrrensaver mode and obviously not in use, deluge could run faster.
The problem is that I don't know python otherwise I could do it myself.
Any interested reader to combine these two things for the creation of a delugesaver?
So the screensaver frame could be like that (in pseudocode)
Code: Select all
import sys
import xbmcaddon
import xbmcgui
import xbmc
------------------------------------------------
import deluge.configmanager
------------------------------------------------
Addon = xbmcaddon.Addon('script.screensaver.test')
__scriptname__ = Addon.getAddonInfo('name')
__path__ = Addon.getAddonInfo('path')
class Screensaver(xbmcgui.WindowXMLDialog):
class ExitMonitor(xbmc.Monitor):
def __init__(self, exit_callback):
self.exit_callback = exit_callback
def onScreensaverDeactivated(self):
print '3 ExitMonitor: sending exit_callback'
self.exit_callback()
def onInit(self):
print '2 Screensaver: onInit'
self.monitor = self.ExitMonitor(self.exit)
LOAD CONFIG DICTIONARY FAST
SET CONFIG VALUES
def exit(self):
print '4 Screensaver: Exit requested'
LOAD CONFIG DICTIONARY LOW
SET CONFIG VALUES
self.close()
if __name__ == '__main__':
print '1 Python Screensaver Started'
screensaver_gui = Screensaver(
'script-%s-main.xml' % __scriptname__,
__path__,
'default',
)
screensaver_gui.doModal()
print '5 Python Screensaver Exited'
del screensaver_gui
sys.modules.clear()