Auto-rebuild of Brisk Menu after Application Install

Is the process of rebuilding the Brisk Menu, to add a category such as "Internet" or "Graphic", a task which is considered part of the underlying Ubuntu OS, or is it considered part of the Display Manager.

I ask because, after installing first MATE Desktop (on top of Ubuntu Server), then Firefox or Gimp on the Ubuntu server, there is no category listed for either "Internet" or "Graphics" !!!

2 Likes

Not sure if this will help, but you could try:

sudo update-desktop-database

1 Like

Thank you for responding, Dave, but that utility (along with other tools in the "desktop-file-utils" package) are addressing an issue at a much lower level than what I am trying to deal with.

My issue is how does the OS handle the installation of a new application (Firefox, GIMP) such that once installed, along with any well-formed "*.desktop" file,

  • how does it create the Brisk Menu category heading "Internet" (if missing, which in my case it is), and

  • how and where does it place that "*.desktop" file such that it is "plugged-in" to that Brisk Menu structure

for subsequent visibility when you press on the Roundel Icon on the Panel, and offer the newly added selection (Firefox) in the expected "pop-up" window-pane that lists all the "launchers" for the various installed Applications (in this case, specifically, Firefox)?



Under installed files for

  • mate-applet-brisk-menu

there is the following file listed:

  • /usr/share/dbus-1/services/org.mate.panel.applet.BriskMenuFactory.service

That "BriskMenuFactory" is a strong hint of something which I can't seem to locate when searching on "Description and Name" within Synaptic. :frowning:

1 Like

After you’ve installed the app, is their any reason you can’t use the “Menu Editor” tool Main Menu in the Control Center to create any missing categories and make the menu item? That would seem to be the highest level.

2 Likes

Thank you, Walter (?). I appreciate the suggestion. I was aware of that tool, and that I could do all the required edits and "customization" manually.

However, I don't want to do that, because that would imply requiring Users to replicate my attempts to "automate" tasks for a custom build (Ubuntu-Server + MATE Desktop + reduced User-selected set of Apps), then I will have to abandon the attempt to come up with at UbuntuMATE-like alternate that could step in if UbuntuMATE were to become "frozen", as a flavour, for lack of development.

Under UbuntuMATE, the process would somehow automatically add a missing category, then deposit the App-specific launcher in the required menu "slot".

I'm trying to find the specific mechanism I need to install as the first Application after the server OS base followed by the MATE Desktop install.

1 Like

Being easily prone to intriguing rabbit holes, I did a little research. (Disclaimer: I'm an amateur, so verify this info for yourself before you do something irreparable.)

It seems the various categories that appear in the menus differ slightly for each menu. For example, my Brisk menu has a top-level Administration category, but the Compact menu provides the Administration category as a cascaded second-level category under the System category.

Apparently, the structure (category-wise) of the various MATE menus is controlled by the ".menu" files in /etc/xdg/menus/. As I understand the process, these ".menu" definition files are created/installed by the mate-menus package. Can you check that this package has been installed?

Even when those ".menu" files exist, a particular application's ".desktop" file can override the menu category in which it will appear, or even prevent it from being shown at all. Do you know whether you get the same ".desktop" file regardless of whether Firefox is being installed on Ubuntu server or Ubuntu desktop, or is there a conditional branch in the installation process that installs one Firefox ".desktop" if the target is a server and another if the target is a desktop?

Evidently, installing MATE desktop on a non-desktop Ubuntu installation is more complex than I realized. It might be more reliable to start with a non-MATE Ubuntu desktop installation and then switch the DE to MATE, but that may not be compatible with your goals.

4 Likes

So, I've come across the reference to

  • /etc/xdg/menus/*.menu

Looking at the contents of those, I dug around and found various *.directory files located in

  • /usr/share/desktop-directories/
  • /usr/share/mate/desktop-directories/
  • /var/lib/menu-xdg/desktop-directories/menu-xdg/

Files in "/usr/share/desktop-directories" :

/usr/share/desktop-directories # grep '^Name=' *.directory

ActionGames.directory:Name=Action
AdventureGames.directory:Name=Adventure
ArcadeGames.directory:Name=Arcade
AudioVideo.directory:Name=Sound & Video
BlocksGames.directory:Name=Falling blocks
BoardGames.directory:Name=Board
CardGames.directory:Name=Cards
Debian.directory:Name=Debian
Development.directory:Name=Programming
Education.directory:Name=Education
Game.directory:Name=Games
GnomeScience.directory:Name=Science
Graphics.directory:Name=Graphics
Hardware.directory:Name=Hardware
KidsGames.directory:Name=Kids
LogicGames.directory:Name=Logic
lxde-audio-video.directory:Name=Sound & Video
lxde-debian.directory:Name=Debian
lxde-development.directory:Name=Programming
lxde-education.directory:Name=Education
lxde-game.directory:Name=Games
lxde-graphics.directory:Name=Graphics
lxde-hardware.directory:Name=Hardware
lxde-internet-and-network.directory:Name=Internet and Network
lxde-look-and-feel.directory:Name=Look and Feel
lxde-menu-applications.directory:Name=Applications
lxde-menu-system.directory:Name=System
lxde-network.directory:Name=Internet
lxde-office.directory:Name=Office
lxde-other.directory:Name=Other
lxde-personal.directory:Name=Personal
lxde-science-math.directory:Name=Science & Math
lxde-settings.directory:Name=Preferences
lxde-settings-system.directory:Name=Administration
lxde-system.directory:Name=System
lxde-system-tools.directory:Name=System Tools
lxde-utility-accessibility.directory:Name=Universal Access
lxde-utility.directory:Name=Accessories
matecc.directory:Name=Control Center
mate-screensaver.directory:Name=Screensavers
Network.directory:Name=Internet
Office.directory:Name=Office
Personal.directory:Name=Personal
RolePlayingGames.directory:Name=Role playing
Settings.directory:Name=Preferences
Settings-System.directory:Name=Administration
SimulationGames.directory:Name=Simulation
SportsGames.directory:Name=Sports
StrategyGames.directory:Name=Strategy
System.directory:Name=System
System-Tools.directory:Name=System Tools
Utility-Accessibility.directory:Name=Universal Access
Utility.directory:Name=Accessories
X-GNOME-Menu-Applications.directory:Name=Applications
X-GNOME-Other.directory:Name=Other
X-GNOME-Sundry.directory:Name=Sundry
X-GNOME-SystemSettings.directory:Name=System Settings
X-GNOME-Utilities.directory:Name=Utilities
X-GNOME-WebApplications.directory:Name=Web Applications

Files in "/usr/share/mate/desktop-directories" :

/usr/share/mate/desktop-directories # grep '^Name=' *.directory

mate-audio-video.directory:Name=Sound & Video
mate-collection.directory:Name=Collection
mate-development.directory:Name=Programming
mate-education.directory:Name=Education
mate-game.directory:Name=Games
mate-graphics.directory:Name=Graphics
mate-hardware.directory:Name=Hardware
mate-internet-and-network.directory:Name=Internet and Network
mate-look-and-feel.directory:Name=Look and Feel
mate-menu-applications.directory:Name=Applications
mate-menu-system.directory:Name=System
mate-network.directory:Name=Internet
mate-office.directory:Name=Office
mate-other.directory:Name=Other
mate-personal.directory:Name=Personal
mate-settings.directory:Name=Preferences
mate-settings-system.directory:Name=Administration
mate-system.directory:Name=System
mate-system-tools.directory:Name=System Tools
mate-utility-accessibility.directory:Name=Universal Access
mate-utility.directory:Name=Accessories

Files in "/var/lib/menu-xdg/desktop-directories/menu-xdg" :

/var/lib/menu-xdg/desktop-directories/menu-xdg # grep '^Name=' *.directory

debian-applications-accessibility.directory:Name=Accessibility
debian-applications-data-management.directory:Name=Data Management
debian-applications.directory:Name=Applications
debian-applications-editors.directory:Name=Editors
debian-applications-graphics.directory:Name=Graphics
debian-applications-network-communication.directory:Name=Communication
debian-applications-network.directory:Name=Network
debian-applications-network-file-transfer.directory:Name=File Transfer
debian-applications-network-web-browsing.directory:Name=Web Browsing
debian-applications-programming.directory:Name=Programming
debian-applications-science.directory:Name=Science
debian-applications-science-mathematics.directory:Name=Mathematics
debian-applications-shells.directory:Name=Shells
debian-applications-sound.directory:Name=Sound
debian-applications-system-administration.directory:Name=Administration
debian-applications-system.directory:Name=System
debian-applications-system-hardware.directory:Name=Hardware
debian-applications-system-monitoring.directory:Name=Monitoring
debian-applications-system-package-management.directory:Name=Package Management
debian-applications-system-security.directory:Name=Security
debian-applications-text.directory:Name=Text
debian-applications-video.directory:Name=Video
debian-applications-viewers.directory:Name=Viewers
debian-games-action.directory:Name=Action
debian-games.directory:Name=Games
debian-games-toys.directory:Name=Toys
debian-help.directory:Name=Help

What I don't know is those are pre-built as part of UbuntuMATE, pre-built as part of Ubuntu Desktop,

or

if there is/are package(s) that need to be installed to build those on the fly, based on the process of installing an Application such as Firefox, LibreOffice, Synaptic, Geany, etc.

:frowning:


As for context, I don't know why Ubuntu Server did not create the appropriate category in Brisk, nor, obviously, deposit the launcher for Firefox under the required/expected "Internet" category.

Could someone please clarify my next steps?

Also, again for the Ubuntu Server base, I did figure out that what was required was most of the "Ayatana" packages. I will try to determine what would be a "reasonable" minimum set that would be acceptable to all. So far, what I have is this, but I may reduce that set, unless others feel the is a need for all, and possibly more.

Package: ayatana-greeter-badges
Package: ayatana-indicator-application
Package: ayatana-indicator-common
Package: ayatana-indicator-datetime-common
Package: ayatana-indicator-display
Package: ayatana-indicator-keyboard
Package: ayatana-indicator-messages
Package: ayatana-indicator-notifications
Package: ayatana-indicator-power
Package: ayatana-indicator-session
Package: ayatana-indicator-sound
Package: ayatana-settings
Package: libayatana-appindicator3-1
Package: libayatana-common0
Package: libayatana-ido3-0.4-0
Package: libayatana-indicator3-7

Thank you in advance for any feedback, which can be either by posting a reply or a private message if that is preferred.

1 Like

Does xdg-desktop-menu help?

1 Like

I did a search in both GitHub projects,

and it found no references to "xdg-desktop-menu". :frowning:

I was hoping to locate where & how it was used for the Menu building at install-time of freshly downloaded/installed Applications.

Would you have any insights into that, Stephen ?

1 Like

Where do those files come from?

For the most part, the files in /etc/xdg/menus are installed as part of the operating system. You can always try the dpkg -S command to check if a file is part of an installed package.

For example I see:

user@host:~$ dpkg -S /etc/xdg/menus/*.menu

gnome-menus: /etc/xdg/menus/gnome-applications.menu
mate-menus: /etc/xdg/menus/mate-applications.menu
mate-control-center: /etc/xdg/menus/matecc.menu
mate-menus: /etc/xdg/menus/mate-preferences-categories.menu
mate-screensaver-common: /etc/xdg/menus/mate-screensavers.menu
mate-menus: /etc/xdg/menus/mate-settings.menu

There are also user specified menus here:

user@host:~$ ls ~/.config/menus

mate-applications.menu  mate-settings.menu

These are usually generated by user actions with a program like Brisk Menu or MATE Advanced Menu (I think). Other applications like WINE may also generate menu files.

You'll notice that those two user-specific files have corresponding files in the system-wide menus folder - and the contents of the files is clear about the relationship; for example ~/.config/menus/mate-settings.menu:

<?xml version="1.0" ?>
<!DOCTYPE Menu
  PUBLIC '-//freedesktop//DTD Menu 1.0//EN'
  'http://standards.freedesktop.org/menu-spec/menu-1.0.dtd'>
<Menu>
	<Name>Desktop</Name>
	<MergeFile type="parent">/etc/xdg/menus/mate-settings.menu</MergeFile>
</Menu>

You can use dpkg -S to get an idea where those .directory files come from, too, mostly the same applications that the .menus did as its all part of that ecosystem.

Installing desktop files and directories for all users

I think xdg-desktop-menu is what you want - it has two modes for installing these files: user and system.

You can write your own desktop (or directory) files, and then install them system-wide with:

# `--mode system` isn't needed when running as super-user, but let's be clear anyway:
sudo xdg-desktop-menu install --mode system <files>

Where is the "Internet" menu category defined?

On a Ubuntu MATE 24.04 install, it's found in /etc/xdg/menus/mate-applications.menu and also in /etc/xdg/menus/gnome-applications.menu. Why two places? Well I guess that's just life when there's fragmentation everywhere.

3 Likes

Thank you, Stephen. That information does seem to be related. I had looked at the XDG-related files, but did not find the actual mechanisms or triggers to perform the necessary updates/modifications to reflect newly-installed applications.


I did look at those, but the files on both images,

  • UbuntuMATE [config 1],   and
  • Ubuntu Server + MATE [config 2]

showed no differences, so, those don't seem to be the files that actually control what is presented in the Brisk menu ...

or

there is an as yet unidentified tool/service operating on those in order to dynamically create, on the fly, what is presented by Brisk. :frowning:


The file

  • /etc/xdg/menus/mate-settings.menu

is identical for both install configurations.


The file

  • /home/username/.config/menus/mate-applications.menu

exists on config 1, but does not exist on config 2 (server baseline). Interestingly, that only contains applications that are found under the "Internet" heading. None of those listed under the other headings are present, nor are the "structures" for defining the category headings (menu) nor for the sub-menus! Very curious!


I tried each of the following:

sudo xdg-desktop-menu install --novendor --mode system /usr/share/applications/firefox.desktop

and

sudo xdg-desktop-menu forceupdate --mode system

and lastly

sudo xdg-desktop-menu forceupdate --mode user

Unfortunately, none of those had any impact on the headings presented when we click on the Brisk roundel icon, nor the presentation of the Application-related launchers. :frowning:


Regrettably, that file is identical on both configurations.


That file does not exist on config 2 (server-base).

Examining the contents of the file on config 1 (UbuntuMATE), that file is not a one-to-one representation of the Brisk menu displayed when we click on the roundel icon. In fact, there are many Apps being displayed by Brisk not listed in that file! :frowning:

So, again, the mystery deepens.


I have not yet attempted to install all the applications I currently have with config 1, but I did expect to have Brisk show the "Internet" heading, with "Firefox" listed below that, which as seen below, is not the case.

Brisk Menu on server-base:



Brisk Menu on UbuntuMATE:

2 Likes

This sounds like you are expecting one file to define all the menus, directories, and applications? Because that's not at all how it works.

If Brisk Menu is using the XDG menu specification (correctly) then it will read many files in /etc/xdg/menus and in home folder locations (e.g. ~/.config/menus), then pool the menu, directory, and desktop files to get the complete picture.

I recommend you read the documentation as this will probably clear up a lot of things: Desktop Menu Specification.

The responsibility for constructing the menu, directory, and desktop files falls entirely on the application and the desktop. When an application is installed - it should be putting .desktop files in the correct place.

FWIW: BriskMenuFactory.service does not have anything to do with constructing menus - this is just how Brisk Menu is launched as a service (so if it crashes, it comes back up automatically).

3 Likes

Also - to add to the wrinkles, something like Firefox is usually deployed (on Ubuntu) as a snap.

And, not surprisingly, because snap always has to do things its own way, it doesn't put files in the usual system location. Have fun figuring that out - I'll give you hint:

echo $XDG_DATA_DIRS
2 Likes

From analyzing what I looked at, I am unble to identify the piece/code/component which is either triggering or doing the update of the Brisk Menu ... to make it display the Internet (or any other missing category) when I install an APP (in this case Firefox).

1 Like