[mythtvnz] How to customise themes

Stephen Worthington stephen_agent at jsw.gen.nz
Mon Nov 18 01:17:15 GMT 2019


On Mon, 18 Nov 2019 11:44:57 +1300, you wrote:

>I'm trying to make tweaks to an existing MythTV theme, and finding the lack of documentation on the theme API somewhat frustrating. So firstly, anyone know where I can find a good description of the theme interface and how to work it?
>
>As an example, say I wanted to change the label on the main menu that says 'Media Library'.  A search of the theme's directory shows that the text is in menu-ui.xml; I change the entry there, reload the theme, and nothing has changed.  Further searching shows that the text is also in mainmenu.xml in the 'default' theme directory; changing it there does indeed work. So, anyone know why the menu-ui.xml doesn't override the default one, or how to make it do that, or what is the purpose of the menu-ui.xml file if its contents are ignored?

Where are you modifying the theme?  In Ubuntu, the themes are stored
in /usr/share/mythtv/themes.  But that is not where you modify them,
as those themes get overwritten by package updates, or when you
re-download a theme.  To modify a theme, copy its directory to
/home/<frontend user>/.mythtv/themes, then rename the directory so
that the theme can be distinguished from the builtin and downloadable
themes.  I just add my initials to the name:

MythCenter-Wide => MythCenter-Wide-JSW

Then in the theme directory, change the themeinfo.xml <name></name>
field to match your new theme name.

Make all your changes in your new theme directory - do not touch the
/usr/share/mythtv/themes/default directory as it is common to all
themes.  If there is a file in the default directory you want to
modify, first check if the setting is not already in a file in your
new theme directory.  If so, the one in the theme directory overrides
the one in the default directory.  If the setting is not anywhere in
your new theme directory but only in the default directory, you will
need to copy that setting (or the entire file?) to your new theme
directory and edit it there.  I have never actually done that, so I am
not sure if you need to copy the file or just the one setting.

Theme data is cached by mythfrontend, so I think you need to exit and
restart mythfrontend to load new changes.  Or switch to another theme
then switch back to your new theme.

I suspect that your problem with changes in the menu-ui.xml file will
just have been that it was still using its cached version.  I think
the cached themes are stored here:

/home/<frontend user>/.mythtv/cache/themecache/

but that is just for the bits it does not keep in RAM.

The entire .mythtv/cache directory can be deleted if you want to clear
all your caches.  There used to be a bug that meant you had to do that
occasionally or your hard disk ran out of space, but now MythTV
automatically does that as necessary.

Once you have been using your new theme for a while, you need to check
for changes in the original theme it was copied from and make the same
adjustments in your theme.  This should tell you what the changes are:

diff -u /usr/share/mythtv/themes/<name> /home/<frontend
user>/.mythtv/themes/<new name>

I do a similar thing using my (pay) GUI editor and diffing tools.



More information about the mythtvnz mailing list