LibreOffice Extension: How to Bundle Icon Themes

Making LibreOffice more flexible is one of our primary goals announced with the MUFFIN concept. Extensions are a great way for personalization and just like we did for color palettes, we’ve now made icon themes available as extensions. This blog post describes how to create and share your own icon theme extension.

As an example, we are resurrecting the Oxygen icon theme that was removed in the 5.4 release because it was incomplete, missing a maintainer, and themed for KDE 4, which is no longer shipped by Linux distributions. However, the icon theme has many loyal friends using workarounds to bring it back. Here is the correct way to do it.

1. Collect the icons

LibreOffice has a clear structure of icons. For example, internal commands like .uno:Save load icons from the cmd/ folder found in an icon theme’s zip file. The folder using the name scheme sc_* for small 16x16px images, lc_* for 24x24px default images, and 32/* for 32x32px large images which are used in the menus and toolbars. Other icons that are used in dialogs, sidebar, etc. are found in different folders within the icon theme’s zip file. If an icon is not found in the theme, the icon from the fallback theme will be used.

2. Create the extension

Directory structure of the extension.

Figure 1: Directory structure of the extension.

An extension has a defined structure and requires particular files to make it function. The icon theme zip file is placed in the folder iconsets (you can share many icon themes in one extension, for example to support bright and dark system themes). You need a folder META-INF with a file manifest.xml that points to the actual config.xcu at the root. In this file you tell the extension manager where to place the content (has to be at %origin%/iconsets).

So far you can just use the example. But the file description.xml should receive more attention.

  • identifier value: Extensions are identified by this value. Enter a unique string here.
  • version: The first iteration starts usually with 1.
  • display-name: This string will be shown in the extension manager
  • dependencies: The feature to load icon sets from an extension requires Libreoffice 6.0 or higher.
  • publisher: Enter your name and a reference here, if wanted
  • icon: This icon will be shown in the extension manager
  • extension-description: The description is shown underneath the extension name

Finally, you pack everything into a zip file (make sure that config.xcu and description.xml are on the root level and folders are intact) and rename it into Oxygen-IconSet.oxt.

3. Publish your extension

Now everything is ready to share your extension. You can do it where ever you like, but we recommend to use our Extensions website, so it can reach all users of LibreOffice. Register at on the website, if you haven’t already, and follow the easy steps provided. Once you are done, make noise and let the community know about your contribution.

Extension manager with installed Oxygen icon theme.

Figure 2: Extension manager with installed Oxygen icon theme.

Many thanks to Caolán McNamara for implementing this awesome feature. Unfortunately the extension site is not ready for version 6.0. Meanwhile, if you run an alpha, beta or nightly build, please download the extension here.

Comments
  1. 4 weeks ago
    • 4 weeks ago
      • 4 weeks ago
        • 3 weeks ago
  2. 3 weeks ago

Leave a Reply

Your email address will not be published. Required fields are marked *