-
Notifications
You must be signed in to change notification settings - Fork 136
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
Add information on mimetypes #115
Comments
flatpak/flatpak@3e9bc8b |
I've looked at both of those links. There's nothing documented about where mimetypes should be installed, specifically. The XDG guidelines can't be followed in this case, because of this case: /usr/share/icons/hicolor/scalable/mimetypes/aMIMEicon.svg can't be used, /usr/ is read-only.
The documentation should be as verbose and thorough regarding mimetypes and their icons as it is with desktop files and application icons. |
Commonly its just that you forget to rename the contents of the mimetype file while renaming the actual icon. Honestly I think |
I have text-slim.svg and <icon name="text-slim.svg"/> in the XML.
It also doesn't explain why Flatpak decided to use the mimetype icon for
the application once one was present.
Would you mind sharing a worked example? I've honestly spent six hours
trying to determine the correct way to do it.
…On Sun., May 2, 2021, 9:55 a.m. Patrick, ***@***.***> wrote:
Files of the new mimetype, which is properly applied to files with the
glob pattern aren't given the icon.
Commonly its just that you forget to rename the contents of the mimetype
file while renaming the actual icon.
Honestly I think flatpak gaining a new property to rename these for
projects would be really nice.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#115 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMMRAZNO3OGZKI3VV64WQN3TLVYY3ANCNFSM4E2M7RLA>
.
|
For the sake of clarity, here's the manifest I have right now. Where the documentation says that desktop entry files and application icons should be installed in FreeDesktop-spec subdirectories of /app/share, I make the assumption that mimetype files should be installed similarly, and that mimetype icons can be placed in the /mimetypes/ subdirectory of /hicolor/scalable. Making the documentation verbose won't hurt. app-id: org.messerlab.slimgui
runtime: org.kde.Platform
runtime-version: '5.15'
sdk: org.kde.Sdk
finish-args:
- --socket=wayland
- --socket=x11
- --share=ipc
- --device=dri
- --socket=pulseaudio
- --share=network
- --filesystem=host
- --talk-name=com.canonical.AppMenu.Registrar # required for global menu
- --talk-name=org.freedesktop.Flatpak # allows spawning processes on the host via flatpak-spawn --host
- --env=PKG_CONFIG_PATH=/app/lib/pkgconfig:/app/share/pkgconfig
command: SLiMgui
modules:
- name: SLiMgui
builddir: true
buildsystem: cmake
config-opts:
- -DBUILD_SLIMGUI=ON
- --debug-output
sources:
- type: git
url: https://github.com/MesserLab/SLiM.git
tag: "v3.6"
commit: 978622ebc1a0326f91d1cee35fd91e1e0f4e0c92
post-install:
# Colourful and Symbolic Application Icons
- sed -i '69,166 s/"fill:#[[:alnum:]]*"/"fill:#ffffff"/' ../QtSLiM/icons/AppIcon16.svg
- sed -i '62,68 d' ../QtSLiM/icons/AppIcon16.svg
- install --mode=0644 -D --no-target-directory ../QtSLiM/icons/AppIcon64.svg /app/share/icons/hicolor/scalable/apps/org.messerlab.slimgui.svg
- install --mode=0644 -D --no-target-directory ../QtSLiM/icons/AppIcon16.svg /app/share/icons/hicolor/symbolic/apps/org.messerlab.slimgui-symbolic.svg
# slim Mimetype
# Line 6 in original org.messerlab.slimgui-mime.xml
# <generic-icon name="/usr/share/icons/hicolor/scalable/mimetypes/text-slim.svg"/>
- sed -i '6 s,usr,app,' ../org.messerlab.slimgui-mime.xml
- sed -i '6 s,mimetypes/text-slim.svg,mimetypes/org.messerlab.slimgui-text-slim.svg,' ../org.messerlab.slimgui-mime.xml
- install --mode=0644 -D --no-target-directory ../org.messerlab.slimgui-mime.xml /app/share/mime/packages/org.messerlab.slimgui-mime.xml
- install --mode=0644 -D --no-target-directory ../QtSLiM/icons/DocIcon.svg /app/extra/export/share/icons/hicolor/scalable/mimetypes/org.messerlab.slimgui-text-slim.svg
# Desktop Entry and Appstream XMLs
- desktop-file-edit --remove-key=Exec ../org.messerlab.slimgui.desktop
- desktop-file-edit --set-key=Exec --set-value='SLiMgui %f' ../org.messerlab.slimgui.desktop
- desktop-file-install --mode=0644 --dir=/app/share/applications/ ../org.messerlab.slimgui.desktop
- appstream-util validate-relax ../org.messerlab.slimgui.appdata.xml
- install --mode=0644 -D ../org.messerlab.slimgui.appdata.xml --target-directory /app/share/metainfo/ |
It must be prefixed with $APP_ID. Like |
Also anything with a full path is probably just broken. Things should rely on icon theme names. |
Thanks! I'll change from:
org.messerlab.slimgui-text-slim.svg, to
org.messerlab.slimgui.text-slim.svg.
I'll test the change and let you know if I have any more problems.
Regards,
Bryce Carson.
…On Mon., May 3, 2021, 12:10 p.m. Patrick, ***@***.***> wrote:
I have text-slim.svg and in the XML.
It must be prefixed with $APP_ID. Like org.messerlab.slimgui.text-slim.svg
.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#115 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMMRAZNOW5E3VETBOUVZLWTTL3RKVANCNFSM4E2M7RLA>
.
|
The mime XML now reads: <generic-icon name="org.messerlab.slimgui.text-slim.svg"/> and the icon is named What is the exact place I should store the mimetype icon, such that it is exported to the correct location and applied? Note that I am manipulating and installing this icon and the mimetype itself in |
The path seems fine. You can see the exact files exported in |
I'll note here that separating the prefix and icon name with a 'Full Stop' ( # slim Mimetype
- sed -i '6 s,<generic-icon name="/usr/share/icons/hicolor/scalable/mimetypes/text-slim.svg"/>,<generic-icon name="org.messerlab.slimgui-text-slim"/>,' ../org.messerlab.slimgui-mime.xml
- install --mode=0644 -D --no-target-directory ../org.messerlab.slimgui-mime.xml /app/share/mime/packages/org.messerlab.slimgui-mime.xml
- install --mode=0644 -D --no-target-directory ../QtSLiM/icons/DocIcon.svg /app/share/icons/hicolor/scalable/mimetypes/org.messerlab.slimgui-text-slim.svg This only worked when installing the mime icon to the path above, the earlier path I referred to, In my opinion, a paragraph on mimetype icons should be included in the flatpak-docs. I would write one up and submit a pull request, but I'm not confident in my knowledge when it comes to Flatpak, not at all. Thanks for your help, regardless, @TingPing. |
Mime types ought to be listed in conventions.rst. These files need to be named with the app ID.
See flatpak/flatpak#1572 for background.
The text was updated successfully, but these errors were encountered: