aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2017-10-07 03:44:00 +0300
committerGitHub <noreply@github.com>2017-10-07 03:44:00 +0300
commit6136152997444dd0b25a6ad2879b496b2fe474a6 (patch)
treefeb2b5848f4ab9d5f56c026b657d2d8b033403fd /powerlevel9k.zsh-theme
parente9e60324cde4279e5724d94905d61986ed9c4b3b (diff)
parentb87c3b85ace58b4a247046a51c37a5b043fcefb5 (diff)
Merge pull request #638 from TimothyEarley/dropbox-integration
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..7770fb0a 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 and dropbox is running
+ if [[ "$dropbox_status" != 'unwatched' && "$dropbox_status" != "isn't running!" ]]; 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