Tip #2: How to Customize MythTV's Menus
The fact that MythTV has so many features can be both a strength, and a weakness. With so many features, the menu structure can be quite difficult to navigate, and it's almost certain that there are some features you will *never* use.
Wouldn't it be nice to trim the MythTV menus to just what you use. Or, how about simply re-ordering them to suit your preferences? The good news is that you can, and quite easily.
First, a bit on how MythTV's menu system works.
The menu's are driven by XML files (located in
The important parts are the menu title:
and the action
There are two types of actions:
Needless to say, linking to another menu simply loads another menu XML file. Launching an action will run the MythTV feature that you select.
Don't start editing those files just yet! Let's run through an example and I'll show you how to safely go about editing the menus.
Let's say that I never use MythPhone, or NetFlix, and I want to remove them from the Information menu. You might think.. "Hey, no problem, I'll just bring up
Nope... Once again, the MythTV devs have outdone themselves. You can make a local copy of the entire mythtv menu system in mythtv's home directory
So.. go ahead..
Just for reference, here is a quick screenshot of the offending menu (with MythPhone and NetFlix)

O.K. Now lets fire up vi and start editing your local copy of
Here is the menu entry for MythPhone
Simply remove the section above (everything, including the <button> tags), and MythPhone will be removed from the menu.
Find the entry for NetFlix, and do the same.
Save the file, and re-run mythfrontend.
Viola, here's our new menu. sans MythPhone and NetFlix

As you can see, this process is quite simple.
Additional Notes:
Now, let's say MythTV upgrades to 0.20 and the devs add a new menu item. Unfortunately, you're custom menus won't be updated with the rest of MythTV, and this could leave you in a lurch. What I would recommend is making a diff file of your modified xml file with the original. Then after an upgrade, you should be able to re-apply your diff to the new menus. If you want to be safe, you can also diff your file with the new original and compare the two diff's, and handle the entire situation manually.
You can re-arrange any menu action and move it into any menu. You can create your own menus. One thing you can't do that I would love is to assign a shell action to a menu item.
Comments, Questions? Post 'em, I'll try and answer any question.
Coming up next: Transcoding profiles for HDTV folks.
Wouldn't it be nice to trim the MythTV menus to just what you use. Or, how about simply re-ordering them to suit your preferences? The good news is that you can, and quite easily.
First, a bit on how MythTV's menu system works.
The menu's are driven by XML files (located in
/usr/share/mythtv/). Here is a snippet from the mainmenu.xml file:
<button>
<type>TV_WATCH_TV</type>
<text>Watch TV</text>
<text lang="FR">Regarder la TV</text>
... [more languages snipped]
<action>TV_WATCH_LIVE</action>
</button>
<button>
<type>MENU_MEDIA_LIBRARY</type>
<text>Media Library</text>
<text lang="FR">Médiathèque</text>
... [more languages snipped]
<action>MENU library.xml</action>
</button>
The important parts are the menu title:
<text>Media Library</text>and the action
<action>MENU library.xml</action>There are two types of actions:
- link to another menu (
MENU menuname.xml) - launch an action (
TV_WATCH_LIVE)
Needless to say, linking to another menu simply loads another menu XML file. Launching an action will run the MythTV feature that you select.
Don't start editing those files just yet! Let's run through an example and I'll show you how to safely go about editing the menus.
Example: Remove MythPhone and Netflix from Info Menu
Let's say that I never use MythPhone, or NetFlix, and I want to remove them from the Information menu. You might think.. "Hey, no problem, I'll just bring up
/usr/share/mythtv/info_menu.xml up in my favorite editor (vi.. right?) and hack away!"Nope... Once again, the MythTV devs have outdone themselves. You can make a local copy of the entire mythtv menu system in mythtv's home directory
~mythtv/.mythtv and when you fire up mythfrontend, it will read those files instead.So.. go ahead..
$cp /usr/share/mythtv/*.xml ~mythtv/.mythtv
Just for reference, here is a quick screenshot of the offending menu (with MythPhone and NetFlix)
O.K. Now lets fire up vi and start editing your local copy of
~mythtv/.mythtv/info_menu.xmlHere is the menu entry for MythPhone
<button>
<type>PHONE</type>
<text>Phone</text>
<action>PLUGIN mythphone</action>
<depends>mythphone</depends>
</button>
Simply remove the section above (everything, including the <button> tags), and MythPhone will be removed from the menu.
Find the entry for NetFlix, and do the same.
Save the file, and re-run mythfrontend.
Viola, here's our new menu. sans MythPhone and NetFlix
As you can see, this process is quite simple.
Additional Notes:
Now, let's say MythTV upgrades to 0.20 and the devs add a new menu item. Unfortunately, you're custom menus won't be updated with the rest of MythTV, and this could leave you in a lurch. What I would recommend is making a diff file of your modified xml file with the original. Then after an upgrade, you should be able to re-apply your diff to the new menus. If you want to be safe, you can also diff your file with the new original and compare the two diff's, and handle the entire situation manually.
You can re-arrange any menu action and move it into any menu. You can create your own menus. One thing you can't do that I would love is to assign a shell action to a menu item.
Comments, Questions? Post 'em, I'll try and answer any question.
Coming up next: Transcoding profiles for HDTV folks.
Tags:
"One thing you can't do that I would love is to assign a shell action to a menu item."
You can - use the "EXEC" action.
Posted by
Anonymous |
9:50 PM
Hi. Look is possible make a personalized menu.
I think gift to my mother one Mythtv Box and need create a custom menu with:
- The son videos (and my mom see only the son videos)
- The Mom radios favorite (and only heard radio favorites)
...and etc...
Is possible make this menu? Please let me know. Regards. Paul
Posted by
Anonymous |
3:28 PM
Thanks so much for the EXEC tip, I have a few bash scripts that I can't live without, this really helps me out.
Posted by
David |
12:39 PM
BRAVO! Short, to the point, and exactly what I was wanting to do. Thank you!
Posted by
Anonymous |
5:14 PM
Awesome! Thanks for the info! Helped a lot!
Posted by
Anonymous |
9:28 AM
I know you only used the removal of "MythPhone" and "Netflix" for the tutorial, but an easier method for removing those from the emnu if you never use them is to uninstall the MythPhone and/or Netflix modules :-)
I didn't know you could create a local copy of the menus in the mythtv directory, which then overrides the system ones, so thanks for that tip! :-)
Posted by
Alan Murrell |
1:28 PM