#!/bin/bash
rm -rf codex.zip codex codex-*-armv7l
wget https://github.com/ryanfortner/codex-arm/releases/download/v1.4.1/codex-1.4.1-arm64.zip -O codex.zip || error "Failed to download zip file!"
unzip codex.zip || error "Failed to unzip codex.zip!"
rm -f codex.zip
mv codex-*-arm64 codex

# Create desktop entry
echo "[Desktop Entry]
Name=Codex
Exec=$HOME/codex/Codex
Icon=${DIRECTORY}/apps/Codex/icon-64.png
Type=Application
Categories=Utility;
StartupNotify=true" > ~/.local/share/applications/codex.desktop
