Dark Icon Theme (WIP)

Good day,

Not sure if the “Ideas” is the right category for this, though is the closest one :laughing:

With a dark theme for the windows:

Default icons are somewhat “harder?” to see? So instead of working on an SVG icon theme for Linux, I started to work on this:

And this is how it looks like compared to default using a “dark theme?”:

Which is an Icon theme for dark themes on Haiku. Now, I haven’t found anything regarding Icon themes. On HaikuDepot I found an “icon theme”, KDE’s Breeze and checked the .PackageInfo file, but nothing there.

Is there any doc on making icon themes? how to pack them? Any help will be appreciated.



These icon themes you mention are for ported GNU/Linux apps that don’t use our native API.
We don’t have a way to change icons in native apps because each app comes with its own icon in the resources and attributes, so they are not in a single folder which could be replaced easily.
I do have some ideas for ways to work around this but for now there’s no way to change icons. There’s a reason why it’s the only thing that’s not mentioned in Theme Manager.


Good day @mmu_man,

I’ve seen that some can be modified through the FileTypes preference, so maybe some FileType stuff would do, at least for the filetypes? though I presume there should be a better option. :thinking:

Thanks for the info though.

For me personally the icons are still very legible in the dark theme. Although that wasn’t a design goal it would be cool to change icons that are hard to see in dark mode. Just my 2 cents though

Although I’m not a big fan of the icon them you created, it’s nice to know there “would” be a way to change them :wink: Worked in the past on some icon themes for ZETA which (I might say) were pretty nice, but it was way easier back then :wink:

My plan was to hook into the icon API, by detecting which icon was passed (via some hash matching maybe), and replace them on-the fly from some other storage. But that wouldn’t work for apps which reuse icons as toolbar buttons for example, when those are directly stored as bitmaps in resources. Another possibility would be to just have some filters available to apply over the generated bitmap (like grayscale, gamma changes…), it wouldn’t change the shape of icons but allow for closer color matching with the theme.

Ideally it would be integrated in some way in the ControlLook, but I don’t remember if it’s implemented in libbe or some other lib (libtracker?). A temporary option would be to use LD_PRELOAD.

For HVIF icons maybe there would be a way to override the stroke outline color either in the icon data or while rendering, which could improve how the icons look on dark themes. Though I don’t know if there is any consistency in the name of that style in the various icons. Though that could may be fixed with a bunch of icon updates.

That still doesn’t solve the problem of completely replacing an icon though. But that can probably be done in a reasonable way given this is Haiku and not Linux.

Since the final HVIF data looses names it wouldn’t be as easy. Although, maybe something as simple as checking if the first style is a plain black color would be enough?

Just sharing (few icon themes I did back then for ZETA) :slight_smile:




I think we would have to check a bunch of icons but I don’t know if the main outline color is pure black (that is generally a bad idea to use pure black) but it would certainly be dark. There also is no guarantee it is the first style, but it would be a good guess for our standard icons to find the first single color style that is the darkest.

It would be fun to experiment with tweaking this to see what happens.

I really love our icons, the design but especially the implementation. I started a Rust HVIF parser but did not quite finish it. I should get back on that someday. On a related note are there any tools to dump the information in an HVIF icon into a human readable format to check things like the styles and their order, etc?

Interesting, I would have thought of intercepting at the GetTrackerIcon level instead, which is more specific and allows access to the inode of the file from which the icon would be loaded. I expect most of the icons we want to theme should get through there?

why not porting existing better look icon theme compatible with dark mode, i vote for numix

hey, when i want replace icons in haiku i must download source code replace svg files, compile haiku make image and so… right?

Haiku dont use svg icons

For me, the current icons works very well in dark mode as well, no complaints there. Maybe the selected background colour doesn’t work well with the general icon colours.

Yeah this one at least, but some apps probably use older/other ways like fetching from resources and converting them to bitmap manually.

Good day,

The point of this Icon theme is to get more and better knowledge of some desing stuff. I didn’t know plenty of these when I first made the LibreOffice icon, if so, it would be better.

While it seems that the right way to add an icon as attribute to a file with the addattr command, I did a test:

I created two folders, and listed their attributes to compare. Then added the personalized icon by both methods, addattr and resattr:

Resulting in the same output. Then again, the .rdef file used as source for the icon attribute only has the “resource vector_icon” line. This has to be modified manually as Icon-O-Matic adds other stuff there in the line that makes the conversion to .rsrc not to work (rc iconfile.rdef throws an error that the rdef file is not “clean”).

So, if keeping only the icon inside the .rdef file, the result seems to be the same (correct me if I’m wrong on this) wether I use addattr or resattr. I know I still need more knowledge on the .rdef file format for preparing executables prior to packaging, I’m on it.

Now, why this? Because modifying the .hvif does not seem to be so straightforward as the file looses all ids from paths, shapes and styles, thus making it hard to change anything inside the .hvif. I found a way to circumvent this for the Gamejectder program, in order to set project folder’s color randomly each time a new project is created by doing this:

On the left, I have the .rdef file with just the icon info. On the right, the Python script that changes the color of the folder. In order to achieve this behaviour, instead of using gradients for the folder icon, I used a solid color as a base, and added a layer on top with a black to transparent gradient. The solid color used had nothing to do with the other colors involved in the icon, therefore I can fetch its hex code “easily” from the .rdef file and substitute it with another color, its hex code randomly picked from a range that does not use white nor black nor some colors close to those two from the hex range.
With the modified color .rdef file, I created a new .rsrc that I use to change the icon of each folder that I create within the project folder.

As I don’t know yet so much about Haiku, I just thought that this could be a way to easily modify the outline of an icon, from black to whatever color. It can be automated as I did with the Python script.

On the other hand, this seems to work with files and folders, all but those that are readonly in the Haiku OS. I can’t change the icons of the /boot/home/config, /boot/home/Desktop, /boot/home, nor any disk… :crazy_face:
Then again, I did the same test on Godot software for Haiku. I used version 3.2.2 which has a default Haiku application icon, the 3 cubes. I unpackaged the .hpkg got the executable file and added the icon with resattr, though I didn’t check the attributes before and after to certify that the original attributes stay the same but the icon one. Homework to do. Then I repackaged the software and installed it, and voila, the icon appeared on the Deskbar (check here).

So it’s doable (changing icons), though it’s hard, and only where the OS is not readonly. I don’t see users unpackaging each .hpkg and modifying its icon one by one… :rofl:

I’m sure there will be a better way soon. If you know any now, let me know too :wink:


Yes this won’t work on packaged apps.

I suppose the application Filetypes settings don’t work for packaged apps, such as changing the icon?

I feel like we have a few problems related to the package system, such as this and the issue where Tracker cannot save the settings for read-only folders. They almost seem kind of related so maybe there could be some kind of general solution, likely involving files stored somewhere writeable such as somewhere under ~/config. I have somewhat of a plan I want to try for Tracker at least.

1 Like

Hvif is an export format. You should save your icons in the native icon-o-matic format if you want to preserve the object names, and convert to hvif only when you are done and want to set the icon.

On resources and attributes: Tracker normally gets its data (including icons) from attributes. For this, addattr is enough. However, attributes are stored in a special way in the filesystem and tend to get lost easily (when downloading a file using http or ftp, when putting it in a tar archive, when storing it in a fat32 partition, or even when using tools like cp to copy a file)

For this reason, executables (but not other types of files) also have their icon stored in a resource. Resources are stored inside the file and survive most cases where attributes are removed. Resattr sets both the resource and the attribute, while addattr only sets the attribute.

I hope this clears up things a bit.