v17 [SOLVED] How to change startup window to source?
#1
Apparently I'm not using the proper search terms... Do I need to edit the guisettings.xml or something to make Kodi start up with in an SMB share on my NAS? I'm also thinking about using different sources once I've started using profiles. Thx!
Reply
#2
(2017-05-27, 15:54)tecc Wrote: ... to make Kodi start up with in an SMB share on my NAS...
Either it's me (possible) or that's not clear at all. What do you want to happen when kodi starts?
Reply
#3
- Navigate to the filemanager and add your SMB share as a source
- create the file "autoexec.py" inside your userdata folder. Depending on your OS the userdata-folder is either accessable via:

Code:
cd ~/.kodi/userdata
or
Code:
cd /storage/.kodi/userdata

- create the autoexec.py and fill it with the following content:

Code:
import xbmc

xbmc.executebuiltin('ActivateWindow(10003)')

That will cause Kodi start directly in the filemanager view and you only have to select the source you want to enter. If it's only one source, we could also access it directly by adding some navigation commands below the "ActivateWindow" command like:

Code:
xbmc.executebuiltin('Action(Down)')
xbmc.executebuiltin('Action(Select)')

That will move the navigation one step down and will select the highlighted position. Depending on which position your source is, you have to add multiple "Action(Down)" commands.

Hope that helps
Reply
#4
(2017-05-27, 16:01)trogggy Wrote: Either it's me (possible) or that's not clear at all. What do you want to happen when kodi starts?
I want Kodi to start in the shared folder of my NAS that contains all the videos instead of the video window where I'd have to klick on files to get the sources listed. I could use DaVu's action commands but according to this I should be able to simply select the path to the share in the autoexec.py. I'm not exactly sure what syntax to use, though.

sources.xml contains this path: <path pathversion="1">smb://Dad/Public/Shared Videos/</path>

so I've tried

ActivateWindow(100003,smb://Dad/Public/Shared Videos/)

but to no avail, Kodi still starts in the video folder. BTW, are there any file permissions to be set, I don't see any mentioned here.
Reply
#5
Try:
Quote:import xbmc

xbmc.executebuiltin('ActivateWindow(FileManager,"smb://Dad/Public/Shared Videos/")')
as autoexec.py in userdata. That should open in the file manager view for that folder.

Edit: although I'm still not 100% sure that's what you want. If you want to play the videos you'd use 'Videos' rather than 'FileManager'.
Reply
#6
I really don't know how else to put this. Kodi's startup window is set to "Videos", so upon boot I see

Videos
- Files
- Playlists
- Video-Addons

So I have to click on Files to get

Videos: Files
..
Dad
Add videos...

where I have to click on 'Dad' to see what's inside smb://Dad/Public/Shared Videos/, which is the 4 folders (I'm not using the library functionality)

Documentaries
Movies
Music
TV Shows.

Instead of having to klick twice to get there I would like to start here right away. When I change 'FileManager' to 'Videos', I'm getting 'invalid argument' though.
Reply
#7
Try:
Quote:import xbmc

xbmc.executebuiltin('ActivateWindow(Videos,"smb://Dad/Public/Shared Videos",return)')
Reply
#8
That did the trick! I had to enter username/password after my first reboot despite having already entered and set it to be remembered for this path when I initially added the source.

Still, it works just fine now. Thanks a lot!
Reply
#9
Great.
Reply
#10
So, I'm back at this since I've replaced my Dad's Odroid with a Xoro that boots LibreELEC from SD Card. I've copied over the configuration but somehow entering that directory automatically at startup does not work anymore.

autoexe.py reads:
xbmc.executebuiltin('ActivateWindow(Videos,"smb://Dad/Public/Shared Videos",return)')

but the log says:
Unable to open directory : 'smb://USERNAME: PASSWORD@Dad/Public/Shared Videos"

despite the fact that passwords.xml reads:
        <from pathversion="1">smb://Dad/Public</from>
        <to pathversion="1">smb://tecc:tecc@Dad/Public/Shared Videos/</to>

Also, when I click OK on the initial error message I can enter this directory just fine without having to type my pw. Still, I've changed

autoexe.py to
xbmc.executebuiltin('ActivateWindow(Videos,"smb://tecc:tecc@Dad/Public/Shared Videos",return)')

but it still doesn't work. Could this be related to the network not being fast enough or something? When the screen comes up the time in the upper right corner says 1:00 and only after some seconds ht time is retrieved from ntp.org. Any ideas?
Reply
#11
(2018-10-12, 10:49)tecc Wrote: ... Could this be related to the network not being fast enough or something? When the screen comes up the time in the upper right corner says 1:00 and only after some seconds ht time is retrieved from ntp.org. Any ideas?

To exclude that possibility, try goin into the LibreELEC Configuration Addon (under programs) and enable the "Wait for network before starting kodi"-setting (under the "network"-tab, way at the bottom.
Reply
#12
@troggy 
So how do I change the path when I now want to start with music on an external drive? I'm not using the database but currently have to manually move to Music > files > WD1TB > Music > Albums.
Reply
#13
A bit late but better late then never?
Quote:xbmc.executebuiltin('ActivateWindow(Music,"/Path/You/Want/To/Open",return)')
or
Quote:xbmc.executebuiltin('ActivateWindow(Music,"smb://Music/Albums",return)')
Reply

Logout Mark Read Team Forum Stats Members Help
[SOLVED] How to change startup window to source?0