Autoexec.py .vs. Login Screen
#1
Sad 
I'm running Dharma B4 Live installed to HDD.

My ideal setup is to have it automatically "logged" in as a restricted user (Kids) and then adults can logout of kids and login as Adults. If I don't use a Login Screen (so it auto logs in as the Master User), then I loose the nice Logout button under the power menu and it logs in as Master User not kids.

Going through many forums I found what should have been the solution. A short autoexec.py script. Mine is as follows. (Helps find in the debug log when it gets executed).

Code:
import xbmc
print 'hello world'
xbmc.executebuiltin("XBMC.LoadProfile(Kids) ")

However, it doesn't get executed.
Finally found a post that said it needs to be in userdata now (not .xbmc/scripts/) and so now I have it in userdata.

Finally worked out that it ONLY gets executed after a user logs in. (So because it's just in userdata and not in a profiles userdata, it gets executed when Master User logs in).
According to a thread back in 07, http://forum.xbmc.org/showthread.php?tid=24854 there should be a location that gets executed on startup, and a spot that gets executed on login.
For the life of me, I can't find that spot that gets executed on startup.

I know it should be possible, because using my remote, I can skip logging in (actually, login as master user without prompting for pin) simply by having a button execute xbmc.ActiveWindow(MyVideos).

Does anyone have a simple way to automatically login a user profile (same one everytime) and still allowing an easy way to logout of that profile so that other profiles can be used?

(And I know this is a separate thing, but can we prevent the remote from loading (ActivateWindow) windows when the user isn't logged in? I'm sure people don't want Master User being logged in automatically.)
Reply
#2
Bit sad no one replied to this.
I've been forced to try sending a login command with xbmc-send but scripting it to try and detect when the login screen is displayed initially (by tailing the log), then sending the correct command.
Surely there is an easier way than this?
Reply
#3
I am in the same situation and looking for an easy solution. I read somewhere about switching some files outside of XBMC using autoexec.bat but I can't find that reference anymore. This seems easier, if it can be executed.

I am also looking for a way to remove the "profiles" option under the kids profile. It might be something obvious, but I haven't seen it yet.
Reply
#4
I'm not at the media centre that I set this up on atm. I'll try and get the script I used when I'm next using it.

What I basically had to do was run a tail on the xbmc.log file, when the line showing that the Login screen was displayed, it waited a little longer then sent the login command via xbmc-send. It works, if you try and login as another user first, it will get logged out and login the default user your script has asked for. (NB: I only did this on Linux)

As for removing the profile option, I'm fairly sure it's skin dependent. I found a skin that let me customise the menus nicely, so I had Logoff in the Settings menu, and things I didn't want the kids to have access to I locked. If you have a menu item that leads to a locked area though, it seems to ask for the lock codes when you goto the main menu, so there is the need to customise the menus.

I'll try get the more detailed information later.
Reply

Logout Mark Read Team Forum Stats Members Help
Autoexec.py .vs. Login Screen0