contains the main Python code of an addon. This document describes sample code that may be used in

xbmc.python.script Addon

xbmc.service Addon

Open Addon Settings on First Run

system.d Service Addon

Restart Service when Settings are Changed

The code below restarts the system.d service of an addon when settings of the addon are changed.

import subprocess
import xbmc
import xbmcaddon

class Monitor(xbmc.Monitor):

   def __init__(self, *args, **kwargs):
      xbmc.Monitor.__init__(self) = xbmcaddon.Addon().getAddonInfo('id')

   def onSettingsChanged(self):[['systemctl',|'restart',]])

if __name__ == '__main__':