summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2017-12-15 00:36:53 +0300
committerGitHub <noreply@github.com>2017-12-15 00:36:53 +0300
commit786dc5b3f211b786d5d77243548f0fec4e1618e4 (patch)
treeb26b7b8fbbafd52f060bdf32a2599edb7a3207d7
parentea05b4ebe612c37cad47aa7acdfa88769bf50087 (diff)
parenta62168b18968e26f050e710c9eed540cf39ae1a4 (diff)
Merge pull request #697 from geniusupgrader/next
OpenFOAM support! (fixes #696)
-rw-r--r--README.md1
-rwxr-xr-xpowerlevel9k.zsh-theme10
2 files changed, 11 insertions, 0 deletions
diff --git a/README.md b/README.md
index cd4a1164..a30f3395 100644
--- a/README.md
+++ b/README.md
@@ -149,6 +149,7 @@ The segments that are currently available are:
* [`todo`](http://todotxt.com/) - Shows the number of tasks in your todo.txt tasks file.
* `detect_virt` - Virtualization detection with systemd
* `newline` - Continues the prompt on a new line.
+* `openfoam` - Shows the currently sourced [OpenFOAM](https://openfoam.org/) environment.
---------------------------------------------------------------------------------
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 07c504fe..831e81c5 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -1394,6 +1394,16 @@ prompt_pyenv() {
fi
}
+prompt_openfoam() {
+ local wm_project_version="$WM_PROJECT_VERSION"
+ local wm_fork="$WM_FORK"
+ if [[ -n "$wm_project_version" ]] && [[ -z "$wm_fork" ]] ; then
+ "$1_prompt_segment" "$0" "$2" "yellow" "$DEFAULT_COLOR" "OF: $(basename "$wm_project_version")"
+ elif [[ -n "$wm_project_version" ]] && [[ -n "$wm_fork" ]] ; then
+ "$1_prompt_segment" "$0" "$2" "yellow" "$DEFAULT_COLOR" "F-X: $(basename "$wm_project_version")"
+ fi
+}
+
# Swift version
prompt_swift_version() {
# Get the first number as this is probably the "main" version number..