Kodi Community Forum

Full Version: create a dialog box at startup
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi ,
i am running kodi 17.3 krypton on raspberry pi 3.
my question is OS independent.
i want a dialog box to appear on startup that tells the IP my device got.

i have a general idea.
sometime back , i did write a py script that displayed a fixed text for few seconds. somehow , don't have that py file.
guess , this time i should run command
ifconfig > /storage/current_ip.txt
and display contents of current_ip.txt in dialogbox.
if i add
python script.py
in /storage/.config/autostart.sh

so , need help .

I would do it in another way, to be sure the IP which Kodi has is the same which is being displayed.

Therefore I would create a 'autoexec.py' file in your userdata folder and fill it with:

import xbmc
import time

xbmc.executebuiltin('XBMC.ActivateWindowAndFocus(10007, 96,0)')

That will activate the Window "10007" which is the Kodi system settings and will focus the ID "96,,0" which is the network button for it. Then it will 'sleep' for 10 seconds and then activate the window "10000" which is the Home-menu of your skin.

Assuming we are talking about Estuary as the skin. Not sure if that will work for other skins as well, as IDs might be different.
found a better an easier way. But still with the autoexec.py:

import xbmcgui
import xbmc

header= "Show IP"
line1= "Your current internal IP is:"
line2= xbmc.getIPAddress()
xbmcgui.Dialog().ok(header, line1, line2)

That does exactly what you want
works like a charm .