Sunday, September 5, 2010

How to reset the main menu in Ubuntu

I rearranged and deleted some menu items in the main menu. Finally they are in a mess. Some menu is missing and I can't remember the original position or command. I want to reset them to default like fresh install. I don't see any way to reset it easily. There's a revert button but It doesn't work right. So I searched and dug in some configurations.
Then I learn that there're default menu configuration somewhere. One of them is at /etc/xdg/menu which there're and for application menu and system setting menu respectively. And each user has its own customization of menu in ~/.config/menus which has and too. Those files contain some exclude configurations and they are merged with default configurations when it is used.

So deleting directory ~/.config/menus should reset the main menu to default state and that's all.

rm -rf ~/.config/menus  

and logout and login again.

but if it's still not be reset like in my case, it need to delete *.desktop in your home directory too.
find ~/ -name "*.desktop" -delete