Created initial installation script for linux

This commit is contained in:
Luis Miguel Capacho V 2021-02-02 17:08:34 -05:00
parent c2f8395514
commit 67a66a405b
3 changed files with 55 additions and 0 deletions

35
distribution/install.sh Normal file
View File

@ -0,0 +1,35 @@
#!/bin/sh
# This script adds a menu item, icons and mime type for Digital for the current
# user. Based on Arduino install script.
RESOURCE_NAME=digital-simulator
SCRIPT_PATH=$( cd $(dirname $0) ; pwd )
cd "${SCRIPT_PATH}"
TMP_DIR=`mktemp --directory`
sed -e "s,<EXEC_LOCATION>,${SCRIPT_PATH}/Digital.sh,g" \
-e "s,<ICON_LOCATION>,${SCRIPT_PATH}/icon.svg,g" "${SCRIPT_PATH}/linux/desktop.template" > "${TMP_DIR}/${RESOURCE_NAME}.desktop"
mkdir -p "${HOME}/.local/share/applications"
cp "${TMP_DIR}/${RESOURCE_NAME}.desktop" "${HOME}/.local/share/applications/"
mkdir -p "${HOME}/.local/share/mime/packages"
cp "${SCRIPT_PATH}/linux/${RESOURCE_NAME}.xml" "${HOME}/.local/share/mime/packages"
rm "${TMP_DIR}/${RESOURCE_NAME}.desktop"
rmdir "${TMP_DIR}"
if [ -d "${HOME}/.local/share/applications" ]; then
if command -v update-desktop-database > /dev/null; then
update-desktop-database "${HOME}/.local/share/applications"
fi
fi
if [ -d "${HOME}/.local/share/mime" ]; then
if command -v update-mime-database > /dev/null; then
update-mime-database "${HOME}/.local/share/mime"
fi
fi

View File

@ -0,0 +1,11 @@
[Desktop Entry]
Type=Application
Name=Digital
Comment=Easy-to-use digital logic designer and circuit simulator
Exec=<EXEC_LOCATION>
Icon=<ICON_LOCATION>
Categories=Education;Electronics;
MimeType=text/x-digital;
Terminal=false
Keywords=simulator;digital;circuits;

View File

@ -0,0 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="text/x-digital">
<comment>Digital file</comment>
<comment xml:lang="en">Digital file</comment>
<comment xml:lang="es">Archivo Digital</comment>
<glob pattern="*.dig"/>
</mime-type>
</mime-info>