EOS Custom Build - Problem with eos-save-icon-grid

In EOS version 4.03 I tried using the command eos-save-icon-grid command to save an icon grid layout and then do I custom build using that icon grid. The command generated a json file and, in my case, five directory files. I placed the above six files in the eos-image-builder/data/icon-grid folder and generated a custom build specifying the json file in local.ini. When I loaded the custom build most everything seemed to work but all the desktop folders were named “unnamed folder”.

It appears that a merge for the json file (which refers to the directory files by their long hexadecimal names) and the directory files which contain the correct folder names needs to occur.

Do I need to somehow do this merge manually before generating the custom build or is something broken in the process? Or do I need to somehow specify the directory files in my local.ini file?

Thanks,
Lou Voerman

1 Like

You need to ensure that the .directory files are installed to /usr/local/share/desktop-directories. There is apparently no built-in hook to do this. Looking at our internal config repo this tends to be done by saving a hook like this to hooks/image/51-desktop-folders.chroot:

TARGET_PATH=/usr/local/share/desktop-directories

mkdir -p ${TARGET_PATH}

cat <<EOF > ${TARGET_PATH}/folder-music.directory
[Desktop Entry]
Version=1.0
Name=Music
Name[es]=Música
Name[fr]=Musique
Type=Directory
EOF

Then arranging for this hook to be run as part of the image build:

[image]
hooks_add =
  51-desktop-folders.chroot

(Personally I think it would be nice to have a built-in hook to install a bunch of .directory files, or even bake this into the 63-icon-grid hook so that it would install any .directory files used as keys in any of the JSON files.)

The other option is to check whether suitable folders are already defined in /usr/share/desktop-directories, and use those in your .json file if so. If you can do this, it is probably preferable

The hook solution worked and I am able to create directories now. Thank you.

Note even with this directory creation solution, the new eos-save-icon-grid command is not very usable. If you issue the command on a “stock” system, it creates new directory files (with long hexadecimal names) rather than referring to the existing directories (such as “Utilities”, “Create”, “Coding Education” etc.). This makes the user have to do a great deal of manual editing to actually use the output of eos-save-icon-grid to build a new system image.

Thanks,
Lou Voerman

Thanks for the feedback – yes, I can see it’s not ideal, and the script could definitely do better.

The underlying problem is that, in historical versions of Endless OS, the JSON format was identical to the format used internally by the desktop. But since 3.9, the internal format changed, and so the conversion between the two formats is lossy. Ideally the file format used to specify the defaults would have a 1-1 mapping to the internal representation.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.