This has been tested on Ubuntu 18.04 and macos 10.13, should work with python 2/3.
Python script to automatically customize the workspace based on the current git repository root path (credits to iterm2-ssh-color for iTerm2 tab coloring function).
I frequently find myself with 6+ projects (for me means git repositories) open concurrently, I created a couple of utilities to manage all this more easily.
Clone repository:
git clone https://github.com/meddario/workspace-utils.git ~/.workspace-utils
Add in ~/.bashrc
:
# Workspace customizations based on the current git repository
export PROMPT_RUNNER_DIR=~/.workspace-utils
source $PROMPT_RUNNER_DIR/workspace-utils.sh
export PROMPT_COMMAND="$PROMPT_COMMAND;customizeWorkspace"
Add to $HOME/.workspace-utils.json
(customizations must be explicitly enabled):
{
"customize_workspace": {
"update_vscode_peacock_config": true,
"update_iterm_tab_color": true
}
}
update_vscode_peacock_config
: requires vscode Peacock extension, automatically sets the peacock color in the.vscode/settings.json
.update_iterm_tab_color
: updates the current iTerm tab color to the repo color.
update_vscode_peacock_config
:
update_iterm_tab_color
: