mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-14 09:00:07 +00:00
Implemented functionality from dir_writable to dir
When variable POWERLEVEL9K_DIR_SHOW_WRITABLE is set to true, dir prompt will have new state NOT_WRITABLE. This state will be set when user doesn't have permission to write in current working directory as in prompt dir_writable. When mode that allows icons is set, LOCK_ICON is used.
This commit is contained in:
parent
93a1c4d2e8
commit
b567ab22c2
1 changed files with 4 additions and 1 deletions
|
@ -802,9 +802,12 @@ prompt_dir() {
|
||||||
"DEFAULT" "FOLDER_ICON"
|
"DEFAULT" "FOLDER_ICON"
|
||||||
"HOME" "HOME_ICON"
|
"HOME" "HOME_ICON"
|
||||||
"HOME_SUBFOLDER" "HOME_SUB_ICON"
|
"HOME_SUBFOLDER" "HOME_SUB_ICON"
|
||||||
|
"NOT_WRITABLE" "LOCK_ICON"
|
||||||
)
|
)
|
||||||
local current_state="DEFAULT"
|
local current_state="DEFAULT"
|
||||||
if [[ $(print -P "%~") == '~' ]]; then
|
if [[ "${POWERLEVEL9K_DIR_SHOW_WRITABLE}" == "true" && ! -w "$PWD" ]]; then
|
||||||
|
current_state="NOT_WRITABLE"
|
||||||
|
elif [[ $(print -P "%~") == '~' ]]; then
|
||||||
current_state="HOME"
|
current_state="HOME"
|
||||||
elif [[ $(print -P "%~") == '~'* ]]; then
|
elif [[ $(print -P "%~") == '~'* ]]; then
|
||||||
current_state="HOME_SUBFOLDER"
|
current_state="HOME_SUBFOLDER"
|
||||||
|
|
Loading…
Reference in a new issue