Add directory permission prompt segment

This commit is contained in:
Benoit Averty 2016-08-09 11:22:02 +02:00 committed by Dominik Ritter
parent a58e8bdc8c
commit 6927b0ca94
2 changed files with 10 additions and 1 deletions

View File

@ -78,6 +78,7 @@ case $POWERLEVEL9K_MODE in
PYTHON_ICON $'\U1F40D' # 🐍
SWIFT_ICON ''
PUBLIC_IP_ICON ''
LOCK_ICON $'\UE138' # 
)
;;
'awesome-fontconfig')
@ -138,6 +139,7 @@ case $POWERLEVEL9K_MODE in
PYTHON_ICON $'\U1F40D' # 🐍
SWIFT_ICON ''
PUBLIC_IP_ICON ''
LOCK_ICON $'\UE138' # 
)
;;
*)
@ -198,6 +200,7 @@ case $POWERLEVEL9K_MODE in
PYTHON_ICON ''
SWIFT_ICON 'Swift'
PUBLIC_IP_ICON ''
LOCK_ICON $'\UE0A2'
)
;;
esac

View File

@ -1114,6 +1114,13 @@ prompt_swift_version() {
"$1_prompt_segment" "$0" "$2" "magenta" "white" "${swift_version}" 'SWIFT_ICON'
}
# dir_permision: Display information about the user's permission to write in the current directory
prompt_dir_permission() {
if [[ ! -w "$PWD" ]]; then
"$1_prompt_segment" "$0_FORBIDDEN" "$2" "red" "226" "" 'LOCK_ICON'
fi
}
################################################################
# Prompt processing and drawing
################################################################
@ -1240,4 +1247,3 @@ prompt_powerlevel9k_setup() {
}
prompt_powerlevel9k_setup "$@"