AI Productivity Suite: Desktop Workflow Automation
In the day-to-day operations of an e-commerce manager (e.g., customer support, content creation), a lot of time is lost through context switching: you copy text, open ChatGPT, paste it, wait, copy it back.
This project, Ollama Menu, is a “productivity suite” that integrates AI functions directly into the desktop workflow. It eliminates the “copy-paste madness” and enables employees to access company-owned AI models with a single keystroke.
Business Value: Efficiency Gains
The tool solves a central productivity problem in administrative departments:
- Support Acceleration: An agent marks a customer email and selects “Draft Reply” → the draft is instantly in the clipboard.
- Content Standardization: Writers use predefined prompts (e.g., “SEO optimization for product description”) to achieve consistent results.
- Privacy: Since local models (via Ollama) are used, no sensitive company data ever leaves the employee’s laptop.

Technical Implementation
The tool is developed as a native GTK3 interface to consume minimal resources and run stably in the background.
Key Features
- Seamless Clipboard Integration: Launches with the current clipboard content, which can be directly edited.
- Customizable Actions (Prompts): An external
prompts.jsonfile allows users to define and extend their own actions with specific system prompts. - Dynamic Model Selection: Automatically detects all locally available Ollama models and lists them in a dropdown menu.
- Live Streaming of AI Response: The model’s response is displayed in real time as it is generated, providing an excellent user experience for longer responses.
- History Feature: Saves the last 100 requests (input, output, model, action) and allows quick restoration and copying of past results.
- Single-Instance Architecture: Uses a PID file to ensure only one instance of the application runs at a time.
- Efficient Keyboard Control: Full keyboard operation possible (arrow keys for action selection, Ctrl+Enter to submit, Esc to close).
Technologies Used
- Language: Python 3
- GUI Framework: GTK3 (via PyGObject)
- Network Communication:
requestslibrary for interaction with the Ollama REST API. - Concurrency:
threadingmodule for running network requests in the background. - Data Formats: JSON for storing configuration (prompts) and application history.
Technical Highlights and Solutions
This project demonstrates important concepts of modern desktop application development:
Responsive User Interface through Multithreading
Problem: Network requests to the Ollama API can take several seconds. If these were executed in the main thread, the entire user interface would freeze.
Solution: Each request to the AI is started in a separate background thread (threading.Thread). This keeps the GUI responsive at all times. To safely update GUI components (like the text field for the response) from the background thread, GLib.idle_add() is used. This ensures all UI updates are executed in the main thread and prevents race conditions.
Robust Process Management and User Experience
Problem: A user might accidentally start a new request while an old one is still running.
Solution: I implemented a request cancellation logic using threading.Event. Before starting a new processing thread, the system checks whether one is already running. If so, the old thread is sent a signal to cancel before the new one starts. This ensures predictable behavior and prevents overlapping requests. Live streaming of the response also gives the user immediate feedback.
Clean Architecture and Configuration
Problem: Hardcoded prompts and settings make an application inflexible.
Solution: The application follows the XDG Base Directory standard by storing configuration files (prompts.json) in ~/.config and application data (history.json) in ~/.local/share. This separates the code from user data and makes the tool easy to customize and maintain.
Professional Application Handling
Implementing the single-instance lock via a PID file (/tmp/ollama-menu-python.pid) is a proven method to prevent users from accidentally opening multiple windows, which would cause confusion and unnecessary resource consumption.
Structured logging (the logging module) and clean exception handling ensure stability and make debugging easier.