Name | dye-your-shell JSON |
Version |
0.12.0
JSON |
| download |
home_page | None |
Summary | Apply color themes to a variety of shell command line tools. |
upload_time | 2025-01-18 05:05:10 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License Copyright (c) 2023 kotfu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
shell
bash
theme
command line
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# dye-your-shell
activate color output in shell commands using themes and patterns
There are many modern *nix and *bsd command line tools which can output
using a full 16.7 million color palette. For example:
* [fzf](https://github.com/junegunn/fzf)
* [dust](https://github.com/bootandy/dust)
* [bat](https://github.com/sharkdp/bat)
* [gum](https://github.com/charmbracelet/gum)
* [eza](https://eza.rocks/)
Even the GNU Project's venerable `ls` can show various types of files in
different colors.
Unfortunately, these tools all use slightly different color configuration mechanisms.
With enough fiddling, you can get your shell init scripts to make all these tools
use a similar color scheme, but if you want to change it, you've got a lot of work
ahead.
`dye-your-shell` installs a command line program named `dye` to do its work.
`dye` reads a configuration file containing a set of colors, and instructions on how to
apply those colors to as many command line tools as can support it. This configuration
file is called a pattern. Each command line tool (ie bat, fzf, eza) has it's own set of
instructions in the pattern which are powered by an agent, which is included in `dye`.
This agent knows how to easily apply the colors to that command line tool, for example
by setting an environment variable, or executing certain shell commands, or copying
a template to a config file.
Instead of tweaking your collection of bash scripts to create or change all these
colors, you now just tell `dye` to apply your pattern.
```
export DYE_PATTERN_FILE=~/.dye/dracula.toml
source <(dye apply)
```
## Pattern Files
Here's an example of a pattern file:
```
#
# sample definition for a dracula theme
version = "1.0.0"
name = "dracula"
[styles]
# these are from https://draculatheme.com/contribute
background = "#282a36"
foreground = "#f8f8f2"
# styles for text and the highlighted line
# these are the only things fzf supports background colors for
text = "#f8f8f2 on default"
current_line = "#f8f8f2 on #44475a"
# other colors from the dracula palette
comment = "#6272a4"
cyan = "#8be9fd"
green = "#50fa7b"
orange = "#ffb86c"
pink = "#ff79c6"
purple = "#bd93f9"
red = "#ff5555"
yellow = "#f1fa8c"
[scope.iterm]
agent = "iterm"
style.foreground = "foreground"
style.background = "background"
[scope.ls_colors]
agent = "environment_variables"
export.LS_COLORS = "$(vivid generate dracula)"
[scope.bat]
agent = "environment_variables"
export.BAT_THEME = "Dracula"
[scope.fzf]
agent = "fzf"
environment_variable = "FZF_DEFAULT_OPTS"
colorbase = "dark"
# command line options
opt.--pointer = "•"
opt.--prompt = "> "
opt.--bind = "ctrl-k:kill-line,ctrl-j:ignore,ctrl-u:unix-line-discard"
# these styles are special because they set both foreground and background
style.text = "text"
style.current_line = "current_line"
# no special parsing for these styles, just use the fzf color name
# highlighted substrings
style.hl = "pink"
# highlighted substrings current line
style."hl+" = "pink"
style.label = "green"
style.border = "orange"
style.prompt = "green"
style.pointer = "cyan"
style.query = "pink"
```
## Installation
You'll need python version 3.9 or higher. Install with [pipx](https://pipx.pypa.io/stable/):
```
$ pipx install dye-your-shell
```
You need a *nix-ish bash shell environment. Probably works in Windows Subsystem
for Linux, but isn't tested there.
Raw data
{
"_id": null,
"home_page": null,
"name": "dye-your-shell",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "shell, bash, theme, command line",
"author": null,
"author_email": "Jared Crapo <jared@kotfu.net>",
"download_url": "https://files.pythonhosted.org/packages/d2/d1/fb8c3415ba5cb32a69c72ac293c90f1386849ffe1af1b9a008f3ed739357/dye_your_shell-0.12.0.tar.gz",
"platform": null,
"description": "# dye-your-shell\n\nactivate color output in shell commands using themes and patterns\n\nThere are many modern *nix and *bsd command line tools which can output\nusing a full 16.7 million color palette. For example:\n\n* [fzf](https://github.com/junegunn/fzf)\n* [dust](https://github.com/bootandy/dust)\n* [bat](https://github.com/sharkdp/bat)\n* [gum](https://github.com/charmbracelet/gum)\n* [eza](https://eza.rocks/)\n\nEven the GNU Project's venerable `ls` can show various types of files in\ndifferent colors.\n\nUnfortunately, these tools all use slightly different color configuration mechanisms.\nWith enough fiddling, you can get your shell init scripts to make all these tools\nuse a similar color scheme, but if you want to change it, you've got a lot of work\nahead.\n\n`dye-your-shell` installs a command line program named `dye` to do its work.\n\n`dye` reads a configuration file containing a set of colors, and instructions on how to\napply those colors to as many command line tools as can support it. This configuration\nfile is called a pattern. Each command line tool (ie bat, fzf, eza) has it's own set of\ninstructions in the pattern which are powered by an agent, which is included in `dye`.\nThis agent knows how to easily apply the colors to that command line tool, for example\nby setting an environment variable, or executing certain shell commands, or copying\na template to a config file.\n\nInstead of tweaking your collection of bash scripts to create or change all these\ncolors, you now just tell `dye` to apply your pattern.\n```\nexport DYE_PATTERN_FILE=~/.dye/dracula.toml\nsource <(dye apply)\n```\n\n\n## Pattern Files\n\nHere's an example of a pattern file:\n```\n#\n# sample definition for a dracula theme\n\nversion = \"1.0.0\"\nname = \"dracula\"\n\n[styles]\n# these are from https://draculatheme.com/contribute\nbackground = \"#282a36\"\nforeground = \"#f8f8f2\"\n\n# styles for text and the highlighted line\n# these are the only things fzf supports background colors for\ntext = \"#f8f8f2 on default\"\ncurrent_line = \"#f8f8f2 on #44475a\"\n\n# other colors from the dracula palette\ncomment = \"#6272a4\"\ncyan = \"#8be9fd\"\ngreen = \"#50fa7b\"\norange = \"#ffb86c\"\npink = \"#ff79c6\"\npurple = \"#bd93f9\"\nred = \"#ff5555\"\nyellow = \"#f1fa8c\"\n\n[scope.iterm]\nagent = \"iterm\"\nstyle.foreground = \"foreground\"\nstyle.background = \"background\"\n\n[scope.ls_colors]\nagent = \"environment_variables\"\nexport.LS_COLORS = \"$(vivid generate dracula)\"\n\n[scope.bat]\nagent = \"environment_variables\"\nexport.BAT_THEME = \"Dracula\"\n\n[scope.fzf]\nagent = \"fzf\"\nenvironment_variable = \"FZF_DEFAULT_OPTS\"\ncolorbase = \"dark\"\n\n# command line options\nopt.--pointer = \"\u2022\"\nopt.--prompt = \"> \"\nopt.--bind = \"ctrl-k:kill-line,ctrl-j:ignore,ctrl-u:unix-line-discard\"\n\n# these styles are special because they set both foreground and background\nstyle.text = \"text\"\nstyle.current_line = \"current_line\"\n\n# no special parsing for these styles, just use the fzf color name\n# highlighted substrings\nstyle.hl = \"pink\"\n# highlighted substrings current line\nstyle.\"hl+\" = \"pink\"\nstyle.label = \"green\"\nstyle.border = \"orange\"\nstyle.prompt = \"green\"\nstyle.pointer = \"cyan\"\nstyle.query = \"pink\"\n```\n\n## Installation\n\nYou'll need python version 3.9 or higher. Install with [pipx](https://pipx.pypa.io/stable/):\n```\n$ pipx install dye-your-shell\n```\n\nYou need a *nix-ish bash shell environment. Probably works in Windows Subsystem\nfor Linux, but isn't tested there.\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2023 kotfu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Apply color themes to a variety of shell command line tools.",
"version": "0.12.0",
"project_urls": {
"homepage": "https://github.com/kotfu/dye-your-shell",
"repository": "https://github.com/kotfu/dye-your-shell"
},
"split_keywords": [
"shell",
" bash",
" theme",
" command line"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8bfb0f469e63ad4684a23dda5d3ee11dc20ab30ec342bc3ac56d4eaba8cfe004",
"md5": "50508a26dca8c9f1a2f282686e7c93f9",
"sha256": "c64c7775582ae6680d0872e0553025c9bc44d097c704234547fd64d9e7ad3094"
},
"downloads": -1,
"filename": "dye_your_shell-0.12.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "50508a26dca8c9f1a2f282686e7c93f9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 31324,
"upload_time": "2025-01-18T05:05:08",
"upload_time_iso_8601": "2025-01-18T05:05:08.710203Z",
"url": "https://files.pythonhosted.org/packages/8b/fb/0f469e63ad4684a23dda5d3ee11dc20ab30ec342bc3ac56d4eaba8cfe004/dye_your_shell-0.12.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d2d1fb8c3415ba5cb32a69c72ac293c90f1386849ffe1af1b9a008f3ed739357",
"md5": "3bc99ca32aa07bc6ab1888dd15c63ea1",
"sha256": "00128285b8275708cac7d72f12c50a12eef991251679cd902a13cd28acfffdb1"
},
"downloads": -1,
"filename": "dye_your_shell-0.12.0.tar.gz",
"has_sig": false,
"md5_digest": "3bc99ca32aa07bc6ab1888dd15c63ea1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 50232,
"upload_time": "2025-01-18T05:05:10",
"upload_time_iso_8601": "2025-01-18T05:05:10.879905Z",
"url": "https://files.pythonhosted.org/packages/d2/d1/fb8c3415ba5cb32a69c72ac293c90f1386849ffe1af1b9a008f3ed739357/dye_your_shell-0.12.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-18 05:05:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kotfu",
"github_project": "dye-your-shell",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "dye-your-shell"
}