mlvwmrc icon indicating copy to clipboard operation
mlvwmrc copied to clipboard

Add tool to automatically generate applications submenu for Apple menu

Open morgant opened this issue 2 years ago • 1 comments

Currently, the Apple menu items need to be manually added per-theme. This can be tedious, especially after installing new applications and finding/making appropriate 16x16 XPM icons for applications that don't already have "styles" implemented in mlvwmrc. It'd helpful to have a tool that can automatically generate an application menu file to be included in the Apple menu.

There are some scripts out there that can automatically generate application menus for mlvwm, including:

Also, MenuMaker (python) could be updated to add mlvwm support.

morgant avatar Jan 08 '23 19:01 morgant

I still haven't actually looked into the scripts I linked to in this issue's description, but I have since written my own ffssb2mlvwmrc script that builds styles & menus for FFSSBs (Firefox-Specific Site Browsers). So, I'm pretty comfortable with the process now.

In looking at the location & format of *.desktop files -- on OpenBSD, at least -- I have the following notes:

  • X11 application *.desktop files are installed to /usr/local/share/applications/
  • User-specific *.desktop files (for example, those generated by ffssb) are installed to ~/.local/share/applications/
  • *.desktop file format:
    • We would only want to parse application details, so those under the [Desktop Entry] heading line
    • We would only want Type=Application
    • We probably want to use the Name= line's value, not GenericName=
    • The Categories= line's value contains semicolon-delimited category names, which could be useful for generating sub-folder/sub-menu groupings (they do seem to be inconsistent though)
    • The Icon= line's value is the name of the icon file name, less the type/extension, to search for
    • The Exec= line's value is the command to be executed (they can contain % substitution variables, which we'd just want to strip out)
  • Icons:
    • The icon files are installed to /usr/local/share/icons/ (it looks like the hicolor folder is the default we'd want to search first, especially /usr/local/share/icons/hicolor/16x16/apps/ and /usr/local/share/icons/hicolor/scalable/apps/)
    • User-specific icon files are installed to ~/.local/share/icons/ (similar structure to above)
    • While icons can be in *.xpm format, most are in .png or .svg, so would need to be converted to .xpm

morgant avatar Nov 20 '24 22:11 morgant