Updating mimetype name to x-logarithm-plot, using xdg commandline utilities when installing on linux.

This commit is contained in:
Ad5001 2021-07-25 22:17:29 +02:00
parent 1e73465f08
commit ee15835dbb
No known key found for this signature in database
GPG key ID: 9C87C7D3A69E6BBE
7 changed files with 32 additions and 26 deletions

View file

@ -19,12 +19,11 @@
APPROOT="$(cd -P "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
echo "Adding desktop file..."
mkdir -p ~/.local/share/applications
sed "s+ROOTFOLDER+$APPROOT/+g" "$APPROOT/linux/logarithmplotter.desktop" > ~/.local/share/applications/logarithmplotter.desktop
xdg-desktop-menu install "$APPROOT/linux/logarithmplotter.desktop"
echo "Installing mime-type..."
mkdir -p ~/.local/share/applications
sed "s+ROOTFOLDER+$APPROOT/+g" "$APPROOT/linux/x-logarithm-plotter-old.xml" > ~/.local/share/mime/packages/x-logarithm-plotter.xml
mkdir -p ~/.local/share/icons/hicolor/scalable/mimetypes
cp "$APPROOT/logplotterfile.svg" ~/.local/share/icons/hicolor/scalable/mimetypes/application-x-logarithm-plotter.svg
xdg-mime install "$APPROOT/linux/x-logarithm-plot.xml"
echo "Installing icons..."
xdg-icon-resource install --context mimetypes --novendor "$APPROOT/logplotterfile.svg" "application-x-logarithm-plot"
xdg-icon-resource install --context apps --novendor "$APPROOT/logplotter.svg" "logarithmplotter"
update-mime-database ~/.local/share/mime/
update-icon-caches ~/.local/share/icons/hicolor

View file

@ -19,12 +19,12 @@
APPROOT="$(cd -P "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
echo "Adding desktop file..."
mkdir -p ~/.local/share/applications
sed "s+ROOTFOLDER+$APPROOT/+g" "$APPROOT/linux/logplotter.desktop" > ~/.local/share/applications/logarithmplotter.desktop
sed "s+ROOTFOLDER+$APPROOT/+g" "$APPROOT/linux/logplotter.desktop" > "$APPROOT/linux/logarithmplotter-local.desktop"
xdg-desktop-menu install "$APPROOT/linux/logarithmplotter-local.desktop"
echo "Installing mime-type..."
mkdir -p ~/.local/share/applications
sed "s+ROOTFOLDER+$APPROOT/+g" "$APPROOT/linux/x-logarithm-plotter.xml" > ~/.local/share/mime/packages/x-logarithm-plotter.xml
mkdir -p ~/.local/share/icons/hicolor/scalable/mimetypes
cp "$APPROOT/logplotterfile.svg" ~/.local/share/icons/hicolor/scalable/mimetypes/application-x-logarithm-plotter.svg
xdg-mime install "$APPROOT/linux/x-logarithm-plot.xml"
echo "Installing icons..."
xdg-icon-resource install --context mimetypes --novendor "$APPROOT/logplotterfile.svg" "application-x-logarithm-plot"
xdg-icon-resource install --context apps --novendor "$APPROOT/logplotter.svg" "logarithmplotter"
update-mime-database ~/.local/share/mime/
update-icon-caches ~/.local/share/icons/hicolor

View file

@ -2,10 +2,15 @@
Version=1.0
Type=Application
Name=LogarithmPlotter
Comment=Plotter to make BODE diagrams, sequences and repartition functions.
Exec=/usr/bin/logarithmplotter %F
Icon=logplotter
MimeType=application/x-logarithm-plotter;
GenericName=2D plotter software
GenericName[fr]=Logiciel de traçage 2D
Comment=Create BODE diagrams, sequences and repartition functions.
Comment[fr]=Créer des diagrammes de BODE, des suites et des fonctions de répartition.
TryExec=logarithmplotter
Exec=logarithmplotter %f
Icon=logarithmplotter
MimeType=application/x-logarithm-plot;
Terminal=false
StartupNotify=false
Categories=Math

View file

@ -2,10 +2,12 @@
Version=1.0
Type=Application
Name=LogarithmPlotter
Comment=Plotter to make BODE diagrams, sequences and repartition functions.
Exec=/usr/bin/python3 ROOTFOLDER/run.py %F
Icon=ROOTFOLDER/logplotter.svg
MimeType=application/x-logarithm-plotter;
Comment=2D plotter software to make BODE diagrams, sequences and repartition functions.
Comment[fr]=Logiciel de traçage 2D pour les diagrammes de BODE, les suites et les fonctions de répartition.
Exec=/usr/bin/python3 ROOTFOLDER/run.py %f
Icon=logarithmplotter
MimeType=application/x-logarithm-plot;
Terminal=false
StartupNotify=false
Categories=Math

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/x-logarithm-plotter">
<mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/x-logarithm-plot">
<comment>Logarithm Plot File</comment>
<comment xml:lang="fr">Fichier Graphe Logarithmique</comment>
<icon name="application-x-logarithm-plotter"/>
<icon name="application-x-logarithm-plot"/>
<glob-deleteall/>
<glob pattern="*.json"/>
<glob pattern="*.lgg"/>

View file

@ -24,7 +24,7 @@
<array>
<dict>
<key>UTTypeIdentifier</key>
<string>eu.ad5001.x-logarithm-plotter</string>
<string>eu.ad5001.x-logarithm-plot</string>
<key>UTTypeReferenceURL</key>
<string>https://git.ad5001.eu/Ad5001/LogarithmicPlotter/wiki/LogarithmPlotter-file-format-v1.0</string>
<key>UTTypeDescription</key>
@ -58,7 +58,7 @@
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>eu.ad5001.x-logarithm-plotter</string>
<string>eu.ad5001.x-logarithm-plot</string>
</array>
</dict>
</array>

View file

@ -58,8 +58,8 @@ def package_data():
data_files = []
if sys.platform == 'linux':
data_files.append(('/usr/share/applications/', ['linux/logarithmplotter.desktop']))
data_files.append(('/usr/share/mime/packages/', ['linux/x-logarithm-plotter.xml']))
data_files.append(('/usr/share/icons/hicolor/scalable/mimetypes/', ['linux/application-x-logarithm-plotter.svg']))
data_files.append(('/usr/share/mime/packages/', ['linux/x-logarithm-plot.xml']))
data_files.append(('/usr/share/icons/hicolor/scalable/mimetypes/', ['linux/application-x-logarithm-plot.svg']))
data_files.append(('/usr/share/icons/hicolor/scalable/apps/', ['logplotter.svg']))
setuptools.setup(