From ee15835dbbf5b8b29ba173c870bc912295dceaf1 Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Sun, 25 Jul 2021 22:17:29 +0200 Subject: [PATCH] Updating mimetype name to x-logarithm-plot, using xdg commandline utilities when installing on linux. --- linux/install_after_setup.sh | 11 +++++------ linux/install_local.sh | 12 ++++++------ linux/logarithmplotter.desktop | 13 +++++++++---- linux/logplotter.desktop | 10 ++++++---- ...x-logarithm-plotter.xml => x-logarithm-plot.xml} | 4 ++-- mac/Info.plist | 4 ++-- setup.py | 4 ++-- 7 files changed, 32 insertions(+), 26 deletions(-) rename linux/{x-logarithm-plotter.xml => x-logarithm-plot.xml} (80%) diff --git a/linux/install_after_setup.sh b/linux/install_after_setup.sh index 798bed0..16489fc 100644 --- a/linux/install_after_setup.sh +++ b/linux/install_after_setup.sh @@ -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 diff --git a/linux/install_local.sh b/linux/install_local.sh index 3d8c54f..b940e8b 100644 --- a/linux/install_local.sh +++ b/linux/install_local.sh @@ -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 diff --git a/linux/logarithmplotter.desktop b/linux/logarithmplotter.desktop index 80afe81..791b897 100644 --- a/linux/logarithmplotter.desktop +++ b/linux/logarithmplotter.desktop @@ -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 diff --git a/linux/logplotter.desktop b/linux/logplotter.desktop index 6661f99..6637908 100644 --- a/linux/logplotter.desktop +++ b/linux/logplotter.desktop @@ -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 diff --git a/linux/x-logarithm-plotter.xml b/linux/x-logarithm-plot.xml similarity index 80% rename from linux/x-logarithm-plotter.xml rename to linux/x-logarithm-plot.xml index 130255a..3e62661 100644 --- a/linux/x-logarithm-plotter.xml +++ b/linux/x-logarithm-plot.xml @@ -1,9 +1,9 @@ - + Logarithm Plot File Fichier Graphe Logarithmique - + diff --git a/mac/Info.plist b/mac/Info.plist index 8cdeb37..f17f0cb 100644 --- a/mac/Info.plist +++ b/mac/Info.plist @@ -24,7 +24,7 @@ UTTypeIdentifier - eu.ad5001.x-logarithm-plotter + eu.ad5001.x-logarithm-plot UTTypeReferenceURL https://git.ad5001.eu/Ad5001/LogarithmicPlotter/wiki/LogarithmPlotter-file-format-v1.0 UTTypeDescription @@ -58,7 +58,7 @@ Owner LSItemContentTypes - eu.ad5001.x-logarithm-plotter + eu.ad5001.x-logarithm-plot diff --git a/setup.py b/setup.py index a639e07..8fc4c6c 100644 --- a/setup.py +++ b/setup.py @@ -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(