mpv-image-viewer icon indicating copy to clipboard operation
mpv-image-viewer copied to clipboard

Provide xdg-mime associations helper

Open smarek opened this issue 6 years ago • 0 comments

~/.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/

smarek avatar Sep 11 '19 19:09 smarek