chrisc
2008-09-24, 20:57
Well this one was nearly as much fun as getting Lirc running!
I have based this on two methods I found in this forum and slightly modified and bodged them until they submitted and did what I wanted
This works on Debian and may well need hacking to suit your distro - indeed the techniques I discovered here needed tayloring to work, so your mileage may vary and you will have to double check for paths etc
First I will show you the whole script and then explain what happens and why I'm doing stuff...
you will need to install wmctrl (your distro *should* have a package for it)
and get switchscreen from here (http://users.tkk.fi/~spniskan/switchscreen/)
#!/bin/sh
killall -9 irexec
killall -9 irxevent
killall -9 xbmc
DISPLAY=":0.1" /usr/local/bin/xbmc &
DISPLAY=":0.1" irexec &
DISPLAY=":0.1" irxevent &
sleep 1
/home/chris/bin/switchscreen 0
sleep 1
/home/chris/bin/switchscreen -c 100,100
sleep 1
DISPLAY=":0.1" wmctrl -x -r xbmc.bin.xbmc.bin -b toggle,fullscreen
put the script somewhere safe make it executable and make a nice desktop launcher for it and with luck you should have it
the TV is on screen 1 the monitor is screen 0
as a precaution I kill XBMC but more importantly the two app that will direct the lirc input to where we want it.
I found that for switchscreen to work properly I had to switch screens and then move the pointer. All the sleep statements are needed for it to work properly, and if something isn't working the first thing I would recommend is increasing all of the sleeps to say 3 seconds... (or more)
as using swapscreen knocks xbmc into windowed mode (at least it did for me!) I found a short sleep and then toggling fullscreen was needed
*however* wmctrl will NOT WORK with beryl or compiz soo...
as having compiz on 2 heads will (currently) cause gtk menus to be really slow in appearing you need to run a script then your X session starts
sleep 3
DISPLAY=":0.0" compiz --only-current-screen --replace --fast-filter 0 &
disown $!
you might want to run metacity first so theres a WM on the TV but it really isnt needed....
anyhow I *think* thats about it! hopefully you should have your girlfriend happy playing some soaps and romcoms on the xbmc with the remote, while you can get on with some coding ! :laugh:
"What do you mean we never do stuff together? We're using the same computer together!" :stare:
Oh and btw its worth asking at secondhand game shops if the have any xbox1 dvd kits I got mine for 99p and soldering on a spare usb cable took all of two minutes and was dead easy!
I have based this on two methods I found in this forum and slightly modified and bodged them until they submitted and did what I wanted
This works on Debian and may well need hacking to suit your distro - indeed the techniques I discovered here needed tayloring to work, so your mileage may vary and you will have to double check for paths etc
First I will show you the whole script and then explain what happens and why I'm doing stuff...
you will need to install wmctrl (your distro *should* have a package for it)
and get switchscreen from here (http://users.tkk.fi/~spniskan/switchscreen/)
#!/bin/sh
killall -9 irexec
killall -9 irxevent
killall -9 xbmc
DISPLAY=":0.1" /usr/local/bin/xbmc &
DISPLAY=":0.1" irexec &
DISPLAY=":0.1" irxevent &
sleep 1
/home/chris/bin/switchscreen 0
sleep 1
/home/chris/bin/switchscreen -c 100,100
sleep 1
DISPLAY=":0.1" wmctrl -x -r xbmc.bin.xbmc.bin -b toggle,fullscreen
put the script somewhere safe make it executable and make a nice desktop launcher for it and with luck you should have it
the TV is on screen 1 the monitor is screen 0
as a precaution I kill XBMC but more importantly the two app that will direct the lirc input to where we want it.
I found that for switchscreen to work properly I had to switch screens and then move the pointer. All the sleep statements are needed for it to work properly, and if something isn't working the first thing I would recommend is increasing all of the sleeps to say 3 seconds... (or more)
as using swapscreen knocks xbmc into windowed mode (at least it did for me!) I found a short sleep and then toggling fullscreen was needed
*however* wmctrl will NOT WORK with beryl or compiz soo...
as having compiz on 2 heads will (currently) cause gtk menus to be really slow in appearing you need to run a script then your X session starts
sleep 3
DISPLAY=":0.0" compiz --only-current-screen --replace --fast-filter 0 &
disown $!
you might want to run metacity first so theres a WM on the TV but it really isnt needed....
anyhow I *think* thats about it! hopefully you should have your girlfriend happy playing some soaps and romcoms on the xbmc with the remote, while you can get on with some coding ! :laugh:
"What do you mean we never do stuff together? We're using the same computer together!" :stare:
Oh and btw its worth asking at secondhand game shops if the have any xbox1 dvd kits I got mine for 99p and soldering on a spare usb cable took all of two minutes and was dead easy!