Kodi Community Forum

Full Version: Temporarily disable power saving (turn off screen)?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone,

I am running XBMC 13 standalone on a HTPC with Arch Linux installed.
I enabled xbmc to turn the screen off in the power saving options, but I disabled the screensaver (set it to "None") since screensavers don't make sense for my LCD.

When watching movies etc. it is all fine, but other programs will try to use programs like "xdg-screensaver" to turn screensaving/power management off, however, it won't do much and XBMC still keeps turning the screen off while these programs are running.
It seems XBMC doesn't work with xdg-screensaver?! What else could I do?

regards,
Bill
Can't you just uninstall xdg-screensaver if you no screensaver is what you want?
(2014-12-18, 23:17)negge Wrote: [ -> ]Can't you just uninstall xdg-screensaver if you no screensaver is what you want?
It is not the screensaver which is invoked, XBMC turns off the screen, and that is what I want, if my HTPC is idle. The problem is that XBMC thinks my HTPC is idle when other programs run, e.g. a game, ans subsequently turns off the screen. xdg-screensaver is a util to tell X that it should not use any monitor power saving functions, but XBMC ignores this.

To rephrase: is there a way to usa a script (Python/Bash) to turn XBMC's power management off/on?
I had a quick look and as it seems, there is no way to disable the screensaver temporarily. You can activate it though Wink
Hm, I thought about simply changing the XML settings file with a script, but then I somehow need to tell xbmc to apply the changed settings, is this possible? And if yes, how?
no, changing the xml directly won't take effect while kodi is running.
Thinking about it, it _might_ be possible to change the setting on the fly with json rpc.
(2014-12-20, 09:20)wsnipex Wrote: [ -> ]Thinking about it, it _might_ be possible to change the setting on the fly with json rpc.
I thought about this too, but http://kodi.wiki/view/JSON-RPC_API/v6 doesn't list any method calls for the namespace "Settings", that's one reasone why I asked here.
Is there documentation for the methods in the namespace "Settings"?
Code:
# get all settings (and pretty print it)
wget --header='Content-Type: application/json' --post-data '{"jsonrpc": "2.0", "method": "Settings.GetSettings", "params": {"level": "expert"}, "id": "1"}' http://localhost:8080/jsonrpc -O - | python -m json.tool

# get screensaver idle time
wget --header='Content-Type: application/json' --post-data '{"jsonrpc": "2.0", "method": "Settings.GetSettingValue", "params": {"setting": "screensaver.time"}, "id": "1"}' http://localhost:8080/jsonrpc -O - -q

#set screensaver to None
wget --header='Content-Type: application/json' --post-data '{"jsonrpc":"2.0","method":"Settings.SetSettingValue", "params":{"setting":"screensaver.mode","value":""},"id":1}' http://localhost:8080/jsonrpc -O - -q

#disable "put display to sleep when idle"
wget --header='Content-Type: application/json' --post-data '{"jsonrpc":"2.0","method":"Settings.SetSettingValue","params":{"setting":"powermanagement.displaysoff","value":0},"id":1}'http://localhost:8080/jsonrpc -O - -q
Thank you very much, however I don't think it works.

I did:
Code:
curl -s -H 'Content-Type: application/json;' --data-binary '{"jsonrpc":"2.0","method":"Setting.powermanagement.displaysoff","value":0},"id":1}' 'http://localhost:8090/jsonrpc'
And it doesn't seem to apply this setting, at least if I go into settings in XBMC it still shows me my old values. I don't get any error message or anything though.
I did try to change "Setting" to "Settings" as this is what the namespace is called in the wiki, however, still all the same. Am I doing something wrong?

regards and thank you for your help.
Ok my bad, I got it, it is:

Code:
'{"jsonrpc":"2.0","method":"Settings.SetSettingValue","params":{"setting":"powermanagement.displaysoff","value":-VAL},"id":1}'

Wasn't thinking, now it seems to work, I'll need to test it now Big Grin
But thank you so far.
you passed the test Tongue
it was wrong in my post, must have been a c/p error.