Mailing List Archive

How to customise themes
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?

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: How to customise themes [ In reply to ]
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.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: How to customise themes [ In reply to ]
Hi Stephen,

On Mon, 18 Nov 2019 14:17:15 +1300
Stephen Worthington <stephen_agent@jsw.gen.nz> wrote:

> 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,
> ... To modify a theme, copy its directory to
> /home/<frontend user>/.mythtv/themes

Sorry, I didn't explain very well; I had already done that copy, including all the 'default' directories, to my .mythtv/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.

Thanks, that was the step I was missing! Copied the mainmenu.xml to my new theme directory in .mythtv, modified it there, and MythTV started taking notice of the changes.

> 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/

I tried deleting the cache but it seemed to have no effect.

> 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.

Some experimentation showed that all you need to do is go to the theme-chooser menu, where the current theme will already be highlighted, and just hit OK (or Enter)

And after more web searching I finally found this:
https://www.mythtv.org/wiki/MythUI_Theme_Development
which looks as if it should have all the details on how to mess with themes.

Cheers,
Austin.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/