How to change the icon of an extension to a normal icon reference?

I am using this extension to store backups of my documents automatically:

http://flowcont.hu/LO_oxt_store/

the icon is pretty dated and I want to make it use the default icon theme instead. Currently it is breeze, but I would prefer not to hardcode the icon in there, and instead refer to a different icon, I guess there will be some “special save” icon in the breeze theme.

Where is that theme stored? I am using the flatpak and could not find it in the flatpaks files, is this really a theme inherited from my system? (I am on Fedora Kinoite, with KDE Plasma).

and is it possible to replace the icon(s) of an extension with a reference to the themes default icon?

Also, is there an option to change extension icons in the Libreoffice settings? I could not find the icon, while I would expect something like a special toolbar “extensions” to be there.

Thanks!

Fedora 41
KDE Plasma Desktop with Breeze Icon theme
LibreOffice 25.2.0.3 Flatpak from Flathub

this would be the icon I would use, but I would prefer not to hardcode it into the theme, and instead use the default “lc_saveall” icon.

The .oxt files are zip archives really. If you rename it to .zip filename extension (before you install it), then you can browse the contents of the directories inside the extension. And you can change the icon files as you want it. Use same file names, and same file
types, and same pixel resolutions.
Finally rename the extension back to .oxt, and install it.

1 Like

yes I know. the question was

  • if I want to reuse a file from a theme, where do I find that theme? I use the flatpak, I looked at the “libreoffice breeze theme” github repo, and it is included somewhere in Libreoffice but I could not find it in the files
  • instead of hardcoding a theme icon, could I use a link to the default “save under” icon for example? So it would follow the standard active theme

if you can connect the dots … : icon-themes - OpenGrok cross reference for /core/icon-themes/

1 Like

In this case do NOT install the extension. Just copy the macro code from the .oxt (.zip) file into a Module of the Standard directory.
Then you will able to assign the main routine named “timeStampBackup” (and the others if you need them) to a toolbar, and then you will able to set/change the assigned icon by usage the Customize Toolbar feature of the office suite. (In this case you can use the actually installed/selected icon set of the LO.)

1 Like

Extract the extension to some temporary directory.
Tools>Macros>Organize>Basic…
Button [Organizer…]
Tab [Libraries]
Location “My Macros&Dialogs”
Button [Import…]
Navigate to the extracted extension and select either dialog.xlb or script.xlb.
Now you have imported only the StarBasic code and dialogs. Customize menus, toolbars and shortcuts to your liking.

3 Likes

Damn, nice workaround!

DISCLAIMER: Do not try this with more sophisticated extensions!

1 Like

Thanks @Villeroy here is how I did it:

Uninstall the extension if already installed

  1. rename the .oxt addon to .zip

  2. extract the archive and delete the original

  3. in libreoffice, open this dialog

  4. click on “manage” / “verwalten”

  5. go to tab “libraries” / “Bibliotheken”

  6. Click “Import”

  7. Import the “script.xlb” file which describes the VBA macro file

  8. Go to “Extras” “Customize” and select the main toolbar

  9. under “Categories” select “Macros” and search for the name of the macro file in the same fir as the “script.xlb” (in this case “timeStampBackup”

  10. use the right arrow button to add it, use the up/down arrows to arrange it

  11. click on the element, at the bottom select “Change” and “Replace icon”, search for something you like

image

now comes the hack

  1. remove the macro again, restart Libreoffice
  2. Reinstall the addon, restart Libreoffice

now the extension uses the icon you want, because the macro is controlled by it

1 Like

Hu? :thinking:

no idea but it worked.

The macro cannot be installed if the extension already places the same macro

and installing the extension gives some error when the macro is already there

for some reason, the macro itself also didnt work, I got some code errors. Meanwhile the extension works.

So I installed the macro manually, did the changes, removed it again, and installed the extension. The custom icon stays but it launches the extension and not the macro, so it works normally and should also update

There seems to be a shorter way to change the icon, since the addon places the timeStampBackup library in the My Macros container (tested on Windows 11 with 24.8.4.2 and 25.2.0.3):

  1. Install the extension.

  2. In the Customize dialog, add the timeStampBackup macro (timeStampBackup library, timeStampBackup module) to the Standard bar and choose the icon to your liking.

  3. remove the macro from the Assigned Commands list

  4. close the dialog

    recWin11

    The icon change appears to be permanent for Writer due to new entries in the user’s profile.
    E.g. in (...)\config\soffice.cfg\modules\swriter\images it may look like, in file lc_imagelist.xml

<image:entry image:bitmap-index="0" image:command="vnd.sun.star.script:timeStampBackup.timeStampBackup.timeStampBackup?language=Basic&amp;location=application"/>

However, adding and removing a similar item in the File menu does not change the icon of the Save and Timestamp-backup menu item.

2 Likes

+1 Internet point for the cool GIF