diff --git a/packages/ayva/VERSION b/packages/ayva/VERSION new file mode 100644 index 0000000..d3827e7 --- /dev/null +++ b/packages/ayva/VERSION @@ -0,0 +1 @@ +1.0 diff --git a/packages/ayva/install.sh b/packages/ayva/install.sh new file mode 100644 index 0000000..52b19a2 --- /dev/null +++ b/packages/ayva/install.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +# Exit script on any error +set -e + +echo "Starting installation..." + +# Ensure git and python3-pip are installed +if ! command -v git &> /dev/null; then + echo "Git is not installed. Please install Git and rerun this script." + exit 1 +fi + +if ! command -v python3 &> /dev/null; then + echo "Python3 is not installed. Please install Python3 and rerun this script." + exit 1 +fi + +if ! command -v pip3 &> /dev/null; then + echo "pip3 is not installed. Please install pip3 and rerun this script." + exit 1 +fi + +# Variables +REPO_URL="https://github.com/maybe-asdf/yaergu-ayva/" +DEST_DIR="$HOME/yaergu-ayva" +HIDDEN_DIR="$HOME/.ayva" +DESKTOP_FILE="ayva.desktop" +APPLICATIONS_DIR="$HOME/.local/share/applications" +BINARY_PATH="/usr/bin/ayva" +VENV_DIR="$HIDDEN_DIR/venv" + +# Clone the repository +echo "Cloning repository into $HOME..." +git clone "$REPO_URL" "$DEST_DIR" + +# Move the desktop file +echo "Moving $DESKTOP_FILE to $APPLICATIONS_DIR..." +mkdir -p "$APPLICATIONS_DIR" +mv "$DEST_DIR/$DESKTOP_FILE" "$APPLICATIONS_DIR" + +# Move the binary file +echo "Making ayva usable..." +sudo mv "$DEST_DIR/ayva" "$BINARY_PATH" + +# Rename the repository folder +echo "Renaming $DEST_DIR to $HIDDEN_DIR..." +mv "$DEST_DIR" "$HIDDEN_DIR" + +# Create virtual environment +echo "Creating virtual environment..." +python3 -m venv "$VENV_DIR" + +# Activate virtual environment and install packages +echo "Installing dependencies..." +source "$VENV_DIR/bin/activate" +pip install vosk pyaudio + +# Deactivate the virtual environment +deactivate + +exit 0 diff --git a/packages/ayva/remove.sh b/packages/ayva/remove.sh new file mode 100644 index 0000000..fd5d37b --- /dev/null +++ b/packages/ayva/remove.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# Exit script on any error +set -e + +echo "Starting uninstallation..." + +# Variables +REPO_URL="https://github.com/maybe-asdf/yaergu-ayva/" +DEST_DIR="$HOME/yaergu-ayva" +HIDDEN_DIR="$HOME/.ayva" +DESKTOP_FILE="ayva.desktop" +APPLICATIONS_DIR="$HOME/.local/share/applications" +BINARY_PATH="/usr/bin/ayva" +VENV_DIR="$HIDDEN_DIR/venv" + +# Remove the binary file +echo "Removing the ayva binary from $BINARY_PATH..." +sudo rm -f "$BINARY_PATH" + +# Remove the desktop file +echo "Removing $DESKTOP_FILE from $APPLICATIONS_DIR..." +rm -f "$APPLICATIONS_DIR/$DESKTOP_FILE" + +# Remove the virtual environment +echo "Removing virtual environment at $VENV_DIR..." +rm -rf "$VENV_DIR" + +# Remove the repository folder +echo "Removing $HIDDEN_DIR directory..." +rm -rf "$HIDDEN_DIR" + +# Optionally, you can remove the repository clone directory if it exists +if [ -d "$DEST_DIR" ]; then + echo "Removing $DEST_DIR directory..." + rm -rf "$DEST_DIR" +fi + +exit 0 diff --git a/packages/ayva/update.sh b/packages/ayva/update.sh new file mode 100644 index 0000000..845eac5 --- /dev/null +++ b/packages/ayva/update.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +# Exit script on any error +set -e + +echo "Starting update..." + +# Variables +REPO_URL="https://github.com/maybe-asdf/yaergu-ayva/" +DEST_DIR="$HOME/yaergu-ayva" +HIDDEN_DIR="$HOME/.ayva" +DESKTOP_FILE="ayva.desktop" +APPLICATIONS_DIR="$HOME/.local/share/applications" +BINARY_PATH="/usr/bin/ayva" +VENV_DIR="$HIDDEN_DIR/venv" + +# Check if the repository directory exists +if [ ! -d "$HIDDEN_DIR" ]; then + echo "The repository directory does not exist. Please install the software first." + exit 1 +fi + +# Navigate to the hidden repository directory +cd "$HIDDEN_DIR" + +# Pull the latest changes from the repository (without checking for changes) +echo "Pulling latest changes from the repository..." +git pull origin main + +# Reinstall dependencies in the virtual environment +echo "Reinstalling dependencies..." +source "$VENV_DIR/bin/activate" +pip install --upgrade vosk pyaudio + +# Rebuild or refresh the binary if necessary +if [ -f "$DEST_DIR/ayva" ]; then + echo "Reinstalling the ayva binary..." + sudo mv -f "$DEST_DIR/ayva" "$BINARY_PATH" +else + echo "No ayva binary found, skipping installation." +fi + +# Update the desktop entry (if any change is detected) +if [ -f "$DEST_DIR/$DESKTOP_FILE" ]; then + echo "Updating desktop entry..." + mv -f "$DEST_DIR/$DESKTOP_FILE" "$APPLICATIONS_DIR" +else + echo "No changes detected for the desktop entry." +fi + +exit 0 diff --git a/packages/calc/VERSION b/packages/calc/VERSION deleted file mode 100644 index d6f1eb0..0000000 --- a/packages/calc/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.1 \ No newline at end of file diff --git a/packages/calc/install.sh b/packages/calc/install.sh deleted file mode 100644 index 411bd07..0000000 --- a/packages/calc/install.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -echo "Installing calc package..." -# Add installation logic here -exit 0 \ No newline at end of file diff --git a/packages/calc/remove.sh b/packages/calc/remove.sh deleted file mode 100644 index a09ec72..0000000 --- a/packages/calc/remove.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -echo "Removing calc package..." -# Add removal logic here -exit 0 \ No newline at end of file diff --git a/packages/calc/update.sh b/packages/calc/update.sh deleted file mode 100644 index c443244..0000000 --- a/packages/calc/update.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -echo "Updating calc package..." -# Add update logic here -exit 0 \ No newline at end of file diff --git a/packages/notepad/VERSION b/packages/notepad/VERSION deleted file mode 100644 index 7ea0bc4..0000000 --- a/packages/notepad/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.0 diff --git a/packages/notepad/install.sh b/packages/notepad/install.sh deleted file mode 100644 index c3684b3..0000000 --- a/packages/notepad/install.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -echo 1 -exit 1 diff --git a/packages/notepad/remove.sh b/packages/notepad/remove.sh deleted file mode 100644 index a9bf588..0000000 --- a/packages/notepad/remove.sh +++ /dev/null @@ -1 +0,0 @@ -#!/bin/bash diff --git a/packages/notepad/update.sh b/packages/notepad/update.sh deleted file mode 100644 index 05a7907..0000000 --- a/packages/notepad/update.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -