sdgui: add a MIME-associated desktop file

Neither StarDict nor shared-mime-info have their own MIME DB file.
This commit is contained in:
Přemysl Eric Janouch 2021-10-16 09:00:31 +02:00
parent c0a094e473
commit 33e98881ad
Signed by: p
GPG Key ID: A0420B94F92B9493
3 changed files with 22 additions and 0 deletions

View File

@ -198,6 +198,10 @@ install (TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
install (FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR}) install (FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
if (WITH_GUI) if (WITH_GUI)
install (TARGETS sdgui DESTINATION ${CMAKE_INSTALL_BINDIR}) install (TARGETS sdgui DESTINATION ${CMAKE_INSTALL_BINDIR})
install (FILES sdgui.desktop
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
install (FILES sdgui.xml
DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages)
endif () endif ()
foreach (page ${project_MAN_PAGES}) foreach (page ${project_MAN_PAGES})

8
sdgui.desktop Normal file
View File

@ -0,0 +1,8 @@
[Desktop Entry]
Type=Application
Name=sdgui
GenericName=StarDict GUI
Exec=sdgui %F
StartupNotify=true
MimeType=application/x-stardict-ifo;
Categories=Office;Dictionary;GTK;

10
sdgui.xml Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-stardict-ifo">
<comment>StarDict dictionary main file</comment>
<magic>
<match type="string" offset="0" value="StarDict's dict ifo file"/>
</magic>
<glob pattern="*.ifo"/>
</mime-type>
</mime-info>