Treemacs: [Question] How to custom snakemake icon ?

Created on 2 Mar 2021  路  2Comments  路  Source: Alexander-Miller/treemacs

Treemacs, great tools, I like!

when I set:
elisp (defvar treemacs-custom-snakemake-icon (all-the-icons-icon-for-file "images/snakemake.png")) (treemacs-define-custom-icon treemacs-custom-snakemake-icon "smk" "snakefiles")
image
image

As shown in the figure above, the snakemake icon is not displayed correctly.
Can you help? Very much looking forward to your reply
Thanks~

Most helpful comment

The code you are using is working exactly as designed. all-the-icons-icon-for-file looks at the extension of the string you give it - in your case that ".png". So treemacs correctly shows all your .smk file with an image icon.

Using custom icons with images wasn't possible yet, I've just added the command for it, so you have to update. The code you need looks like this:

(treemacs-define-custom-image-icon "/path/to/your/icon.png" "smk" "snakefiles")

Note that treemacs expects icons to be exactly 22x22 pixels large.

All 2 comments

The code you are using is working exactly as designed. all-the-icons-icon-for-file looks at the extension of the string you give it - in your case that ".png". So treemacs correctly shows all your .smk file with an image icon.

Using custom icons with images wasn't possible yet, I've just added the command for it, so you have to update. The code you need looks like this:

(treemacs-define-custom-image-icon "/path/to/your/icon.png" "smk" "snakefiles")

Note that treemacs expects icons to be exactly 22x22 pixels large.

image
Good work, thanks very much~

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kenkangxgwe picture kenkangxgwe  路  9Comments

zoechi picture zoechi  路  6Comments

maxwedwards picture maxwedwards  路  3Comments

simurgh9 picture simurgh9  路  3Comments

zentetsukenz picture zentetsukenz  路  12Comments