oh-my-theme


Nameoh-my-theme JSON
Version 2.0.0 PyPI version JSON
download
home_pageNone
SummaryTerminal-based theme manager for Oh My Posh with preview, search, custom repositories, and theme customization
upload_time2025-08-17 18:22:19
maintainerNone
docs_urlNone
authorNone
requires_python>=3.6
licenseNone
keywords oh-my-posh terminal theme prompt shell bash zsh fish customization search git color-editor
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Oh My Theme

Theme manager for [Oh My Posh](https://ohmyposh.dev/) that lets you browse, preview, install, activate, add custom and tweak themes directly inside your terminal.

![Screenshot-main](./img/ohmytheme-main.png)

![Screenshot-install](./img/ohmytheme-install.png)

## Features

- 💻 **Fast and simple**: runs from terminal. Simple interface.
- 🔍 **Real-time Search**: Filter local and remote theme repo
- ⚡ **Fast Installation**: Single or multiple theme download
- 🔄 **Easy Theme Switching**: Theme activation (Bash/Zsh/Fish) 
- 🗂️ **Dual Panel Interface**: Local and remote theme management
- 🎯 **Custom Repositories**: Add themes from Git repository (json has to be in root)
- 🎨 **Theme Customization**: Built-in color editor
- 🎨 **Basic Previews**: Sample prompt structure with basic metadata (Name, Version, Source, Color variation)
- 🚀 **Performance Optimized**: Smart caching and modular architecture

## Prerequisites

Before using this tool, you need:

1. **Oh My Posh installed** - Visit [ohmyposh.dev](https://ohmyposh.dev/) for installation instructions
2. **Compatible shell**: Bash, Zsh, or Fish
3. **Python 3.6+** with standard libraries

## Installation

### Method 1: PyPI (Recommended)
```bash
pip install oh-my-theme
```

### Method 2: AUR (Arch Linux)
```bash
yay -S oh-my-theme
# or
paru -S oh-my-theme
```

### Method 3: Git Clone
```bash
git clone https://github.com/mikeisfree/oh-my-theme.git
pip install -e .
```

## Usage After Installation

Once installed run with:
```bash
omt
```

## Shell Config

The tool automatically updates your shell configuration:

- **Bash**: `~/.bashrc`
- **Zsh**: `~/.zshrc` 
- **Fish**: `~/.config/fish/config.fish`



### Clean Theme Management:
- **Removes** all existing Oh My Posh theme lines when activating a new theme - If You want to keep existing oh-my-posh configuration commenting it out will not be enough - back it up to a separate file! 
- **Adds** only the new active theme command
- **Preserves** all other shell configuration! (aliases, exports, functions)



After activating a theme, reload your shell:
```bash
source ~/.bashrc    # For Bash
source ~/.zshrc     # For Zsh
```

![Screenshot-local](./img/ohmytheme-localmenu.png)

## Usage Details

### Interface Overview

The tool displays two panels:
- **Left Panel**: installed themes (local)
- **Right Panel**: Available themes from Oh My Posh main repository + custom repos added by user (remote)

### Keyboard Shortcuts

| Key | Action |
|-----|--------|
| `TAB` | Switch between panels |
| `↑/↓` | Navigate theme list |
| `ENTER` | Activate/Remove/Customize local theme or Select remote theme |
| `SPACE` | Toggle selection for remote themes |
| `p` | Preview selected theme |
| `i` | Install selected remote themes |
| `/` | **NEW**: Enter search mode for real-time theme filtering |
| `+` | **NEW**: Add custom Git repository |
| `ESC` | Exit search mode & cancel dialogs |
| `q` | Quit application |

### Local Theme Actions (ENTER)

When you press ENTER on a local theme, you'll see these options:
- `A` - **Activate** theme in shell
- `R` - **Remove** theme  
- `C` - **Customize** theme colors

### Getting Started

1. **Browse Remote Themes**: Use `TAB` to switch to the right panel and browse available themes
2. **Search Themes**: Press `/` to search and filter themes in real-time
3. **Preview Themes**: Press `p` to see previews with sample prompts and metadata
4. **Select Themes**: Use `SPACE` to select multiple themes for installation
5. **Install Themes**: Press `i` to download selected themes
6. **Activate Theme**: Switch to local panel (`TAB`) and press `ENTER` → `A` on your desired theme
7. **Customize Theme**: Press `ENTER` → `C` on local themes to edit colors
8. **Add Custom Repos**: Press `+` to add themes from custom Git repositories

### Theme Previews

Preview feature shows:
- **Sample prompt structure** git status, paths, segments
- **Essential metadata**: Name, Version, Source (git repository), Color variation

![Screenshot-preview](./img/ohmytheme-prev.png)

### Filter

- Press `/` to enter search mode
- Type to filter themes in real-time across both local and remote panels
- Search results highlight matching text
- Press `ESC` to exit search and process filtered items 

### Custom Repository Support

- Press `+` to add themes from custom Git repository
- Enter the Git repository URL when prompted
- The tool will fetch all `.omp.json` files from the repository root
- Custom themes are downloaded to your local themes directory
- repository address will be added to filter array 

![Screenshot-custom](./img/ohmytheme-custom.png)

### Theme Customization

- Select any local theme and press `ENTER` → `C`
- Visual color editor shows current segment colors
- Simple color picker interface for modifications
- Save as new theme (new json file) or overwrite original
- Preserve customizations across updates

![Screenshot-customizer](./img/ohmytheme-customizer.png)

## Theme Storage

Downloaded themes are stored in `~/.poshthemes/` directory. The tool manages this directory automatically.

## Troubleshooting

### "Unsupported shell" Error
Make sure your `SHELL` environment variable is set correctly:
```bash
echo $SHELL
```

## Safety measures:

### Backup-friendly: Uses a clean replacement strategy that preserves non-Oh My Posh configurations
### Atomic updates: Reads entire file, modifies in memory, then writes back
### Error handling: Returns success/failure status
### uses regex pattern to identify Oh My Posh lines:
```bash
init_pattern = re.compile(r"^\s*(eval.*oh-my-posh init.*|oh-my-posh init.*fish.*)")
```
### User confirmation: Always asks for confirmation before activating themes

### Theme Not Activating
1. Ensure Oh My Posh is properly installed and in your PATH
2. Check that your shell configuration file exists and is writable
3. Reload your shell after theme activation

### Preview Not Working
- For remote themes: The tool will offer to download the theme for preview
- For local themes: Ensure the theme file exists in `~/.poshthemes/`

### Search Not Responding
- Make sure you're in search mode (press `/` first)
- Press `ESC` to exit search mode if stuck
- Search works across both local and remote theme panels

### Custom Repository Issues
- Ensure the Git repository URL is valid and accessible
- Repository must contain `.omp.json` files in the root directory
- Check your internet connection for repository access

### Theme Customization Problems
- Only local themes can be customized
- Ensure you have write permissions to the themes directory
- Invalid JSON themes cannot be edited safely

## Performance Features

- **Smart Caching**: Theme metadata is cached to speed up repeated previews
- **File Reuse**: Existing downloaded themes are reused for previews
- **Memory Management**: Cache size is limited to prevent memory bloat
- **Lazy Loading**: Theme parsing only when needed

## What's New in v2.0

- 🔍 **Search**: Filter themes instantly with `/` keybind
- 🎯 **Custom Repositories**: Add themes from Git repository with `+` keybind  
- 🎨 **Theme Customization**: Built-in color editor for personalizing themes
- ✨ **Enhanced Previews**: sample prompts with essential metadata
- 🏗️ **Modular Architecture**: Improved code organization and maintainability

## Contributing

⭐ Star on GitHub if you like it!  
📦 Review the package on PyPI or AUR  
🐛 Report issues on GitHub  
🔧 Submit pull requests with updates/upgrades

## License

This project is open source. Please check the license file for details.

## Architecture

Oh My Theme v2.0 features a modular architecture:

- **`oh_my_theme/main.py`**: Core UI and application logic
- **`oh_my_theme/preview.py`**: Enhanced theme previews and sample generation
- **`oh_my_theme/search.py`**: Real-time search and filtering functionality
- **`oh_my_theme/repositories.py`**: Custom Git repository management
- **`oh_my_theme/editor.py`**: Theme color customization interface
- **`oh_my_theme/config.py`**: Configuration and settings management

## Dependencies

- **Python 3.6+**: Core runtime requirement
- **Standard libraries only**: curses, json, os, subprocess, urllib
- **No external dependencies required**: Pure Python implementation

## Related Links

- [Oh My Posh Official Website](https://ohmyposh.dev/)
- [Oh My Posh Documentation](https://ohmyposh.dev/docs/)
- [Oh My Posh Themes Repository (main)](https://github.com/JanDeDobbeleer/oh-my-posh/tree/main/themes)
- [Project Repository](https://github.com/mikeisfree/ohmytheme)
- [PyPI Package](https://pypi.org/project/oh-my-theme/)

---

**Note**: This tool modifies your shell configuration files. It's recommended to backup your configuration before first use.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "oh-my-theme",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "Accidentallystable <accidentallystable@proton.com>",
    "keywords": "oh-my-posh, terminal, theme, prompt, shell, bash, zsh, fish, customization, search, git, color-editor",
    "author": null,
    "author_email": "AccidentallyStable <accidentallystable@proton.com>",
    "download_url": "https://files.pythonhosted.org/packages/4f/e9/93e2229da50c52cc320494709058c9acf1abbba7b337aff1e9cc0155244d/oh_my_theme-2.0.0.tar.gz",
    "platform": null,
    "description": "# Oh My Theme\n\nTheme manager for [Oh My Posh](https://ohmyposh.dev/) that lets you browse, preview, install, activate, add custom and tweak themes directly inside your terminal.\n\n![Screenshot-main](./img/ohmytheme-main.png)\n\n![Screenshot-install](./img/ohmytheme-install.png)\n\n## Features\n\n- \ud83d\udcbb **Fast and simple**: runs from terminal. Simple interface.\n- \ud83d\udd0d **Real-time Search**: Filter local and remote theme repo\n- \u26a1 **Fast Installation**: Single or multiple theme download\n- \ud83d\udd04 **Easy Theme Switching**: Theme activation (Bash/Zsh/Fish) \n- \ud83d\uddc2\ufe0f **Dual Panel Interface**: Local and remote theme management\n- \ud83c\udfaf **Custom Repositories**: Add themes from Git repository (json has to be in root)\n- \ud83c\udfa8 **Theme Customization**: Built-in color editor\n- \ud83c\udfa8 **Basic Previews**: Sample prompt structure with basic metadata (Name, Version, Source, Color variation)\n- \ud83d\ude80 **Performance Optimized**: Smart caching and modular architecture\n\n## Prerequisites\n\nBefore using this tool, you need:\n\n1. **Oh My Posh installed** - Visit [ohmyposh.dev](https://ohmyposh.dev/) for installation instructions\n2. **Compatible shell**: Bash, Zsh, or Fish\n3. **Python 3.6+** with standard libraries\n\n## Installation\n\n### Method 1: PyPI (Recommended)\n```bash\npip install oh-my-theme\n```\n\n### Method 2: AUR (Arch Linux)\n```bash\nyay -S oh-my-theme\n# or\nparu -S oh-my-theme\n```\n\n### Method 3: Git Clone\n```bash\ngit clone https://github.com/mikeisfree/oh-my-theme.git\npip install -e .\n```\n\n## Usage After Installation\n\nOnce installed run with:\n```bash\nomt\n```\n\n## Shell Config\n\nThe tool automatically updates your shell configuration:\n\n- **Bash**: `~/.bashrc`\n- **Zsh**: `~/.zshrc` \n- **Fish**: `~/.config/fish/config.fish`\n\n\n\n### Clean Theme Management:\n- **Removes** all existing Oh My Posh theme lines when activating a new theme - If You want to keep existing oh-my-posh configuration commenting it out will not be enough - back it up to a separate file! \n- **Adds** only the new active theme command\n- **Preserves** all other shell configuration! (aliases, exports, functions)\n\n\n\nAfter activating a theme, reload your shell:\n```bash\nsource ~/.bashrc    # For Bash\nsource ~/.zshrc     # For Zsh\n```\n\n![Screenshot-local](./img/ohmytheme-localmenu.png)\n\n## Usage Details\n\n### Interface Overview\n\nThe tool displays two panels:\n- **Left Panel**: installed themes (local)\n- **Right Panel**: Available themes from Oh My Posh main repository + custom repos added by user (remote)\n\n### Keyboard Shortcuts\n\n| Key | Action |\n|-----|--------|\n| `TAB` | Switch between panels |\n| `\u2191/\u2193` | Navigate theme list |\n| `ENTER` | Activate/Remove/Customize local theme or Select remote theme |\n| `SPACE` | Toggle selection for remote themes |\n| `p` | Preview selected theme |\n| `i` | Install selected remote themes |\n| `/` | **NEW**: Enter search mode for real-time theme filtering |\n| `+` | **NEW**: Add custom Git repository |\n| `ESC` | Exit search mode & cancel dialogs |\n| `q` | Quit application |\n\n### Local Theme Actions (ENTER)\n\nWhen you press ENTER on a local theme, you'll see these options:\n- `A` - **Activate** theme in shell\n- `R` - **Remove** theme  \n- `C` - **Customize** theme colors\n\n### Getting Started\n\n1. **Browse Remote Themes**: Use `TAB` to switch to the right panel and browse available themes\n2. **Search Themes**: Press `/` to search and filter themes in real-time\n3. **Preview Themes**: Press `p` to see previews with sample prompts and metadata\n4. **Select Themes**: Use `SPACE` to select multiple themes for installation\n5. **Install Themes**: Press `i` to download selected themes\n6. **Activate Theme**: Switch to local panel (`TAB`) and press `ENTER` \u2192 `A` on your desired theme\n7. **Customize Theme**: Press `ENTER` \u2192 `C` on local themes to edit colors\n8. **Add Custom Repos**: Press `+` to add themes from custom Git repositories\n\n### Theme Previews\n\nPreview feature shows:\n- **Sample prompt structure** git status, paths, segments\n- **Essential metadata**: Name, Version, Source (git repository), Color variation\n\n![Screenshot-preview](./img/ohmytheme-prev.png)\n\n### Filter\n\n- Press `/` to enter search mode\n- Type to filter themes in real-time across both local and remote panels\n- Search results highlight matching text\n- Press `ESC` to exit search and process filtered items \n\n### Custom Repository Support\n\n- Press `+` to add themes from custom Git repository\n- Enter the Git repository URL when prompted\n- The tool will fetch all `.omp.json` files from the repository root\n- Custom themes are downloaded to your local themes directory\n- repository address will be added to filter array \n\n![Screenshot-custom](./img/ohmytheme-custom.png)\n\n### Theme Customization\n\n- Select any local theme and press `ENTER` \u2192 `C`\n- Visual color editor shows current segment colors\n- Simple color picker interface for modifications\n- Save as new theme (new json file) or overwrite original\n- Preserve customizations across updates\n\n![Screenshot-customizer](./img/ohmytheme-customizer.png)\n\n## Theme Storage\n\nDownloaded themes are stored in `~/.poshthemes/` directory. The tool manages this directory automatically.\n\n## Troubleshooting\n\n### \"Unsupported shell\" Error\nMake sure your `SHELL` environment variable is set correctly:\n```bash\necho $SHELL\n```\n\n## Safety measures:\n\n### Backup-friendly: Uses a clean replacement strategy that preserves non-Oh My Posh configurations\n### Atomic updates: Reads entire file, modifies in memory, then writes back\n### Error handling: Returns success/failure status\n### uses regex pattern to identify Oh My Posh lines:\n```bash\ninit_pattern = re.compile(r\"^\\s*(eval.*oh-my-posh init.*|oh-my-posh init.*fish.*)\")\n```\n### User confirmation: Always asks for confirmation before activating themes\n\n### Theme Not Activating\n1. Ensure Oh My Posh is properly installed and in your PATH\n2. Check that your shell configuration file exists and is writable\n3. Reload your shell after theme activation\n\n### Preview Not Working\n- For remote themes: The tool will offer to download the theme for preview\n- For local themes: Ensure the theme file exists in `~/.poshthemes/`\n\n### Search Not Responding\n- Make sure you're in search mode (press `/` first)\n- Press `ESC` to exit search mode if stuck\n- Search works across both local and remote theme panels\n\n### Custom Repository Issues\n- Ensure the Git repository URL is valid and accessible\n- Repository must contain `.omp.json` files in the root directory\n- Check your internet connection for repository access\n\n### Theme Customization Problems\n- Only local themes can be customized\n- Ensure you have write permissions to the themes directory\n- Invalid JSON themes cannot be edited safely\n\n## Performance Features\n\n- **Smart Caching**: Theme metadata is cached to speed up repeated previews\n- **File Reuse**: Existing downloaded themes are reused for previews\n- **Memory Management**: Cache size is limited to prevent memory bloat\n- **Lazy Loading**: Theme parsing only when needed\n\n## What's New in v2.0\n\n- \ud83d\udd0d **Search**: Filter themes instantly with `/` keybind\n- \ud83c\udfaf **Custom Repositories**: Add themes from Git repository with `+` keybind  \n- \ud83c\udfa8 **Theme Customization**: Built-in color editor for personalizing themes\n- \u2728 **Enhanced Previews**: sample prompts with essential metadata\n- \ud83c\udfd7\ufe0f **Modular Architecture**: Improved code organization and maintainability\n\n## Contributing\n\n\u2b50 Star on GitHub if you like it!  \n\ud83d\udce6 Review the package on PyPI or AUR  \n\ud83d\udc1b Report issues on GitHub  \n\ud83d\udd27 Submit pull requests with updates/upgrades\n\n## License\n\nThis project is open source. Please check the license file for details.\n\n## Architecture\n\nOh My Theme v2.0 features a modular architecture:\n\n- **`oh_my_theme/main.py`**: Core UI and application logic\n- **`oh_my_theme/preview.py`**: Enhanced theme previews and sample generation\n- **`oh_my_theme/search.py`**: Real-time search and filtering functionality\n- **`oh_my_theme/repositories.py`**: Custom Git repository management\n- **`oh_my_theme/editor.py`**: Theme color customization interface\n- **`oh_my_theme/config.py`**: Configuration and settings management\n\n## Dependencies\n\n- **Python 3.6+**: Core runtime requirement\n- **Standard libraries only**: curses, json, os, subprocess, urllib\n- **No external dependencies required**: Pure Python implementation\n\n## Related Links\n\n- [Oh My Posh Official Website](https://ohmyposh.dev/)\n- [Oh My Posh Documentation](https://ohmyposh.dev/docs/)\n- [Oh My Posh Themes Repository (main)](https://github.com/JanDeDobbeleer/oh-my-posh/tree/main/themes)\n- [Project Repository](https://github.com/mikeisfree/ohmytheme)\n- [PyPI Package](https://pypi.org/project/oh-my-theme/)\n\n---\n\n**Note**: This tool modifies your shell configuration files. It's recommended to backup your configuration before first use.\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Terminal-based theme manager for Oh My Posh with preview, search, custom repositories, and theme customization",
    "version": "2.0.0",
    "project_urls": {
        "Documentation": "https://github.com/mikeisfree/oh-my-theme#readme",
        "Homepage": "https://github.com/mikeisfree/oh-my-theme",
        "Issues": "https://github.com/mikeisfree/oh-my-theme/issues",
        "Repository": "https://github.com/mikeisfree/oh-my-theme"
    },
    "split_keywords": [
        "oh-my-posh",
        " terminal",
        " theme",
        " prompt",
        " shell",
        " bash",
        " zsh",
        " fish",
        " customization",
        " search",
        " git",
        " color-editor"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ac49a2c543fdf8aee5b2dcc6501cff03f9aa839d2d0a29e9e9ea711d66f06c11",
                "md5": "3b7ec7ad324a4e2e2850ed1fe511024e",
                "sha256": "88af93819730f934ea9b5189922b6d60a51fd5206b426be8365f2532cbc76360"
            },
            "downloads": -1,
            "filename": "oh_my_theme-2.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3b7ec7ad324a4e2e2850ed1fe511024e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 32953,
            "upload_time": "2025-08-17T18:22:17",
            "upload_time_iso_8601": "2025-08-17T18:22:17.837280Z",
            "url": "https://files.pythonhosted.org/packages/ac/49/a2c543fdf8aee5b2dcc6501cff03f9aa839d2d0a29e9e9ea711d66f06c11/oh_my_theme-2.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4fe993e2229da50c52cc320494709058c9acf1abbba7b337aff1e9cc0155244d",
                "md5": "6ba64e6d8cf36a7cd50ea064a32f1539",
                "sha256": "74a7266d9f708d0c56afd796ace672ea54f542c5ad9f651f7716b997d4dc9bed"
            },
            "downloads": -1,
            "filename": "oh_my_theme-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6ba64e6d8cf36a7cd50ea064a32f1539",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 33700,
            "upload_time": "2025-08-17T18:22:19",
            "upload_time_iso_8601": "2025-08-17T18:22:19.988853Z",
            "url": "https://files.pythonhosted.org/packages/4f/e9/93e2229da50c52cc320494709058c9acf1abbba7b337aff1e9cc0155244d/oh_my_theme-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-17 18:22:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mikeisfree",
    "github_project": "oh-my-theme#readme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "oh-my-theme"
}
        
Elapsed time: 1.16090s