Kodi Community Forum
v19 Display message at shutdown - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: v19 Display message at shutdown (/showthread.php?tid=371622)



Display message at shutdown - badsheep - 2023-01-26

Hello,

My Kodi 19 (used with Mac OS) is quite long to shutdown. It's not a big deal, but I'd like to display a message WHILE Kodi is shutting down, to be sure I pressed the good button on the remote. So I created a python script that display a message and then shut down Kodi. I launch this script with a shortcut on the menu. Here's the script :

import xbmc, xbmcgui
dialog = xbmcgui.Dialog()
ret = dialog.yesno('Kodi va quitter', 'Adios amigos !',' ',' ',5000)
xbmc.executebuiltin('Shutdown')

It works, but it's not very elegant : it displays the message, and only starts shuting down AFTER displaying the message.
I tried with notifications, it's worse, the shutdown action kills the notification and I don't even have the time to read it.

I would prefer a message displaying WHILE Kodi is shuting down.
Is that possible ?

Thanks !


RE: Display message at shutdown - izprtxqkft - 2023-01-28

given the lack of responses it seems nobody has really done this. my expectation is that if a notification only flashes on the screen then anything else you attempt to display would have the same behavior
i have only 1 idea for you, seeing that you are already using scripting methods maybe look into trying to open a single image on shutdown with player.open - https://kodi.wiki/view/JSON-RPC_API/v13#Player.Open
failing that maybe you can find something mac specific to show a shutdown animation/logo


RE: Display message at shutdown - badsheep - 2023-01-29

Thanks for your answer ! I’ll try that and let you know.


RE: Display message at shutdown - badsheep - 2023-01-29

I'm not familiar with json stuffs and displaying an image doesn't seems to be easy neither... I think I will do a Feature Request and wait few months Wink

Where is the best place for a feature request ? On this forum or in the Issues of the GitHub page ?


RE: Display message at shutdown - black_eagle - 2023-01-29

It shuts down after the dialog because you have used dialogyesno so you have to answer yes or no  to it to get it to shutdown.  Your code takes no account of what you actually answered. Probably better to use dialog.notification() with a timeout.  See https://alwinesch.github.io/group__python___dialog.html#gaca90e2d17ad057925f1a350a08deed85


RE: Display message at shutdown - badsheep - 2023-01-29

I did tried with dialog.notification() but the notification was immediately closed by the shutdown command and didn't let the time to read it.
But maybe I did it the wrong way, I'll give a new try. Thanks


RE: Display message at shutdown - badsheep - 2023-01-29

I confirm that when I execute the script :

import xbmc, xbmcgui
dialog = xbmcgui.Dialog()
dialog.notification('Kodi va quitter', 'Adios amigos !', xbmcgui.NOTIFICATION_INFO, 5000)
xbmc.executebuiltin('Shutdown')

No notification is displayed, and Kodi shuts down.
(that's why I was using the yesno version, as it displays something)


RE: Display message at shutdown - badsheep - 2023-02-02

So, back to my question : where is the best place to do a feature request ? Thanks !


RE: Display message at shutdown - badsheep - 2023-02-09

I created a feature request on the Github.

No feature request on the github, they told me to do it here.