Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new svg to the images.nss #580

Open
Assimilator-X opened this issue Dec 15, 2024 · 5 comments
Open

Adding new svg to the images.nss #580

Assimilator-X opened this issue Dec 15, 2024 · 5 comments

Comments

@Assimilator-X
Copy link

Anyone knows how to convert a 16x16 svg so i can add it to the images.nss file to reference it from?
If i try to use an svg file as menu icon it does not appear, if i am to use a built in then its working also a .png file working too.

@a4d8b3
Copy link
Contributor

a4d8b3 commented Dec 16, 2024

Its just a guess, but maybe the spec of svg you are trying to use is not supported by plutosvg.
Here is an example of Vim Devicon:

@vim_icon='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 128 128">
<defs>
    <path id="deviconVim0" d="M30.748 108.895h-7.509l-1.226-1.255V18.566h-6.436l-1.379-1.255v-5.436l1.226-1.255h37.544l1.379 1.115v5.297l-1.532 1.533h-7.049v47.952l42.6-43.213v-4.739H81.93l-1.226-1.255v-5.297l1.532-1.533h36.931l1.532 1.533v4.182l-89.951 92.699zm-7.355-.139h7.355l89.645-92.699v-4.043l-1.379-1.394H82.39l-1.379 1.394v5.018l1.226 1.115h6.589v5.158l-43.06 43.771V18.287h7.202l1.379-1.394v-5.158l-1.226-.976H15.577l-1.226 1.115v5.158l1.226 1.115h6.589v89.214l1.226 1.394z" />
</defs>
<path fill="#019833" d="M64.461 7.136L8.529 63.173l55.779 55.898l56.085-56.037z" />
<path d="M64.308 119.211L8.376 63.174l.153-.139L64.614 6.858l55.932 56.037l-.153.139zM8.682 63.174l55.626 55.759l55.932-55.898L64.614 7.276z" />
<path fill="#66fe98" d="M64.308 7.275V2.396L3.319 63.452h5.21z" />
<path d="M8.529 63.452H3.012l.153-.139L64.307 2.118v5.158L8.528 63.453zm-4.904-.139h4.75L64.154 7.276v-4.6z" />
<path fill="#45fe02" d="M64.154 7.275V2.396l60.989 61.056h-5.21z" />
<path d="M125.297 63.452h-5.517L64.001 7.415V2.257l.153.139zm-5.363-.139h4.75L64.308 2.675v4.6l55.626 56.037z" />
<path fill="#017d17" d="M64.308 119.35v4.879L3.319 63.313h5.21z" />
<path d="m64.308 124.508l-.153-.139L3.013 63.174H8.53l55.779 56.177v5.158zM3.625 63.313l60.529 60.638v-4.6L8.375 63.314z" />
<path d="M33.507 112.659H21.708l-4.597-2.649V22.608h-3.678l-3.065-3.067V9.923l3.218-3.485h41.221l3.678 3.764v9.061l-3.065 3.764h-3.065v28.995l29.269-28.995h-1.686l-3.371-3.624V9.785l3.371-3.067h41.528l3.218 3.346v9.061zm-10.573-4.461h8.735l88.725-91.026v-5.436l-.613-.697H81.625l-.613.558v5.855l.919.976h10.573L47.912 62.477V18.428h5.517l.766-.836v-5.576l-1.073-1.115H15.578l-.766.836v5.994l.46.558h6.436v89.074l1.226.836z" />
<path fill="#005d04" d="M64.154 119.35v4.879l60.989-61.056h-5.21z" />
<path d="M64.001 124.508v-5.158l55.779-56.177h5.517l-.153.139zm.306-5.158v4.6l60.529-60.638h-4.75l-55.779 56.037z" />
<path d="M63.848 125.065L1.94 63.173L64.002 1.002l61.908 61.892zM3.932 63.173l59.916 60.08l60.223-60.219l-59.916-60.08z" />
<path fill="#fefefe" d="m54.347 12.294l2.145-1.115l-2.299-2.23H14.657l-1.992 1.952v7.667l2.299 2.23l1.073-2.23l-1.379-1.394v-5.436l1.073-.976h37.85z" />
<path d="m14.965 20.936l-2.452-2.37v-7.667l2.145-2.091h39.689l2.452 2.37l-2.452 1.255l-.919-1.533h-37.85l-.919.836v5.297l1.379 1.394zm-2.145-2.509l2.145 2.091l.919-1.952l-1.379-1.394v-5.436l1.073-.976h37.85l.919 1.533l1.992-1.115l-2.145-2.091H14.658l-1.992 1.952v7.388z" />
<use href="#deviconVim0" />
<path fill="#fefefe" d="M22.014 18.288v89.214l1.226 1.255l-.919 1.673l-2.605-2.509V20.659z" />
<path d="m22.32 110.847l-2.758-2.649V20.657l2.605-2.509v89.493l1.226 1.394zm-2.452-2.788l2.452 2.37l.766-1.533l-1.073-1.255V18.567l-2.145 2.091v87.402z" />
<path fill="#808080" d="m15.731 18.288l-.613 2.091h4.75l2.605-2.091z" />
<path d="M19.868 20.657h-4.904l.766-2.37h7.202l-3.065 2.37zm-4.75-.279h4.597l2.299-1.952h-6.436z" />
<path fill="#fefefe" d="m81.47 20.797l1.073-2.23l-1.532-1.394v-4.739l1.686-1.812h36.471l1.379 1.812l1.992-1.394l-1.992-2.091H81.318l-1.992 1.952v7.667l2.145 2.23M49.597 57.459l-3.831 9.2l43.06-43.213v-5.158z" />
<path d="m45.919 66.937l-.153-.139l3.831-9.34l39.382-39.31v5.436l-43.06 43.352zm3.831-9.34l-3.524 8.782l42.6-42.795v-4.879zm31.72-36.801l-.153-.139l-1.992-1.952v-7.806l1.992-2.091h39.382l2.145 2.37l-2.145 1.533l-1.379-1.952H82.696l-1.686 1.673v4.739l1.532 1.394l-1.073 2.23zm-1.992-2.091l1.992 1.812l.919-1.952l-1.532-1.394v-4.879l1.839-1.812h36.624l1.379 1.812l1.839-1.255l-1.992-1.952H81.317l-1.839 1.952v7.667z" />
<path fill="#808080" d="m54.194 12.015l1.839-1.255v7.527l-2.145 2.23h-4.291v37.08l-3.831 9.2v-48.51h7.049l1.379-1.115v-5.158z" />
<path d="M45.919 66.798h-.153v-48.51h7.202l1.226-.976v-5.158l2.145-1.394v7.806l-2.299 2.23h-4.137v36.94l-3.984 9.061zm0-48.371V66.24l3.678-8.643V20.378h4.291l2.145-2.091v-7.249l-1.686 1.115v5.158l-1.379 1.115h-7.049z" />
<path fill="#ccc" d="m82.39 10.621l-1.379 1.394v5.158l1.226 1.255h6.436v5.018L45.766 66.798V18.427h7.049l1.532-1.394v-5.158l-1.379-.976h-37.39l-1.226 1.255v5.297l1.226 1.255h6.589v89.074l1.226 1.255h7.355l89.798-92.699v-4.043l-1.379-1.394H82.39z" />
<use href="#deviconVim0" />
<path fill="#808080" d="m120.7 12.154l1.992-1.115v7.109l-90.411 92.559h-9.654l.919-1.812h7.355l89.645-92.699l.153-4.043z" />
<path d="M32.281 110.847h-9.807l1.073-2.091h7.355l89.491-92.559l.153-4.043l2.145-1.255v7.527zm-9.501-.279h9.348l90.411-92.42v-6.97l-1.839.976l-.153 4.043l-89.645 92.838h-7.355z" />
<path fill="#808080" d="m88.673 18.427l-1.992 2.091h-5.21l1.226-2.091z" />
<path d="M86.681 20.657h-5.517l1.379-2.37h6.436zm-5.057-.139h5.057l1.839-1.952h-5.67z" />
<path fill="#ccc" d="M67.219 70.561s-.153 0-.153.139l-1.686 1.533l-.153.139l-1.686 4.879c0 .139 0 .279.153.418l1.379 1.394c.153.139.153.139.306.139h5.363c.153 0 .153 0 .306-.139l1.379-1.394l.153-.139l1.532-5.158c0-.139 0-.279-.153-.418l-1.226-1.115c-.153-.139-.153-.139-.306-.139h-5.21v-.139zm-9.961 13.8c-.153 0-.306.139-.306.279l-.613 2.649c0 .279.153.418.306.558h3.371l-7.815 22.303c0 .279 0 .418.306.558H64c.153 0 .306-.139.46-.279l.766-2.37c0-.279 0-.418-.306-.558h-2.758l7.815-22.582c0-.279 0-.418-.306-.558zm36.318.139c-.153 0-.153 0-.153.139l-2.299 2.649h-3.831l-2.452-2.649c0-.139-.153-.139-.306-.139h-9.194c-.153 0-.306.139-.306.279l-.766 2.509c0 .279 0 .418.306.558h2.605l-7.509 22.164c0 .279 0 .418.306.558h9.807c.153 0 .306-.139.306-.279l.766-2.091c0-.279 0-.418-.306-.558h-1.839l4.75-15.055h8.581l-5.517 17.564c0 .279 0 .418.306.558h9.347c.153 0 .306-.139.306-.279l.766-1.952c.153-.139 0-.418-.153-.558h-1.839l4.904-15.334h8.275l-5.517 17.564c0 .279 0 .418.306.558h10.267c.153 0 .306-.139.306-.279l.766-2.091c0-.279 0-.418-.306-.558h-2.145l6.13-19.934v-.418l-1.839-2.509c-.153-.139-.153-.139-.306-.139h-7.202c-.153 0-.153 0-.306.139l-2.299 2.509h-3.984l-2.299-2.649c-.153-.139-.153-.139-.306-.139h-6.13v-.139z" />
<path d="M63.848 111.683h-11.34c-.153 0-.306 0-.46-.139c-.766-.279-1.073-.976-.919-1.673l7.355-21.049h-2.145c-.766-.139-1.226-.976-.919-1.673l.613-2.649c.153-.558.46-.836 1.073-.976h12.259c.153 0 .306 0 .46.139c.766.279 1.073.976.919 1.673l-7.355 21.328h1.686c.766.279 1.073.976.919 1.673l-.766 2.37c-.306.558-.766.976-1.379.976zM59.864 86.87h1.379l-7.968 22.861h10.267l.46-1.255h-3.218l7.968-23.14H58.025l-.46 1.533zm53.48 24.534H102.77c-.766-.279-1.073-.976-.919-1.673l5.21-16.309h-6.283l-4.291 13.382h.306c.153 0 .306 0 .46.139c.766.279 1.073 1.115.766 1.812l-.766 1.952c-.153.558-.766.836-1.226.836h-9.654c-.766-.279-1.073-.976-.919-1.673l5.21-16.449h-6.743l-4.137 13.103h.306c.153 0 .306 0 .46.139c.766.279 1.073.976.919 1.673l-.766 2.23c-.153.558-.766.836-1.226.976h-9.654c-.153 0-.306 0-.46-.139c-.766-.279-1.073-.976-.919-1.673l7.049-20.91H74.42c-.153 0-.306 0-.46-.139c-.766-.279-1.073-.976-.919-1.673l.766-2.509c.153-.558.766-.976 1.226-.976h9.041c.306 0 .766.139.919.418l2.299 2.37h2.912l2.145-2.37c.153-.279.46-.418.766-.418h6.129c.306 0 .766.139.919.418l2.145 2.23h3.218l1.992-2.23q.46-.418.919-.418h7.202c.46 0 .766.139 1.073.558l1.839 2.509c.306.279.306.836.153 1.255l-5.67 18.679h.766c.153 0 .306 0 .46.139c.766.279 1.073.976.766 1.673l-.766 2.23c.153.418-.306.836-.919.836zM77.026 86.87h1.379l-7.662 22.582h8.428l.306-1.115h-2.145l5.363-17.006h10.573l-5.67 18.122h8.122l.306-.836h-2.145l5.517-17.146h10.267l-5.67 18.122h9.041l.46-1.115h-2.452l6.436-20.91l-1.532-2.091h-6.743l-2.452 2.649h-4.904l-2.452-2.788h-5.363l-2.452 2.788h-4.597l-2.605-2.788h-8.428l-.46 1.394h1.532zm-6.589-6.83h-5.363c-.306 0-.766-.139-.919-.418l-1.379-1.394c-.306-.418-.46-.976-.306-1.394l1.686-4.879c0-.279.153-.418.306-.558l1.686-1.533c.153-.139.306-.279.613-.279h5.21q.46 0 .919.418l1.226 1.115c.306.279.46.836.306 1.394L72.89 77.67c0 .279-.153.418-.306.558l-1.379 1.394c0 .279-.46.418-.766.418zm-5.976-2.788l.919.976h4.904l1.073-1.115l1.379-4.739l-.766-.697h-4.597l-1.532 1.255l-1.379 4.321z" />
<path fill="#ccc" d="m67.219 70.98l-1.686 1.533l-1.686 4.879l1.379 1.394h5.363l1.379-1.394l1.532-5.158l-1.226-1.115h-5.057zm-9.807 13.8l-.613 2.649h3.678l-7.968 22.861h11.34l.766-2.37H61.55l7.968-23.14zm36.164 0l-2.452 2.788h-4.137l-2.605-2.788h-9.041l-.766 2.509h2.912l-7.662 22.582h9.654l.766-2.091h-2.299l5.057-15.752h9.501l-5.67 17.982h9.194l.766-1.952h-2.299l5.057-16.17h9.041l-5.67 18.122h10.114l.766-2.091h-2.605l6.283-20.352l-1.839-2.509h-7.202l-2.452 2.649h-4.444l-2.452-2.788h-5.517z" />
<path d="M64.001 110.429H52.355l7.968-22.861h-3.678l.766-2.927H69.67l-8.122 23.14h3.065L64 110.43zm-11.34-.279h11.186l.613-2.23h-3.065l7.815-23H57.564l-.613 2.37h3.678l-7.968 22.861zm60.836 0h-10.42l5.67-18.122h-8.888l-5.057 15.891h2.299l-.919 2.23h-9.501l5.67-17.982h-9.194l-4.904 15.612h2.299l-.766 2.37h-9.807l7.662-22.582h-2.912l.919-2.649h9.194l2.605 2.788h3.984l2.452-2.788h5.976l2.452 2.788h4.291l2.452-2.649h7.355l1.992 2.649l-6.283 20.213h2.605zm-10.114-.279h9.961l.766-1.952h-2.605l6.283-20.491l-1.839-2.509h-7.202l-2.452 2.649h-4.444l-2.452-2.788h-5.67l-2.452 2.788h-4.291l-2.605-2.788h-8.888l-.766 2.23h2.912l-7.662 22.582h9.348l.613-1.952h-2.299l5.057-16.031h9.807l-5.67 17.982h9.041l.766-1.812h-2.145l5.21-16.309h9.348zM70.437 78.786H64.92l-1.379-1.394l1.839-5.018l1.839-1.533h5.057l1.226 1.255l-1.532 5.158l-1.532 1.533zm-5.363-.139h5.21l1.379-1.394l1.532-5.018l-1.073-1.115h-4.904l-1.686 1.394l-1.686 4.739l1.226 1.394z" />
</svg>'
item(title='Testing Vim' image=icon.vim_icon)

vim

By the way, image declaration can be made outside of image.nss too, like standard variables.

@Assimilator-X
Copy link
Author

Assimilator-X commented Dec 16, 2024

Interesting. I will keep trying. So far i had no luck with Affinity Designer 2 or Inkscape. I have left Adobe behind years ago. I could however attach a small .png as an icon. But it would be ideal if i can create my own images.nss but i cannot recognize this encoding that is in the images.nss anyway.

Thank you.

@RubicBG
Copy link
Collaborator

RubicBG commented Dec 16, 2024

@Assimilator-X
Copy link
Author

Thank you RubicBG, I am one of those, who keeps away from any social media sites for good reason.

@RubicBG
Copy link
Collaborator

RubicBG commented Dec 18, 2024

I understand you completely - I'm the same. I made an exception only because of Nilesoft Shell. I will make a detailed description after the holidays so that it is useful for everyone and I will share it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants