A powerful Linux desktop tool for converting selected text into different styles using Claude AI. Transform your writing instantly with right-click or keyboard shortcut activation.
- More Formal - Professional/academic style with elevated language
- More Stylish - Engaging format with rhetorical flair and vivid language
- WhatsApp Appropriate - Casual messaging style for everyday chat
- LinkedIn Post Material - Professional social media content with engagement hooks
- Discord Material - Community chat style with internet-aware language
- Casual Format - Friendly, relaxed tone for informal communication
- Natural - Fix Typos & Grammar - Comprehensive error correction while maintaining style
- Typos Only - Fix spelling errors without changing structure
- Grammar Only - Correct grammar and punctuation without rephrasing
- Add Emojis - Enhance expressiveness with appropriate emoji placement
- System-wide integration: Works in any application (browsers, text editors, chat apps)
- Quick conversion: Select text → shortcut → choose mode → paste
- Smart clipboard: Automatically copies converted text
- Desktop notifications: Visual feedback for each step
- Dual UI options: Uses rofi (preferred) or zenity (fallback)
- High-quality output: Powered by Claude Sonnet 4 for natural conversions
Install required system packages:
Ubuntu/Debian:
sudo apt install python3 python3-pip xclip rofiFedora:
sudo dnf install python3 python3-pip xclip rofiArch Linux:
sudo pacman -S python xclip rofiOptional: Install zenity as fallback if you don't want rofi:
sudo apt install zenity # Ubuntu/Debian# Clone the repository
git clone https://github.com/thamam/Writing-Companion.git
cd Writing-Companion
# Make scripts executable
chmod +x install.sh setup_context_menu.sh text_converter.py
# Run installation
./install.shThe installer will:
- Check for required dependencies
- Install Python packages (anthropic)
- Copy script to
/usr/local/bin/ - Install desktop entry
- Display setup instructions
-
Get your API key from Anthropic Console
-
Add to shell configuration:
For Bash (edit
~/.bashrc):echo "export ANTHROPIC_API_KEY='sk-ant-your-key-here'" >> ~/.bashrc source ~/.bashrc
For Zsh (edit
~/.zshrc):echo "export ANTHROPIC_API_KEY='sk-ant-your-key-here'" >> ~/.zshrc source ~/.zshrc
-
Verify it's set:
echo $ANTHROPIC_API_KEY
Run the context menu setup helper:
./setup_context_menu.shRecommended: Keyboard Shortcut (Works on all DEs)
GNOME/Ubuntu:
- Settings → Keyboard → Keyboard Shortcuts → Custom Shortcuts
- Click "+" to add new shortcut
- Name: "Text Style Converter"
- Command:
/usr/local/bin/text-converter.py - Shortcut:
Ctrl+Alt+T(or your preference)
KDE Plasma:
- System Settings → Shortcuts → Custom Shortcuts
- Edit → New → Global Shortcut → Command/URL
- Command:
/usr/local/bin/text-converter.py - Trigger:
Ctrl+Alt+T
XFCE:
- Settings → Keyboard → Application Shortcuts
- Add →
/usr/local/bin/text-converter.py - Press your desired key combo
- Select text in any application (browser, editor, chat, etc.)
- Press your keyboard shortcut (e.g.,
Ctrl+Alt+T) - Choose conversion mode from the popup menu
- Wait for notification confirming conversion
- Paste the converted text with
Ctrl+V
Making professional communication:
Original (casual): "hey can u check this out when u get a chance?"
Mode: More Formal
Result: "Hello, would you please review this at your earliest convenience?"
Creating LinkedIn content:
Original: "Just launched our new feature. It's pretty cool."
Mode: LinkedIn Post Material
Result: "Excited to announce the launch of our new feature! 🚀
After months of development, we've built something that will transform how teams collaborate...
What features would you like to see next?"
Quick typo fixes:
Original: "Recieved the documment, will reveiw it tomorow."
Mode: Typos Only
Result: "Received the document, will review it tomorrow."
- Text Capture: Uses
xclipto read selected text from X11 primary selection - Mode Selection: Displays rofi/zenity dialog with 10 conversion options
- API Call: Sends text to Claude API with mode-specific prompt
- Clipboard Copy: Uses
xclipto copy result to clipboard - Notification: Shows desktop notification via
notify-send
┌─────────────────┐
│ Selected Text │
└────────┬────────┘
│ xclip -o
▼
┌─────────────────┐
│ Mode Selector │ rofi/zenity
│ (10 options) │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Claude API │ Anthropic Python SDK
│ (Sonnet 4) │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Clipboard │ xclip -selection clipboard
└────────┬────────┘
│
▼
┌─────────────────┐
│ Notification │ notify-send
└─────────────────┘
Edit text_converter.py and modify the MODEL constant:
MODEL = "claude-sonnet-4-20250514" # Latest Sonnet
# or
MODEL = "claude-3-5-sonnet-20241022" # Older SonnetEdit the CONVERSION_MODES dictionary in text_converter.py:
"11": {
"name": "Your Custom Mode",
"prompt": """Your conversion instructions here.
Text: {text}
Converted text:"""
}Common alternatives to Ctrl+Alt+T:
Super+T(Windows/Command key + T)Ctrl+Shift+TAlt+T- Any F-key (F9, F10, etc.)
- Ensure text is highlighted before pressing shortcut
- Try selecting with mouse, not keyboard
- Some apps may not expose selection to X11 - try copying to clipboard first
- Check environment variable:
echo $ANTHROPIC_API_KEY - Restart terminal after editing
~/.bashrc - For current session:
export ANTHROPIC_API_KEY='your-key' - Verify in your shell config file
- Install rofi (recommended):
sudo apt install rofi - Or install zenity as fallback:
sudo apt install zenity - Check installation:
which rofi
- Check internet connection
- Verify API key is valid at Anthropic Console
- Check Anthropic API status: status.anthropic.com
- Look for error in notification
- Ensure script is executable:
chmod +x /usr/local/bin/text-converter.py - Re-run installer:
./install.sh
- Some apps (like secure terminals) may block clipboard access
- Try copying text first, then select from clipboard manager
- Wayland apps may have limitations - try X11 session
Using Claude Sonnet 4 pricing (as of 2024):
| Text Length | Approx. Tokens | Estimated Cost |
|---|---|---|
| Short (100 words) | ~150 tokens | ~$0.001 |
| Medium (500 words) | ~750 tokens | ~$0.005 |
| Long (2000 words) | ~3000 tokens | ~$0.02 |
Note: Costs are estimates. Check Anthropic pricing for current rates.
This tool is inspired by Prompt Enhancer Extension but designed for broader use:
| Feature | Prompt Enhancer | Text Style Converter |
|---|---|---|
| Platform | Browser extension | Linux desktop (system-wide) |
| Use case | Enhance AI prompts | Convert any text style |
| Modes | Prompt-specific | 10 diverse styles |
| Integration | Browser only | All applications |
| Activation | Extension button | Keyboard shortcut |
- Browser extension version (Chrome/Firefox)
- Windows/macOS support
- Multi-language support (Spanish, French, etc.)
- Custom conversion mode templates
- Local model option (no API required)
- Batch file processing
- History and favorites
- GUI configuration tool
- Wayland native support
Contributions welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - See LICENSE file for details
- Inspired by Prompt Enhancer Extension
- Powered by Anthropic Claude API
- Uses rofi for menu display
For issues, questions, or suggestions:
- Open an issue on GitHub
- Check existing issues for solutions
- Include error messages and system info in bug reports
- Initial release
- 10 conversion modes
- Linux desktop integration
- Claude Sonnet 4 support
- Rofi/Zenity UI
- Comprehensive documentation