Adding icons to the FoxOS desktop

Steps to add icons to the FoxOS desktop

Issues i had to solve

image

There was 1 issue which i had to solve: The icon load failed every time for no reason. The image editor i used luna pain, said that the images were a valid BMP file, but the icons actually weren't. They were a PNG file. This was a huge problem, because the desktop was expecting a BMP file.

Solution

I saved the image as a PNG file and then converted it to a BMP file using this Makefile:

rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))

INP = $(call rwildcard,./,*.png)
OUT = $(patsubst %.png, %.bmp, $(INP))

all: $(OUT)

%.bmp: %.png
    @echo "CONV $^"
    @convert $^ -depth 24 BMP3:$@

A dirty hack

I currently launch programs using a dirty hack. The hack works like this:

This should be replaced with a proper launcher eventually. But this is a task for future me.

Where does the desktop load the icons from?

The desktop loads the icons from the <root_fs>/FOXCFG folder. The icons need to be named <program_name>.bmp.

The final result

The final result looks like this:

image

The icons from top to bottom are:

Take a look at the code over at github