Add python_venv plugin. Update path plugin.

Add icon for non-writable directories.
This commit is contained in:
Ceda EI 2019-02-17 16:41:02 +05:30
parent 713da785c4
commit 66f31d957b
2 changed files with 28 additions and 1 deletions

View File

@ -9,8 +9,14 @@ function wish_path_end() {
function wish_path_set_colors() {
WISH_PATH_FG=${WISH_PATH_FG:-$WISH_DEFAULT_FG}
WISH_PATH_BG=${WISH_PATH_BG:-$WISH_DEFAULT_BG}
WISH_PATH_NO_WRITE_SUFFIX=${WISH_PATH_NO_WRITE_SUFFIX:-}
}
function wish_path_main() {
wish_append $WISH_PATH_BG $WISH_PATH_FG " \w "
if [[ -w $PWD ]]; then
local path=" \w "
else
local path=" \w$WISH_PATH_NO_WRITE_SUFFIX "
fi
wish_append $WISH_PATH_BG $WISH_PATH_FG "$path"
}

21
plugins/python_venv.sh Normal file
View File

@ -0,0 +1,21 @@
function wish_python_venv_start() {
return 0
}
function wish_python_venv_end() {
return 0
}
function wish_python_venv_set_colors() {
WISH_PYTHON_VENV_FG=${WISH_PYTHON_VENV_FG:-$WISH_DEFAULT_FG}
WISH_PYTHON_VENV_BG=${WISH_PYTHON_VENV_BG:-$WISH_DEFAULT_BG}
}
function wish_python_venv_main() {
if [[ -v VIRTUAL_ENV ]]; then
local venv=$(echo $VIRTUAL_ENV | sed 's|.*/||')
wish_append $WISH_PYTHON_VENV_BG $WISH_PYTHON_VENV_FG " $venv "
else
wish_append $WISH_PYTHON_VENV_BG $WISH_PYTHON_VENV_FG ""
fi
}