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

Unable to create Chome-OS shortcut for non-containing *.desktop package #12

Open
mineshanya opened this issue Jun 21, 2023 · 0 comments

Comments

@mineshanya
Copy link

mineshanya commented Jun 21, 2023

I faced this problem when tried to add codium shortcut.

Carefully! The following actions might have negative side effects! Do at your own risk!

The thing is that crew-launcher search *.desktop existence in /usr/local/etc/crew/meta/*.filelist and doesn't check in default directories like /usr/local/share/applications/*.desktop.

So, as *.desktop wasn't created during initial package installation, crew-launcher throws an error:

chronos@localhost / $ crew-launcher add codium
Cannot find an '.desktop' file for codium :/

So, i created /usr/local/share/applications/codium.desktop file:

[Desktop Entry]
Name=VSCodium
GenericName=Programming Text Editor
Comment=Programming Text Editor
Exec=/usr/local/bin/codium
#Exec=/usr/local/VSCodium-linux-x64/bin/codium #Alternative path
Icon=/usr/local/VSCodium-linux-x64/resources/app/resources/linux/code.png
Terminal=false
Type=Application
Categories=Programming;
Keywords=VS;Coding;

Then I added this file entry to codium.filelist:

chronos@localhost / $ echo "/usr/local/share/applications/codium.desktop" >> /usr/local/etc/crew/meta/codium.filelist

And now the first error solved! But.........

Now I stucked at this point:
image

And at this point I faced a second trouble:
crew-launcher searchs icon again in *.filelist with pattern declared in *.desktop file plus 3 file extension variants.
In my case icon path in *.desktop was:

Icon=/usr/local/VSCodium-linux-x64/resources/app/resources/linux/code.png

And what crew-launcher tried to find in *.filelist:

/usr/local/VSCodium-linux-x64/resources/app/resources/linux/code.png.svg
/usr/local/VSCodium-linux-x64/resources/app/resources/linux/code.png.xpm
/usr/local/VSCodium-linux-x64/resources/app/resources/linux/code.png.png

U see? double *.png! So, after I stucked at "Add to launcher" button and canceled command via Ctrl+C i've got an another error:

chronos@localhost / $ crew-launcher add codium
Unable to find an icon :/

So, the last thing is to remove icon's file extension in *.desktop file:

chronos@localhost / $ nano /usr/local/share/applications/codium.desktop

And change this:

Icon=/usr/local/VSCodium-linux-x64/resources/app/resources/linux/code.png

To this:

Icon=/usr/local/VSCodium-linux-x64/resources/app/resources/linux/code

It breaks normal *.desktop behavior, but allows crew-launcher to successfully generate a shortcut.

And now everything works fine:
image
image

After all mentioned actions it might worth to revert *.filelist to it's initial state. But I left my changes as I think the whole effect would be in removing the manually created *.desktop during package removal, idk.

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

1 participant