Trigger fullscreen whenever XBMC receives events?
#1
I'd like to make sure that when my girlfriend wants to use the Media Center she doesnt turn on the TV and see the remains of when I was working "under the hood".

In other words, I need to occasionally VNC into XBMC to change settings or configure the operating system or upgrade some software. But if I forget to close everything out and flip XBMC back into fullscreen mode, I'd like some way to have this done automatically.

One way would be to trigger a fullscreen keystroke in XBMC after every 30 minutes of inactivity.

Another way would be to have XBMC flip itself into fullscreen mode whenever it is in use and receives a command.

Can XBMC support either of these two features?
Reply
#2
I do not think that XBMC supports it directly but you should be able to configure the mac to do it. What remote do you use.
Macmini Server 2011 i7 Quad Core, OS 10.8.2, Amp Onkyo TX-SR308 USB WD drives 3x2TB TV Samsung Plasma 720p EyeTV Integration
There are only 10 kinds of people in this world, those who understand binary, and those who don't.



Reply
#3
Thanks for the reply, activate.

I ordered a FLIRC. Should be here tomorrow. I know I can program a button on my remote to be the Fullscreen button but ultimately I want this to happen automatically.

Wondering whether this can be accomplished using the timer in a screensaver addon....
Reply
#4
UPDATE: I've written an Applecript that will run some code after a specified interval of inactivity. However, if I send a backslash key at that point then XBMC will TOGGLE between fullscreen and not fullscreen. TAB is supposed to go to fullscreen regardless, but when I hit the tab key manually XBMC either advances to the next home screen menu item or does nothing.

Is there some other key to trigger fullscreen?
Reply
#5
1. Command F or \ will perform the same function that is toggle fullscreen mode .Command T will cause XBMC to float on top regardless of window mode. The only way that I know to automatically start xbmc in fullscreen mode is by way of an applescript which needs to do the following:

* launch xbmc
* return the window mode
* toggle by gui scripting if the return of window mode is not fullscreen

Let me know if you can't write or find one that does this. I use this script which doesn't automatically start in fullscreen but it ensures that xbmc has focus and I have another key routed via flirc to toggle fullscreen when required.

2. I also suggest that you change this key from Command F to Control Command F in the keymaps folder of XBMC. The advantage of this is that the latter combination is used on most mac apps to toggle fullscreen. When you route this to your flirc, you will be able to contol fullscreen mode on most other apps should you decide to add other apps to your media center.

3. Writing a script to periodically check window status continuously is in my opinion a waste of resources and a less efficient way of achieving what you require.
Macmini Server 2011 i7 Quad Core, OS 10.8.2, Amp Onkyo TX-SR308 USB WD drives 3x2TB TV Samsung Plasma 720p EyeTV Integration
There are only 10 kinds of people in this world, those who understand binary, and those who don't.



Reply
#6
Thanks for the reply, activate.

If you have a minute I could use some help in detecting whether XBMC window mode is fullscreen. I've tried a bunch of ways and can't seem to get it.

This script always returns FALSE in a debug dialog:

Code:
            tell application "System Events"
                tell process "XBMC"
                    get value of attribute "AXFullScreen" of window 1
                end tell
            end tell
            display dialog result as text
I'm not concerned with starting XBMC in fullscreen mode (that's handled already by advancedsettings.xml).

I need a script that cleans up any visual mess I might have left behind by making administrative changes, editing system files, etc. My applescript will use a few CPU ticks maybe once every few hours, when it checks window status; I'm not worried about that kind of waste. The real wasted resource is to bother with all of this setup only for it to fail to pass the girlfriend test, thus reducing it to a doorstop.
Reply
#7
UPDATE: I've got it. By default, this will check every half-hour, and if there's been and hour of inactivity it will make sure XBMC is running, current, and fullscreen.

Works for me on OSX 10.7.5; if anyone tests this please pst your results here.


Code:
# APPLESCRIPT TO RETURN XBMC TO FULLSCREEN MODE WHEN NECESSARY

global take_action_after, check_every

# inactivity threshold (seconds)
set take_action_after to 3600 -- default is one hour

# time between checks (seconds)
set check_every to 1800 -- default is 30 minutes

on idle
    
    set wait_interval to check_every
    
    set idletime to do shell script "echo $((`ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/ !{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'` / 1000000000))"
    if (idletime as integer) > take_action_after then
        
        try
            # MAKE SURE XBMC IS RUNNING, OPEN, ACTIVE, NOT MINIMIZED (TO DOCK) AND IN FRONT
            tell application "XBMC"
                activate
                reopen
            end tell
            tell application "System Events" to set frontmost of process "XBMC" to true
            
            # IF WE ARE NOT ALREADY FULLSCREEN, TOGGLE FULLSCREEN ON BY SENDING BACKSLASH KEYSTROKE
            tell application "System Events"
                tell process "XBMC"
                    get position of window 1
                end tell
            end tell
            if result as text is not "00" then
                tell application "System Events"
                    key code 42
                end tell
            end if
            
        end try
        
        set wait_interval to take_action_after
        
    end if
    
    return wait_interval
    
end idle
Reply
#8
Cool, i haven't tried it but apple script is very handy. Another app that may be useful to you is called Lingon. This edits launch services and automatically launches any app and keeps it running.
Macmini Server 2011 i7 Quad Core, OS 10.8.2, Amp Onkyo TX-SR308 USB WD drives 3x2TB TV Samsung Plasma 720p EyeTV Integration
There are only 10 kinds of people in this world, those who understand binary, and those who don't.



Reply
#9
Improved this script, to avoid unnecessary work (like causing the discs to spin back up) if the app is already running fullscreen.

Code:
# APPLESCRIPT TO RETURN XBMC TO FULLSCREEN MODE WHEN NECESSARY

global take_action_after, check_every, inProcess

# inactivity threshold (seconds)
set take_action_after to 3600 -- default is one hour (3600 seconds)

# time between checks (seconds)
set check_every to 3600 -- default is one hour (3600 seconds)\

set inProcess to false

on idle
    
    set wait_interval to check_every
    
    if inProcess is not true then
        
        set inProcess to true
        
        set idletime to do shell script "echo $((`ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/ !{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'` / 1000000000))"
        if (idletime as integer) > take_action_after then
            
            -- say "checking status of XBMC"
            set isFullscreen to "false"
            try
                # IF WE ARE NOT ALREADY FULLSCREEN, TOGGLE FULLSCREEN ON BY SENDING BACKSLASH KEYSTROKE
                tell application "System Events"
                    tell process "XBMC"
                        get position of window 1 as text
                    end tell
                end tell
                if result is "00" then
                    set isFullscreen to "true"
                end if
            end try
            if isFullscreen is not "true" then
                -- say "activating XBMC"
                # MAKE SURE XBMC IS RUNNING, OPEN, ACTIVE, NOT MINIMIZED (TO DOCK) AND IN FRONT
                try
                    tell application "XBMC"
                        activate
                        reopen
                    end tell
                    -- say "moving XBMC to front"
                    tell application "System Events" to set frontmost of process "XBMC" to true
                end try
                
                -- say "toggling fullscreen"
                tell application "System Events"
                    key code 42
                end tell
            end if
            
            set wait_interval to take_action_after
            
        end if
        
        set inProcess to false
        
    end if
    
    return wait_interval
    
end idle
Reply

Logout Mark Read Team Forum Stats Members Help
Trigger fullscreen whenever XBMC receives events?0