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
<?xml version='1.0' encoding='UTF-8'?>
  <description
	xmlns="http://openoffice.org/extensions/description/2006"
	xmlns:dep="http://openoffice.org/extensions/description/2006"
	xmlns:lo="http://libreoffice.org/extensions/description/2011"
	xmlns:xlink="http://www.w3.org/1999/xlink">
	<identifier value="org.iconset.Oxygen"/>
	<version value="1.0.0"/>
	<display-name name="Oxygen Icon Set"/>
	<dependencies>
		<lo:LibreOffice-minimal-version d:name="LibreOffice 6.0" value="6.0"/>
	</dependencies>
	<publisher>
		<name xlink:href="https://wiki.documentfoundation.org/Design">The LibreOffice Design Team</name>
	</publisher>
	<icon>
		<default xlink:href="icons/Oxygen-Theme.png"/>
	</icon>
	<extension-description>
		<src xlink:href="pkg-desc/pkg-description.txt" />
	</extension-description>
  </description>

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. 7 years ago
    • 7 years ago
      • 7 years ago
        • 7 years ago
  2. 7 years ago
  3. 7 years ago

Discover more from LibreOffice Design Team

Subscribe now to keep reading and get access to the full archive.

Continue reading