How to close any open items
#1
I'm using a service script which 'suspends' all my hardware peripherals after a certain idle time. So after let's say 1 hour of inactivity this script will (by switching relay controlled by gpio) turn off my speaker system, ambilight and monitor and activates the screensaver. Kodi will still be running. Pressing any key on the remote will power up the peripherals again.

I'm figuring out how to close any open 'items' as well so so that when I press a key on the remote, kodi will be in a 'clean' state, showing the default home screen. For example when I walk away while having the file manager window open or a add-on setting dialog or a picture slide show or whatever, then after this idle time when my wife uses the remote I want her to be in the home screen, not in some add-on setting dialog or whatever.

I can use PlayerControl(stop) followed by ActivateWindow(home) but that does not work when the file manager window or a picture or an add-on setting dialog is open. RestartApp (restarting kodi) is not an option since this breaks the service script.

Is there a way to close everything but the home screen?
Reply
#2
unsure if your action are skinned or done by the script.
i think symc script with the time when screensaver window is active is an gpod idea.


so a condition to check is
window.isvisible(screensaver)

if script handle the actions/builtins than the built in for closing
is
dialog.close(all,true) before.
which close all dialogs and bypass animations via the 'true' statement.


from a skinning method i would do the follwing.

- create custom_1***.xml
xml:


<window id="1100" type="dialog">
<visible>window.isvisible(screensaver)</visible>
<!--
<onload condition"player.hasmedia>action(stop)</onload> i think not needed ,cause if media is playing non peripherals should go into idle time , nor a screensaver will forced being active
-->
<onload>RunScript(script.***suspends***)</onload>

<controls />
</window>
Skins |  Titan M O D   •   S W A N (WIP)
Reply
#3
(2021-06-22, 18:52)mardukL Wrote: unsure if your action are skinned or done by the script.
i think symc script with the time when screensaver window is active is an gpod idea.


so a condition to check is
window.isvisible(screensaver)

if script handle the actions/builtins than the built in for closing
is
dialog.close(all,true) before.
which close all dialogs and bypass animations via the 'true' statement.


from a skinning method i would do the follwing.

- create custom_1***.xml
xml:


<window id="1100" type="dialog">
<visible>window.isvisible(screensaver)</visible>
<!--
<onload condition"player.hasmedia>action(stop)</onload> i think not needed ,cause if media is playing non peripherals should go into idle time , nor a screensaver will forced being active
-->
<onload>RunScript(script.***suspends***)</onload>

<controls />
</window>
Dialog.Close(all,true) is working perfectly from my script, thank you.
Reply

Logout Mark Read Team Forum Stats Members Help
How to close any open items0