# Themizer
> An easy and fast CLI app to change between custom themes in Unix-like systems
## Installation
```bash
> pip install themizer # Install with pip
> themizer -v # Check if themizer has been installed correctly
```
## Usage
**Create a theme:**
```bash
> themizer create foo
```
**Apply a theme:**
```bash
> themizer apply bar
```
**Apply the last used theme:**
_When you not specify the theme to use themizer will try to use the last applied theme._
```bash
> themizer apply
```
**Delete a theme:**
```bash
> themizer delete baz
```
> Note: you can use quotes for themes with spaces in its name. E.g. `themizer apply 'Space Plumber'`
## Creating a theme
If you create a theme and apply it directly it will raise this error:
```
[ ERROR ] The theme config body is empty
```
This happens because you should configure your theme manually, this little guide will help you in the process of create a new one.
### Theme structure
All the themes are saved in `~/.config/themizer/themes/` by default, and the structure of a theme looks like this:
```
'theme-name/'
├── after-execute
├── before-execute
├── theme.config
└── ...
```
| Directory / File | Description |
| --- | --- |
| `theme.config` | Here is stored all info about the theme and the instructions to apply it, more info below. |
| `before-execute` | This file will be execute before Themizer actually moves the themes and applies it. Use its shebang to execute anything you want. |
| `after-execute` | The same as `before-execute` but after the theme is actually applied. |
### Configuration of the theme
The `theme.config` is spliced in two parts, the header and the body.
#### The header:
The header stores optional information about the theme itself and the body what directories should move from the theme and where they should go. Looking like this:
```toml
[theme] # Header of the theme config
name = 'custom_name' # The default name is the name of the directory
clear_terminal = true # By default is false, if is true the theme will clear the terminal after applying the theme
```
#### The body:
The body is former for the relative path of the config to move `theme-name/super-config` and the destination `~/.config/super-app`. Looking like this:
```toml
['foobar'] # Relative directory from the theme path
dest = '~/.config/super-app' # Absolute path (can use ~to refer the home path)
```
#### Example:
Directory structure:
```bash
foo-theme/
├── after-execute
├── before-execute
├── theme.config
├── fish/... # Some config for fish shell
└── htop/... # Some config for htop
```
Configuration file:
```toml
[theme]
name = 'Kanagawa Theme'
['fish']
dest = '~/.config/fish'
['htop/htop.config']
dest = '~/.htop'
```
When you run `themizer apply 'Kanagawa Theme'` themizer will execute `before-script`, copy `foo-theme/fish/` to `~/.config/fish/`, copy `foo-theme/htop.config` to `~/.htop` and finally execute `after-script`.
> Note: The subdirectory `theme` will not work correctly as its name is used to refer the header of the configuration.'
## Configuration
Your configuration directory is located by default in `~/.config/themizer/`.
### Custom config path
You can use your custom path for the config using `--config`:
```
> themizer --config /path/to/config/directory
```
## Scripting
You can automatize all the things you can do with Themizer this way:
```python
from themizer import App
theme_manager: App = App()
# You can also set a custom config path
from pathlib import Path
custom_theme_manager: App = App(Path('/your/custom/path/'))
```
The `App` class has this set of useful methods to interact with Themizer:
| Method | Description |
| --- | --- |
| `apply_theme(theme_name: str)` | Apply an existing theme. Leave theme_name None to try to use the last theme applied. Return the theme applied. |
| `create_theme(theme_name: str)` | Create a new theme. |
| `delete_theme(theme_name: str)` | Delete an existing theme. |
| `move_theme_config` | Only moves the directories indicated in the theme and not run the 'before' and 'after' scripts. |
| `run_before_script(theme_name: str)` | Run the 'before' script of the selected theme. |
| `run_after_script(theme_name: str)` | Run the 'after' script of the selected theme. |
| `get_theme_config(theme_name: str)` | Return all the config of the theme. |
| `get_theme_config_head(theme_name: str)` | Return the head of the config of the theme. |
| `get_theme_config_body(theme_name: str)` | Return the body of the config of the theme. |
| `get_themes_dict)` | Return a dict with the names of all themes and its internal object. |
| `set_last_theme_used(theme_name: str)` | Set the last theme to a custom one. |
| `get_last_theme_used)` | Return the last theme used by the user. |
| `get_clear_terminal(theme_name: str)` | Return if the theme selected should clear the terminal. |
## Contributing
Feel free to report a bug or request a branch merge, I appreciate any contribution.
## Author
Created with :heart: by [Kutu](https://kutu-dev.github.io/).
> - GitHub - [kutu-dev](https://github.com/kutu-dev)
> - Twitter - [@kutu_dev](https://twitter.com/kutu_dev)
Raw data
{
"_id": null,
"home_page": "https://github.com/kutu-dev/themizer",
"name": "themizer",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.11,<4.0",
"maintainer_email": "",
"keywords": "themes,utility,manager",
"author": "kutu-dev",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/7c/3a/d344cbe1a86898bd2937ec1780db0138b64072fd66443ffca8f6cb53969b/themizer-1.1.2.tar.gz",
"platform": null,
"description": "# Themizer\n> An easy and fast CLI app to change between custom themes in Unix-like systems\n\n## Installation\n```bash\n> pip install themizer # Install with pip\n> themizer -v # Check if themizer has been installed correctly\n```\n\n## Usage\n**Create a theme:**\n```bash\n> themizer create foo\n```\n\n**Apply a theme:**\n```bash\n> themizer apply bar\n```\n\n**Apply the last used theme:** \n_When you not specify the theme to use themizer will try to use the last applied theme._\n```bash\n> themizer apply\n```\n\n**Delete a theme:**\n```bash\n> themizer delete baz\n```\n> Note: you can use quotes for themes with spaces in its name. E.g. `themizer apply 'Space Plumber'`\n\n\n## Creating a theme\nIf you create a theme and apply it directly it will raise this error:\n```\n[ ERROR ] The theme config body is empty\n```\nThis happens because you should configure your theme manually, this little guide will help you in the process of create a new one. \n\n### Theme structure\n\nAll the themes are saved in `~/.config/themizer/themes/` by default, and the structure of a theme looks like this:\n```\n'theme-name/'\n \u251c\u2500\u2500 after-execute\n \u251c\u2500\u2500 before-execute\n \u251c\u2500\u2500 theme.config\n \u2514\u2500\u2500 ...\n```\n\n| Directory / File |\u00a0Description |\n| --- | --- |\n| `theme.config` | Here is stored all info about the theme and the instructions to apply it, more info below. |\n| `before-execute` | This file will be execute before Themizer actually moves the themes and applies it. Use its shebang to execute anything you want. |\n| `after-execute` | The same as `before-execute` but after the theme is actually applied. |\n\n### Configuration of the theme\nThe `theme.config` is spliced in two parts, the header and the body.\n\n\n#### The header:\nThe header stores optional information about the theme itself and the body what directories should move from the theme and where they should go. Looking like this:\n```toml\n[theme] # Header of the theme config\nname = 'custom_name' # The default name is the name of the directory\nclear_terminal = true # By default is false, if is true the theme will clear the terminal after applying the theme\n```\n\n#### The body:\nThe body is former for the relative path of the config to move `theme-name/super-config` and the destination `~/.config/super-app`. Looking like this:\n```toml\n['foobar'] # Relative directory from the theme path\ndest = '~/.config/super-app' # Absolute path (can use ~to refer the home path)\n```\n#### Example:\nDirectory structure:\n```bash\nfoo-theme/\n \u251c\u2500\u2500 after-execute\n \u251c\u2500\u2500 before-execute\n \u251c\u2500\u2500 theme.config\n \u251c\u2500\u2500 fish/... # Some config for fish shell\n \u2514\u2500\u2500 htop/... # Some config for htop\n```\nConfiguration file:\n```toml\n[theme]\nname = 'Kanagawa Theme'\n\n['fish']\ndest = '~/.config/fish'\n\n['htop/htop.config']\ndest = '~/.htop'\n```\n\nWhen you run `themizer apply 'Kanagawa Theme'` themizer will execute `before-script`, copy `foo-theme/fish/` to `~/.config/fish/`, copy `foo-theme/htop.config` to `~/.htop` and finally execute `after-script`.\n\n> Note: The subdirectory `theme` will not work correctly as its name is used to refer the header of the configuration.'\n\n## Configuration\nYour configuration directory is located by default in `~/.config/themizer/`.\n\n### Custom config path\nYou can use your custom path for the config using `--config`:\n```\n> themizer --config /path/to/config/directory\n```\n\n## Scripting\nYou can automatize all the things you can do with Themizer this way:\n```python\nfrom themizer import App\n\ntheme_manager: App = App()\n# You can also set a custom config path\nfrom pathlib import Path\ncustom_theme_manager: App = App(Path('/your/custom/path/'))\n```\nThe `App` class has this set of useful methods to interact with Themizer:\n| Method | Description |\n| --- | --- |\n| `apply_theme(theme_name: str)` | Apply an existing theme. Leave theme_name None to try to use the last theme applied. Return the theme applied. |\n| `create_theme(theme_name: str)` | Create a new theme. |\n| `delete_theme(theme_name: str)` | Delete an existing theme. |\n| `move_theme_config` | Only moves the directories indicated in the theme and not run the 'before' and 'after' scripts. |\n| `run_before_script(theme_name: str)` | Run the 'before' script of the selected theme. |\n| `run_after_script(theme_name: str)` | Run the 'after' script of the selected theme. |\n| `get_theme_config(theme_name: str)` | Return all the config of the theme. |\n| `get_theme_config_head(theme_name: str)` | Return the head of the config of the theme. |\n| `get_theme_config_body(theme_name: str)` | Return the body of the config of the theme. |\n| `get_themes_dict)` | Return a dict with the names of all themes and its internal object. |\n| `set_last_theme_used(theme_name: str)` | Set the last theme to a custom one. |\n| `get_last_theme_used)` | Return the last theme used by the user. |\n| `get_clear_terminal(theme_name: str)` | Return if the theme selected should clear the terminal. |\n\n## Contributing\nFeel free to report a bug or request a branch merge, I appreciate any contribution.\n\n## Author\n\nCreated with :heart: by [Kutu](https://kutu-dev.github.io/).\n> - GitHub - [kutu-dev](https://github.com/kutu-dev)\n> - Twitter - [@kutu_dev](https://twitter.com/kutu_dev)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "An easy and fast CLI app to change between custom themes in Unix-like systems.",
"version": "1.1.2",
"split_keywords": [
"themes",
"utility",
"manager"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d47d1d66d4c205433b160308e154b06984ffa5ea869dd2e6b167c09eec84052e",
"md5": "1d2d29b7b6e65c2e4f74835eba0cfb6d",
"sha256": "1f4de4a23b82e8b04d9162196e1cc428c841ae5c075091de54d65d8c0fd3ae82"
},
"downloads": -1,
"filename": "themizer-1.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1d2d29b7b6e65c2e4f74835eba0cfb6d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11,<4.0",
"size": 11589,
"upload_time": "2023-03-11T00:52:24",
"upload_time_iso_8601": "2023-03-11T00:52:24.666566Z",
"url": "https://files.pythonhosted.org/packages/d4/7d/1d66d4c205433b160308e154b06984ffa5ea869dd2e6b167c09eec84052e/themizer-1.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7c3ad344cbe1a86898bd2937ec1780db0138b64072fd66443ffca8f6cb53969b",
"md5": "6162045877f71a3886ce9375cda939ae",
"sha256": "7ece1c05f967ea4fa43bbd1bb2683b0b0f000c381cf7cf5eeb49e8b4c7028f9c"
},
"downloads": -1,
"filename": "themizer-1.1.2.tar.gz",
"has_sig": false,
"md5_digest": "6162045877f71a3886ce9375cda939ae",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11,<4.0",
"size": 11011,
"upload_time": "2023-03-11T00:52:26",
"upload_time_iso_8601": "2023-03-11T00:52:26.784360Z",
"url": "https://files.pythonhosted.org/packages/7c/3a/d344cbe1a86898bd2937ec1780db0138b64072fd66443ffca8f6cb53969b/themizer-1.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-11 00:52:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "kutu-dev",
"github_project": "themizer",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "themizer"
}