#!/bin/bash
mkdir -p ~/.ESign &&
cd ~/.ESign &&
wget https://sourceforge.net/projects/ufficiozero/files/3rd-party-software/eSign/eSign_V233_linux.tar.gz &&
tar -zxvf eSign_V233_linux.tar.gz
cd eSign
./eSign.bat

### creiamo il lanciatore
#get desktop folder
DESKTOP_FOLDER=$(xdg-user-dir DESKTOP)
echo 'desktop folder is' $DESKTOP_FOLDER

#current path
SCRIPT=$(realpath $0)
SCRIPT_FOLDER=$(dirname $SCRIPT)
echo 'current script path is' $SCRIPT_FOLDER

echo create desktop shotcut
		cat > $DESKTOP_FOLDER/esign.desktop <<- EOM
#!/usr/bin/env xdg-open
[Desktop Entry]
Name=E-Sign
Exec=$SCRIPT_FOLDER/Main/esign.bat
Comment=Firma digitale per notai
Terminal=false
PrefersNonDefaultGPU=false
Icon=$SCRIPT_FOLDER/Main/advanced/icon.png
Type=Application
Categories=Utility
EOM
chmod +x $DESKTOP_FOLDER/esign.desktop
