Cocotte will colorize your iTerm tabs according to the parameter you pass. It is meant to work with your folder, giving a large hue range while being stable and more or less following the alphabetical order.
cocotte $(pwd)
# takes the path, do some computation and color your iterm tab according to this value.
cargo build --release
Create a .cocotterc.toml
:
- in your config home
- or in
~/.config/
(XDG base directory specifications)
Example:
blacklist = [
"Users",
"pierrebaillet",
".",
"Documents",
"src",
"datadog",
"mine"
]
-
list of path segments to ignore when computing the colour
-
this is a list a
CASE SENSITIVE
items (changed after v1.0) -
if a parameter is only containing
blacklist
items, cocotte will return black as color:
cocotte -v -r /Users/pierrebaillet/src/github.com
Verbose enabled.
Reading configuration from: "/Users/pierrebaillet/.cocotterc.toml"
Black list is: ["users", "pierrebaillet", ".", "Documents", "src", "datadog", "mine", "github.com", "go"]
Using input string: /users/pierrebaillet/src/github.com
Path components after filtering: []
R:0 G:0 B:0
cocotte --help
cocotte $(pwd)
cocotte -v -f html /users/pierrebaillet/src/github.com/mysuperepo
Verbose enabled.
Reading configuration from: "/Users/pierrebaillet/.cocotterc.toml"
Black list is: ["users", "pierrebaillet", ".", "Documents", "src", "datadog", "mine", "github.com", "go"]
Using input string: /users/pierrebaillet/src/github.com/mysuperepo
Path components after filtering: ["mysuperepo"]
R:0 G:254 B:164
function ssh
cocotte $argv
/usr/bin/ssh $argv
end
In your fish_prompt
configuration file
function fish_prompt
# [....]
if test (command --search cocotte)
cocotte (pwd)
end
end
To dynamically update your tab based on your current directory you use PROMPT_COMMAND
edit ~/.bash_profile
and add the lines below (if cocotte
is not in your $PATH
you need to replace it by the full path to cocotte
)
cocotte_update ()
{
cocotte $(pwd)
}
PROMPT_COMMAND="cocotte_update; $PROMPT_COMMAND"
Thanks for contributing!
- Clément Delafargue @divarvel
- Francois BAYART @frbayart