[mythtv-users] Start MythTV on Display I want (and if not there, next one I want)

Ma Begaj derliebegott at gmail.com
Thu Jan 15 09:28:55 UTC 2009


2009/1/14 Allen Edwards <allen.p.edwards at gmail.com>:
> Ma Suggested: "Why don't you assign one button on the remote to start mythtv on
> DISPLAY=:0.0 and an another button to start it on DISPLAY=:1.0 ?"
> Can you give some guidance on this?  All I know how to do with the
> remote is assign keyboard keys to buttons.
>

code in .lircrc file could look like this:

begin
   prog = irexec
   button = Power
   config = /home/mythtv/mythtv-restart
end


you have to start "irexec" to be able to use this command. you can do
it like this:

ps -C irexec >/dev/null || /usr/bin/irexec -d /home/mythtv/.lircrc

run it as an user, not as root. you can put it in a script, like
.xinitrc or .profile or .bashrc.  or in rc.local an run it with "sudo"
as your user.


the script  /home/mythtv/mythtv-restart could be used to restart X
circulating between two xorg files by saving the last used in some
temporary file:

-------------------------
#!/bin/sh

# killall -9 X.   ## you could always kill existing X process
status=/tmp/xorg_status

if [[ -e "$status" ]]; then
 startx -- -layout Projector
 rm "$status"
else
 startx -- -layout LCD
 touch "$status"
fi
-------------------------

after that (or before) you have to put in your xorg.xonf two working
layouts (LCD and Projector) and one should force output LCD and other
one should force output on Projector. You could also create only one
layout and two different screens and than you would run startx with
"--screen Projector" instead of "---layout Projector" Check "man Xorg"
for details about layouts/screens.

M.


More information about the mythtv-users mailing list