[mythtv] [mythtv-commits] Ticket #2388: fall back to ~/.lircrc if ~/.mythtv/lircrc doesn't exist
Michael T. Dean
mtdean at thirdcontact.com
Thu Sep 14 18:11:51 UTC 2006
On 09/14/06 04:53, MythTV wrote:
>#2388: fall back to ~/.lircrc if ~/.mythtv/lircrc doesn't exist
>
>
While I'm not arguing the value of falling back to LIRC's default config
file in the event there's no ~/.mythtv/lircrc (I'll leave that decision
up to someone else), I think the current implementation will work for
what you want.
> MythTV expects the lirc config file in ~/.mythtv/lircrc. All other
> clients I know of use ~/.lircrc.
>
>
Other clients that will only use ~/.lircrc /force/ you to commingle
settings for many different programs in a single file (although, I'm
sure many of those you're including in this group allow you to specify a
config file with a command-line option). MythTV /allows/ you to choose
to keep your MythTV settings in a different location /or/ to use the
same config file.
> There exists a useful daemon called lircrcd that syncs the current lirc
> mode between clients. Otherwise it can happen that simulatous running
> clients are in inconsistent modes.
>
> The lircrcd creates a socket to communicate with the other lircrcds.
> The
>
/default/
> name of the socket is the name of the config file, with a 'd'
> appended. So other clients will use ~/.lircrcd as the socket name, but
> MythTV will use ~/.mythtv/lircrcd, so the lircrcd for MythTV can not
> communicate with the other daemons.
>
>
From man 1 lircrcd:
-o, --output=socket
With the --output option you can select the Unix domain socket,
which lircrcd will create. The default is to append a "d" character to
the config filename given.
So, to synchronize mode against all clients, where most use ~/.lircrc
(and the default socket for lircrcd), wouldn't you just make sure the
line in your MythTV LIRC config file (~/.mythtv/lircrc) is:
#! lircrcd -o ~/.lircrcd
(I haven't tried this, since I'm using an older version of LIRC, but it
sure seems that's what the designers of lircrcd envisioned.)
> I tried to fix this my creating a symlink from ~/.mythtv/lircrcd to
> ~/.lircrcd to make sure that the lircrcd always uses the same socket, but
> sometimes the symlink disappears and the socket in ~/.mythtv/ will be
> created again. In this case I have to remove it and re-create the symlink.
> I think this is not really a solution.
>
If you want to have all your LIRC settings together in one file (which
is my assumption here), you can simply take all the settings out of
~/.mythtv/lircrc and append them to the bottom of ~/.lircrc with
something like:
cat ~/.mythtv/lircrc >> ~/.lircrc
Then, create a symlink from ~/.mythtv/lircrc to ~/.lircrc:
ln -sf ~/.lircrc ~/.mythtv/lircrc
Now, all your settings are in the same place and there's only one LIRC
config file to deal with. This won't help with the socket issue, but
that's what --output=socket is for...
Mike
More information about the mythtv-dev
mailing list