From aeb772bccd3d29ed5e9d93229af1ea7d158e00d5 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 22 Jul 2025 15:14:08 +0300 Subject: Reorganize assets and bump version to 0.7.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move totalrecall.desktop, install-icon.sh, and config.yaml.example to assets/ directory - Update all references in README.md and install-icon.sh - Add file organization guidelines to AGENTS.md - Clean up root directory structure πŸ€– Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode --- AGENTS.md | 16 ++++++++++- README.md | 10 ++++--- assets/config.yaml.example | 39 +++++++++++++++++++++++++++ assets/install-icon.sh | 66 ++++++++++++++++++++++++++++++++++++++++++++++ assets/totalrecall.desktop | 13 +++++++++ config.yaml.example | 39 --------------------------- install-icon.sh | 66 ---------------------------------------------- internal/gui/app.go | 9 +++++-- internal/version.go | 2 +- totalrecall.desktop | 13 --------- 10 files changed, 148 insertions(+), 125 deletions(-) create mode 100644 assets/config.yaml.example create mode 100755 assets/install-icon.sh create mode 100644 assets/totalrecall.desktop delete mode 100644 config.yaml.example delete mode 100755 install-icon.sh delete mode 100644 totalrecall.desktop diff --git a/AGENTS.md b/AGENTS.md index 6ed9514..13d65cf 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -58,13 +58,18 @@ golangci-lint run ### Package Structure ``` totalrecall/ -β”œβ”€β”€ cmd/totalrecall/ # CLI entry point +β”œβ”€β”€ cmd/totalrecall/ # CLI entry point β”œβ”€β”€ internal/ # Private packages β”‚ β”œβ”€β”€ audio/ # Audio generation (OpenAI TTS) β”‚ β”œβ”€β”€ image/ # Image generation functionality β”‚ β”œβ”€β”€ anki/ # Anki format generation β”‚ β”œβ”€β”€ config/ # Configuration management β”‚ └── version.go # Version information +β”œβ”€β”€ assets/ # Static assets and configuration +β”‚ β”œβ”€β”€ icons/ # Application icons +β”‚ β”œβ”€β”€ config.yaml.example # Example configuration +β”‚ β”œβ”€β”€ totalrecall.desktop # Desktop entry file +β”‚ └── install-icon.sh # Icon installation script ``` ### Key Design Decisions @@ -102,3 +107,12 @@ package main // NOT package bulg - Input should be in Cyrillic script - Common test words: ябълка (apple), ΠΊΠΎΡ‚ΠΊΠ° (cat), ΠΊΡƒΡ‡Π΅ (dog) - OpenAI voices: nova, alloy, echo, shimmer (work well for Bulgarian) + +## Code Guidelines +- Whenever updating code, also update the comments in the code to reflect the reality and the reasoning. +- When a function reaches 50 lines of code or more, try to refactor it into several functions of about 30 lines each. In case of a go project, when main.go becomes too large, move code into the ./internal package. + +## File Organization +- Configuration examples, desktop files, and installation scripts should be placed in the `assets/` directory +- Icons and images go in `assets/icons/` +- Keep the root directory clean by moving non-essential files to appropriate subdirectories diff --git a/README.md b/README.md index 4c57640..6060f17 100644 --- a/README.md +++ b/README.md @@ -76,13 +76,13 @@ TotalRecall includes a desktop icon for GNOME integration. To install: **For current user only:** ```bash cd totalrecall -./install-icon.sh +./assets/install-icon.sh ``` **System-wide installation:** ```bash cd totalrecall -sudo ./install-icon.sh +sudo ./assets/install-icon.sh ``` After installation, you may need to log out and log back in for the icon to appear in GNOME's application menu. The icon will show up as "TotalRecall" in the Education category. @@ -193,7 +193,11 @@ When translations are provided, they are used directly without calling the trans ## Configuration -Create an optional `~/config/totalrecall/config.yaml` file. You can copy the example file provided. +Create an optional `~/config/totalrecall/config.yaml` file. You can copy the example file provided: + +```bash +cp assets/config.yaml.example ~/.config/totalrecall/config.yaml +``` ## Output Files diff --git a/assets/config.yaml.example b/assets/config.yaml.example new file mode 100644 index 0000000..3988035 --- /dev/null +++ b/assets/config.yaml.example @@ -0,0 +1,39 @@ +# TotalRecalooConfiguration Example +# Copy this to ~/.totalrecall.yaml or ./.totalrecall.yaml + +# Audio configuration +audio: + # Audio is generated using OpenAI TTS + # Provider field removed - OpenAI is now the only option + + # Audio output format + format: mp3 + + # OpenAI TTS settings + openai_key: ${OPENAI_API_KEY} # Can also use environment variable + openai_model: gpt-4o-mini-tts # Options: tts-1, tts-1-hd, gpt-4o-mini-tts + openai_speed: 0.9 # Range: 0.25 to 4.0 (may be ignored by gpt-4o-mini models) + + # Voice instructions for gpt-4o-mini-tts model + # This allows you to customize how the AI speaks + openai_instruction: "You are speaking Bulgarian language (Π±ΡŠΠ»Π³Π°Ρ€ΡΠΊΠΈ Π΅Π·ΠΈΠΊ). Pronounce the Bulgarian text with authentic Bulgarian phonetics, not Russian. Speak slowly and clearly for language learners." + + # Alternative instruction examples: + # openai_instruction: "Speak in Bulgarian (not Russian!). Use native Bulgarian pronunciation with clear articulation for each syllable." + # openai_instruction: "You are a Bulgarian language teacher. Pronounce the Bulgarian words slowly with authentic Bulgarian accent and phonetics." + # openai_instruction: "Speak Bulgarian text with proper Bulgarian pronunciation. Avoid Russian accent. Speak clearly at a pace suitable for beginners." + +# Image configuration +image: + # Provider: currently only openai is supported + provider: openai + + # OpenAI DALL-E settings + openai_model: dall-e-3 # Options: dall-e-2, dall-e-3 + openai_size: 1024x1024 # Options vary by model + openai_quality: standard # Options: standard, hd (dall-e-3 only) + openai_style: natural # Options: natural, vivid (dall-e-3 only) + +# Output configuration +output: + directory: ~/Downloads diff --git a/assets/install-icon.sh b/assets/install-icon.sh new file mode 100755 index 0000000..b012067 --- /dev/null +++ b/assets/install-icon.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# Script to install TotalRecall icon for GNOME on Fedora Linux +# Run with sudo for system-wide installation + +set -e + +# Check if running as root for system-wide install +if [[ $EUID -eq 0 ]]; then + echo "Installing TotalRecall icon system-wide..." + ICON_BASE="/usr/share/icons/hicolor" + APP_DIR="/usr/share/applications" + BINARY_PATH="/usr/local/bin/totalrecall" +else + echo "Installing TotalRecall icon for current user..." + ICON_BASE="$HOME/.local/share/icons/hicolor" + APP_DIR="$HOME/.local/share/applications" + BINARY_PATH="$HOME/go/bin/totalrecall" +fi + +# Create directories +mkdir -p "$ICON_BASE"/{16x16,32x32,48x48,64x64,128x128,256x256,512x512}/apps +mkdir -p "$APP_DIR" + +# Copy icons +cp assets/icons/totalrecall_16.png "$ICON_BASE/16x16/apps/totalrecall.png" +cp assets/icons/totalrecall_32.png "$ICON_BASE/32x32/apps/totalrecall.png" +cp assets/icons/totalrecall_48.png "$ICON_BASE/48x48/apps/totalrecall.png" +cp assets/icons/totalrecall_64.png "$ICON_BASE/64x64/apps/totalrecall.png" +cp assets/icons/totalrecall_128.png "$ICON_BASE/128x128/apps/totalrecall.png" +cp assets/icons/totalrecall_256.png "$ICON_BASE/256x256/apps/totalrecall.png" +cp assets/icons/totalrecall_512.png "$ICON_BASE/512x512/apps/totalrecall.png" + +# Copy scalable icon +mkdir -p "$ICON_BASE/scalable/apps" +cp assets/icons/totalrecall.svg "$ICON_BASE/scalable/apps/totalrecall.svg" + +# Copy and update desktop file with correct binary path +# First check if totalrecall is in standard locations +if command -v totalrecall &> /dev/null; then + TOTALRECALL_PATH=$(command -v totalrecall) +elif [[ -x "$HOME/go/bin/totalrecall" ]]; then + TOTALRECALL_PATH="$HOME/go/bin/totalrecall" +elif [[ -x "/usr/local/bin/totalrecall" ]]; then + TOTALRECALL_PATH="/usr/local/bin/totalrecall" +elif [[ -x "/usr/bin/totalrecall" ]]; then + TOTALRECALL_PATH="/usr/bin/totalrecall" +else + echo "Warning: totalrecall binary not found in standard locations" + echo "Please install totalrecall first with 'task install' or 'go install ./cmd/totalrecall'" + TOTALRECALL_PATH="totalrecall" +fi + +# Create desktop file with proper exec path +sed "s|Exec=totalrecall|Exec=$TOTALRECALL_PATH|g" assets/totalrecall.desktop > "$APP_DIR/totalrecall.desktop" + +# Update caches +if command -v gtk-update-icon-cache &> /dev/null; then + gtk-update-icon-cache -f -t "$ICON_BASE" 2>/dev/null || true +fi + +if command -v update-desktop-database &> /dev/null; then + update-desktop-database "$APP_DIR" 2>/dev/null || true +fi + +echo "TotalRecall icon installed successfully!" +echo "You may need to log out and log back in to see the icon in GNOME." \ No newline at end of file diff --git a/assets/totalrecall.desktop b/assets/totalrecall.desktop new file mode 100644 index 0000000..dfd1edf --- /dev/null +++ b/assets/totalrecall.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Name=TotalRecall +GenericName=Bulgarian Flashcard Generator +Comment=Generate Anki flashcard materials from Bulgarian words +Exec=totalrecall +Icon=totalrecall +Terminal=false +Categories=Education;Languages; +Keywords=bulgarian;flashcards;anki;language;learning; +StartupNotify=true +StartupWMClass=totalrecall diff --git a/config.yaml.example b/config.yaml.example deleted file mode 100644 index 3988035..0000000 --- a/config.yaml.example +++ /dev/null @@ -1,39 +0,0 @@ -# TotalRecalooConfiguration Example -# Copy this to ~/.totalrecall.yaml or ./.totalrecall.yaml - -# Audio configuration -audio: - # Audio is generated using OpenAI TTS - # Provider field removed - OpenAI is now the only option - - # Audio output format - format: mp3 - - # OpenAI TTS settings - openai_key: ${OPENAI_API_KEY} # Can also use environment variable - openai_model: gpt-4o-mini-tts # Options: tts-1, tts-1-hd, gpt-4o-mini-tts - openai_speed: 0.9 # Range: 0.25 to 4.0 (may be ignored by gpt-4o-mini models) - - # Voice instructions for gpt-4o-mini-tts model - # This allows you to customize how the AI speaks - openai_instruction: "You are speaking Bulgarian language (Π±ΡŠΠ»Π³Π°Ρ€ΡΠΊΠΈ Π΅Π·ΠΈΠΊ). Pronounce the Bulgarian text with authentic Bulgarian phonetics, not Russian. Speak slowly and clearly for language learners." - - # Alternative instruction examples: - # openai_instruction: "Speak in Bulgarian (not Russian!). Use native Bulgarian pronunciation with clear articulation for each syllable." - # openai_instruction: "You are a Bulgarian language teacher. Pronounce the Bulgarian words slowly with authentic Bulgarian accent and phonetics." - # openai_instruction: "Speak Bulgarian text with proper Bulgarian pronunciation. Avoid Russian accent. Speak clearly at a pace suitable for beginners." - -# Image configuration -image: - # Provider: currently only openai is supported - provider: openai - - # OpenAI DALL-E settings - openai_model: dall-e-3 # Options: dall-e-2, dall-e-3 - openai_size: 1024x1024 # Options vary by model - openai_quality: standard # Options: standard, hd (dall-e-3 only) - openai_style: natural # Options: natural, vivid (dall-e-3 only) - -# Output configuration -output: - directory: ~/Downloads diff --git a/install-icon.sh b/install-icon.sh deleted file mode 100755 index dd5c224..0000000 --- a/install-icon.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -# Script to install TotalRecall icon for GNOME on Fedora Linux -# Run with sudo for system-wide installation - -set -e - -# Check if running as root for system-wide install -if [[ $EUID -eq 0 ]]; then - echo "Installing TotalRecall icon system-wide..." - ICON_BASE="/usr/share/icons/hicolor" - APP_DIR="/usr/share/applications" - BINARY_PATH="/usr/local/bin/totalrecall" -else - echo "Installing TotalRecall icon for current user..." - ICON_BASE="$HOME/.local/share/icons/hicolor" - APP_DIR="$HOME/.local/share/applications" - BINARY_PATH="$HOME/go/bin/totalrecall" -fi - -# Create directories -mkdir -p "$ICON_BASE"/{16x16,32x32,48x48,64x64,128x128,256x256,512x512}/apps -mkdir -p "$APP_DIR" - -# Copy icons -cp assets/icons/totalrecall_16.png "$ICON_BASE/16x16/apps/totalrecall.png" -cp assets/icons/totalrecall_32.png "$ICON_BASE/32x32/apps/totalrecall.png" -cp assets/icons/totalrecall_48.png "$ICON_BASE/48x48/apps/totalrecall.png" -cp assets/icons/totalrecall_64.png "$ICON_BASE/64x64/apps/totalrecall.png" -cp assets/icons/totalrecall_128.png "$ICON_BASE/128x128/apps/totalrecall.png" -cp assets/icons/totalrecall_256.png "$ICON_BASE/256x256/apps/totalrecall.png" -cp assets/icons/totalrecall_512.png "$ICON_BASE/512x512/apps/totalrecall.png" - -# Copy scalable icon -mkdir -p "$ICON_BASE/scalable/apps" -cp assets/icons/totalrecall.svg "$ICON_BASE/scalable/apps/totalrecall.svg" - -# Copy and update desktop file with correct binary path -# First check if totalrecall is in standard locations -if command -v totalrecall &> /dev/null; then - TOTALRECALL_PATH=$(command -v totalrecall) -elif [[ -x "$HOME/go/bin/totalrecall" ]]; then - TOTALRECALL_PATH="$HOME/go/bin/totalrecall" -elif [[ -x "/usr/local/bin/totalrecall" ]]; then - TOTALRECALL_PATH="/usr/local/bin/totalrecall" -elif [[ -x "/usr/bin/totalrecall" ]]; then - TOTALRECALL_PATH="/usr/bin/totalrecall" -else - echo "Warning: totalrecall binary not found in standard locations" - echo "Please install totalrecall first with 'task install' or 'go install ./cmd/totalrecall'" - TOTALRECALL_PATH="totalrecall" -fi - -# Create desktop file with proper exec path -sed "s|Exec=totalrecall|Exec=$TOTALRECALL_PATH|g" totalrecall.desktop > "$APP_DIR/totalrecall.desktop" - -# Update caches -if command -v gtk-update-icon-cache &> /dev/null; then - gtk-update-icon-cache -f -t "$ICON_BASE" 2>/dev/null || true -fi - -if command -v update-desktop-database &> /dev/null; then - update-desktop-database "$APP_DIR" 2>/dev/null || true -fi - -echo "TotalRecall icon installed successfully!" -echo "You may need to log out and log back in to see the icon in GNOME." \ No newline at end of file diff --git a/internal/gui/app.go b/internal/gui/app.go index aa4fb74..cb1ed2d 100644 --- a/internal/gui/app.go +++ b/internal/gui/app.go @@ -185,7 +185,7 @@ func New(config *Config) *Application { // setupUI creates the main user interface func (a *Application) setupUI() { - a.window = a.app.NewWindow(fmt.Sprintf("TotalRecall v%s - Bulgarian Flashcard Generator", internal.Version)) + a.window = a.app.NewWindow("TotalRecall") a.window.SetIcon(GetAppIcon()) a.window.Resize(fyne.NewSize(880, 770)) @@ -372,8 +372,13 @@ func (a *Application) setupUI() { a.queueStatusLabel = widget.NewLabel("Queue: Empty") a.queueStatusLabel.TextStyle = fyne.TextStyle{Italic: true} + // Create version label + versionLabel := widget.NewLabel(fmt.Sprintf("v%s", internal.Version)) + versionLabel.TextStyle = fyne.TextStyle{Italic: true} + versionLabel.Alignment = fyne.TextAlignTrailing + statusSection := container.NewBorder( - nil, nil, nil, nil, + nil, nil, nil, versionLabel, container.NewVBox( a.statusLabel, widget.NewSeparator(), diff --git a/internal/version.go b/internal/version.go index a448a34..f4c9657 100644 --- a/internal/version.go +++ b/internal/version.go @@ -1,3 +1,3 @@ package internal -const Version = "0.7.2" +const Version = "0.7.3" diff --git a/totalrecall.desktop b/totalrecall.desktop deleted file mode 100644 index dfd1edf..0000000 --- a/totalrecall.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -Name=TotalRecall -GenericName=Bulgarian Flashcard Generator -Comment=Generate Anki flashcard materials from Bulgarian words -Exec=totalrecall -Icon=totalrecall -Terminal=false -Categories=Education;Languages; -Keywords=bulgarian;flashcards;anki;language;learning; -StartupNotify=true -StartupWMClass=totalrecall -- cgit v1.2.3