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

Provide xdg-mime associations helper #4

Open
smarek opened this issue Sep 11, 2019 · 0 comments
Open

Provide xdg-mime associations helper #4

smarek opened this issue Sep 11, 2019 · 0 comments

Comments

@smarek
Copy link

smarek commented Sep 11, 2019

~/.local/share/applications/mvi.desktop

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Name=MVI
GenericName=Image Viewer
Exec=mpv --config-dir=USERHOME/.config/mvi/  %F
Terminal=false
Type=Application
Icon=image-viewer
StartupNotify=false
NoDisplay=true
Hidden=false
Categories=Graphics;Viewer;
MimeType=image/bmp;image/gif;image/jpeg;image/jpg;image/pjpg;image/png;image/tiff;image/xbmp;image/x-gray;image/x-icb;image/x-ico;image/x-icon;image/x-png;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-xpixmap;image/x-xbitmap;image/x-pcx;

And apply the MimeTypes through script-run

xdg-mime default ~/.local/share/applications/mvi.desktop (cat ~/.local/share/applications/mvi.desktop | grep MimeType | sed 's/MimeType=//' | tr ';' ' ')

Also providing install instruction in README would be useful, something along the lines

git clone --recursive https://github.com/occivink/mpv-image-viewer.git ~/.config/mvi
# be sure the path exists
mkdir -p ~/.local/share/applications/
cp ~/.config/mvi/mvi.desktop ~/.local/share/applications/
# .desktop file Exec path needs to be absolute
sed "s|USERHOME|$HOME|" ~/.local/share/applications/mvi.desktop
xdg-mime default ~/.local/share/applications/mvi.desktop (cat ~/.local/share/applications/mvi.desktop | grep MimeType | sed 's/MimeType=//' | tr ';' ' ')
update-desktop-database ~/.local/share/applications/
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