aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorTimothy Earley <timmy@earley.de>2017-10-01 18:53:07 +0300
committerTimothy Earley <timmy@earley.de>2017-10-01 18:53:07 +0300
commit81cbd65142609da34f463046abec8ad456440056 (patch)
tree287195914f500ad52bec9e4336b9fd721dc7ee0f /powerlevel9k.zsh-theme
parente9e60324cde4279e5724d94905d61986ed9c4b3b (diff)
Added dropbox segment
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme17
1 files changed, 17 insertions, 0 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 9a146fa8..792771ac 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -1423,6 +1423,23 @@ prompt_kubecontext() {
fi
}
+# Dropbox status
+prompt_dropbox() {
+ # The first column is just the directory, so cut it
+ local dropbox_status="$(dropbox-cli filestatus . | cut -d\ -f2-)"
+
+ # Only show if the folder is tracked
+ if [[ "$dropbox_status" != 'unwatched' ]]; then
+ # If "up to date", only show the icon
+ if [[ "$dropbox_status" =~ 'up to date' ]]; then
+ dropbox_status=""
+ fi
+
+ "$1_prompt_segment" "$0" "$2" "white" "blue" "$dropbox_status" "DROPBOX_ICON"
+ fi
+
+}
+
################################################################
# Prompt processing and drawing