From 44ebf2a022f2d175f409dfcd1303ce3db6fed327 Mon Sep 17 00:00:00 2001 From: Marco Date: Fri, 5 Jul 2019 15:22:42 +0200 Subject: [PATCH] Added Linux spec file --- spec/Linux/Aretmis.spec | 35 ++++++++++++++++++++ spec/Linux/artemis3.svg | 39 ++++++++++++++++++++++ spec/Linux/create_shortcut.sh | 62 +++++++++++++++++++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100755 spec/Linux/Aretmis.spec create mode 100755 spec/Linux/artemis3.svg create mode 100644 spec/Linux/create_shortcut.sh diff --git a/spec/Linux/Aretmis.spec b/spec/Linux/Aretmis.spec new file mode 100755 index 0000000..e928de1 --- /dev/null +++ b/spec/Linux/Aretmis.spec @@ -0,0 +1,35 @@ +# -*- mode: python -*- + +block_cipher = None + +import glob, os + +data_file = [(f, '.') for f in glob.glob('*.[pu][yi]') if f != "artemis.py"] + +a = Analysis(['artemis.py'], + pathex=[os.getcwd()], + binaries=[], + datas=data_file, + hiddenimports=[], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='Artemis', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + runtime_tmpdir=None, + console=False) diff --git a/spec/Linux/artemis3.svg b/spec/Linux/artemis3.svg new file mode 100755 index 0000000..7626745 --- /dev/null +++ b/spec/Linux/artemis3.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spec/Linux/create_shortcut.sh b/spec/Linux/create_shortcut.sh new file mode 100644 index 0000000..c53a1d1 --- /dev/null +++ b/spec/Linux/create_shortcut.sh @@ -0,0 +1,62 @@ +clear +echo " + =================================== + Artemis 3 Shortcut Creator + LINUX + =================================== +" + +# Set the correct permissions for Artemis folder +echo "Gaining admin privileges and set folder read/write permission..." +echo "" +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +sudo chmod 700 $DIR + +# Generation of shortcut +file=/home/$USER/.local/share/applications/artemis.desktop +if [ -e "$file" ]; then + echo "A shortcut of Artemis 3 is already present:" + echo "" + echo "R) Remove the shortcut and the icon file" + echo "U) Update the shortcut" + echo "" + read -p "" doit + case $doit in + u|U) + echo "#!/usr/bin/env xdg-open" > /home/$USER/.local/share/applications/artemis.desktop + echo "[Desktop Entry]" >> /home/$USER/.local/share/applications/artemis.desktop + echo "Name=Artemis" >> /home/$USER/.local/share/applications/artemis.desktop + echo "StartupWMClass=artemis3" >> /home/$USER/.local/share/applications/artemis.desktop + echo "Exec=sh -c 'cd $DIR && ./artemis' " >> /home/$USER/.local/share/applications/artemis.desktop + echo "Terminal=False" >> /home/$USER/.local/share/applications/artemis.desktop + echo "Icon=artemis3" >> /home/$USER/.local/share/applications/artemis.desktop + sudo cp ./artemis3.svg /usr/share/icons/ + echo "Link Updated!" + ;; + r|R) + sudo rm /home/$USER/.local/share/applications/artemis.desktop + sudo rm /usr/share/icons/artemis3.svg + echo "Link and icon removed!" + ;; + *) echo "Sorry! Invalid option $REPLY";; + esac +else + echo "#!/usr/bin/env xdg-open" > /home/$USER/.local/share/applications/artemis.desktop + echo "[Desktop Entry]" >> /home/$USER/.local/share/applications/artemis.desktop + echo "Name=Artemis" >> /home/$USER/.local/share/applications/artemis.desktop + echo "StartupWMClass=artemis3" >> /home/$USER/.local/share/applications/artemis.desktop + echo "Exec=sh -c 'cd $DIR && ./artemis' " >> /home/$USER/.local/share/applications/artemis.desktop + echo "Terminal=False" >> /home/$USER/.local/share/applications/artemis.desktop + echo "Icon=artemis3" >> /home/$USER/.local/share/applications/artemis.desktop + sudo cp ./artemis3.svg /usr/share/icons/ + echo " + Link copied in: /home/$USER/.local/share/applications/artemis.desktop + Icon copied in: /usr/share/icons/artemis3.svg + " +fi + +echo " + ================================ + SETTING COMPLETE + ================================ +"