Create shortcut to launch on given monitor?
#1
I know in Dharma I can set what display to use from within XMBC, but I'm looking for a way to control what display it starts on initially. Is there a command line that can control this feature or something?

thx
Reply
#2
Anybody? I really need a shortcut or hotkey to switch the display between monitors. Is there no built in way of doing this?
Reply
#3
zipsonic Wrote:Is there a command line that can control this feature or something?

No.

You could achieve this effect though. XBMC keeps settings in %appdata%\userdata\guisettings.xml. You could keep two versions of guisettings.xml and write a little script that copied the required guisettings.xml into your userdata folder then started XBMC.

JR
Reply
#4
zipsonic Wrote:Anybody? I really need a shortcut or hotkey to switch the display between monitors. Is there no built in way of doing this?

Not built in. But you can do it
If you are using 7, copy that to a vbs file, adapt the paths if need be.

Dim WshShell
Dim scv
Set svc=getobject("winmgmts:root\cimv2")
Set sh = CreateObject("WScript.Shell")
Set WshShell = WScript.CreateObject("WScript.Shell")
Const DELAY = 1

'switch to TV only
execCMD = """C:\Windows\System32\DisplaySwitch.exe""/internal"
Wshshell.Run execCMD,2,false

'Launch Xbmc
WshShell.CurrentDirectory = "C:\Program Files (x86)\XBMC\"
execCMD = """C:\Program Files (x86)\XBMC\XBMC.exe"""
Wshshell.Run execCMD,3,true

'switch to LCD only
execCMD = """C:\Windows\System32\DisplaySwitch.exe""/external"
Wshshell.Run execCMD,2,false

This will
- switch your tv to primary
- launch xbmc on your tv
- switch back to your lcd on xbmc closing

if you just want to launch on your regular monitor (not tv), you can just use the xbmc shortcut Smile
more to play with here
Reply
#5
Star 
zipsonic Wrote:Anybody? I really need a shortcut or hotkey to switch the display between monitors. Is there no built in way of doing this?
As mentioned it's mostly hardware O/S issue... if you're using win7 you can use the hotkey Win+P to bring up the flip screen menu... seems best for me as I've found that have a 1920x1200 monitor and a 1920x1080 TV creates issues when flipping to full screen if I've started XBMC under the larger monitor screen.

Just tried the script, works like a charm unaltered on my system, so I pinned it to the XBMC icon that's already in shortcuts.

Thanks RazorFR for the script tip... Now to throw in a full screen animation as a splash entry into this script and fullscreen parms.
Reply
#6
Awesome...thank-you very much guys, this should do the trick!
Reply
#7
Thanks for the script, exactly what I was looking for! One little thing: Any possibility to prevent the script from changing the primary monitor if the second monitor is turned off (because then both monitors are black)? Not really necessary, as you can simply exit XBMC with alt+f4 and start the standard shortcut... but would be cool though.
Reply
#8
I use Eventghost and Win 7's displayswitch.exe to do the same thing that RazorFR descibes above.

However, the one problem with this solution is that if I want to switch from projector to monitor or vice-versa the automation always involves closing xbmc and then launching it again. This can be annoying if, say, a song is playing.

I cannot just run displayswitch.exe with XBMC open as the change in resolution isn't handled and the monitor just shows black.

XBMC handles this very elegantly via the change from "Full Screen 1" to "Full Screen 2" in the options menu. But this is a rather cumbersome process involving a lot of button presses.

I would love to be able to program a button via eventghost just to change this one option in XBMC. If anyone could suggest some kind of .bat file to launch with Eventghost to effect this I'd be really grateful.

Thanks!
Reply
#9
I like the script from RazorFR very much, work great!
But is it possible with extra changes to start the script with the Remote "Green Button"?
Reply
#10
Hi guys

I know this is an old thread, but I just thought I'd add my bit:

I find with that .vbs file, and other batch files I've tried, that as Windows (stupidly) doesn't change displays immediately but instead displays the little Win+P animation of moving to the next monitor etc, that XBMC will launch before the switch has finished completely. On my setup, this means it launches at Full HD, but is then scaled down to 720p on my TV, which messes up the graphics in the program and takes the focus off the window - defeating the point (for me) of one click then over to my Unified Remote app on phone!

The simple solution to that is a timeout command, in this simple batch file run from the XBMC dir (for the 64-bit version, though there's a DisplaySwitch in the 32 bit folder that works just the same):

@echo off
C:\Windows\SysWOW64\DisplaySwitch.exe /external
timeout /t 3
start /wait xbmc.exe
C:\Windows\SysWOW64\DisplaySwitch.exe /extend

This should give Windows just enough time to switch (I can get it to crash if I set it to timeout=2, and XBMC launches just as the switch happens Big Grin). If it's not long enough just give the timeout command an extra second.

This might just be for Windows 8 and the VBS file works fine in Windows 7, I don't know. Anyway just thought I'd help after digging around trying to figure this out myself for a while. Thanks for a great media center!
Reply

Logout Mark Read Team Forum Stats Members Help
Create shortcut to launch on given monitor?0