#!/bin/bash
cd $HOME
echo "Downloading..."
wget https://github.com/Itai-Nelken/Nativefier-WebApps/releases/download/v3.0/StackEdit-linux-arm64.tar.xz || error 'Failed to Download!'
echo "extracting..."
tar -xf StackEdit-linux-arm64.tar.xz || error "Failed to extract!"
echo "Renaming folder..."
mv ~/StackEdit-linux-arm64 ~/stackedit || error "Failed to rename folder!"
echo "Creating menu shortcut..."
echo "[Desktop Entry]
StartupNotify=true
Terminal=false
Type=Application
Name=StackEdit
Exec="$HOME/stackedit/StackEdit"
Path="$HOME/stackedit"
Icon="$HOME/pi-apps/apps/StackEdit/icon-64.png"
Categories=Development;IDE;" > ~/.local/share/applications/stackedit.desktop || error "Failed to create menu shortcut!"
rm -f StackEdit-linux-arm64.tar.xz
