Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement] Run process when idle #87

Closed
BartOtten opened this issue Nov 18, 2012 · 9 comments
Closed

[enhancement] Run process when idle #87

BartOtten opened this issue Nov 18, 2012 · 9 comments

Comments

@BartOtten
Copy link

It would be great when we could set one or more proces(ses) that runs when XBMC is inactive. For exampe transmission-daemon. This can be done multiple ways, but I guess the next ideas would be the easiest:

Idea 1:

  • poll the cpu usage
  • start process when CPU usage is below 'X' (start-deamon will ignore when process already runs)
  • stop process when CPU usage is above 'Y' (start-deamon will ignore when process already runs)

Maybe some sort of 'average value in 10 seconds' would be nice.

Idea 2:

  • use the screensaver option from XBMC

Maybe usefull info: http://forum.xbmc.org/showthread.php?tid=141078

Regards,
Bart

@CurlyMoo
Copy link
Contributor

Seems like a great function to build, looking forward to the pull request :)

@BartOtten
Copy link
Author

Hahaha, currently I am in the process of speeding up browsing in large
libraries (incl Fanart). Keep it open for the time being.

@Koenkk
Copy link
Contributor

Koenkk commented Jan 30, 2013

I can try patching XBMC so it executes a command when it goes out and in to 'screensaver mode'.

@CurlyMoo
Copy link
Contributor

This should be done as a service and not by patching the core of XBMC. Some suggestions of such a service is already given on our forum.

@belese
Copy link

belese commented Feb 4, 2013

I can try patching XBMC so it executes a command when it goes out and in to 'screensaver mode'.

It already exist, as i talk with curlymo before, could do it in a next version of xbian-config-python, and set a 'runmode' for each service (always, screensaver on, video off)

@CurlyMoo
Copy link
Contributor

CurlyMoo commented Feb 4, 2013

set a 'runmode' for each service (always, screensaver on, video off)

+1

@OnceUponALoop
Copy link

Why not just create a cron job that checks if xbmc is idle using JSON

Example:

# Check if XBMC is in idle mode
isIdle=`curl -H "Content-Type: application/json" -i -X POST -d '{"jsonrpc": "2.0", "method": "XBMC.GetInfoBooleans", "params": { "booleans": ["System.ScreenSaverActive "] }, "id": 1}' http://xbmc:8080/jsonrpc | grep result | awk '{print $2}' | sed 's/"\|:\|}//g'`

# If XBMC is idle send a keypress to wake it so Advanced Launcher can issue the maximize command
if $isIdle ; then
   #Take action
fi

@CurlyMoo
Copy link
Contributor

CurlyMoo commented Apr 4, 2013

Because that requires additional resources while a service inside XBMC does not.

@mk01
Copy link
Member

mk01 commented Nov 2, 2013

this functionality is now package xbian-xbmc-bridge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants