From f5f73f25e579c3c5d6e7c25f2e823dbd5d60ef91 Mon Sep 17 00:00:00 2001 From: Robin Rosenstock Date: Mon, 11 Dec 2017 22:40:06 +0100 Subject: [PATCH 1/3] fixes #696 --- powerlevel9k.zsh-theme | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 4e7f4316..8578e6f2 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -1399,6 +1399,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.. From fddb5a90e8709b6e01e20fcbce1f8662c41264b5 Mon Sep 17 00:00:00 2001 From: Robin Rosenstock Date: Thu, 14 Dec 2017 22:12:18 +0100 Subject: [PATCH 2/3] update readme for #696 and #697. OpenFOAM! --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index c4682dd9..4cba65ce 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 current sourced [OpenFOAM](https://openfoam.org/) environment. --------------------------------------------------------------------------------- @@ -504,6 +505,11 @@ prompt itself. This only works on the left side. On the right side it does nothing. +##### openfoam + +This is for all simulation experts, which work with [OpenFOAM](https://openfoam.org/) or with the [foam-extend](https://sourceforge.net/projects/foam-extend/) project. It shows the current sourced environment. So, after specifying someting like `alias of5='source /opt/OpenFOAM/OpenFOAM-5.0/etc/bashrc'` (bashrc works also on zsh) in your `.zshrc` and doing `of5` in the terminal, then on the right prompt it will show "OF:" (for OpenFOAM) or "F-X:" (for foam-extend) with its corresponding version number behind it. To activate this segment just use it with: `openfoam` as normal. + + ##### rbenv This segment shows the version of Ruby being used when using `rbenv` to change your current Ruby stack. From a62168b18968e26f050e710c9eed540cf39ae1a4 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Thu, 14 Dec 2017 16:32:06 -0500 Subject: [PATCH 3/3] README Cleanup --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index 4cba65ce..ca3a6809 100644 --- a/README.md +++ b/README.md @@ -149,7 +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 current sourced [OpenFOAM](https://openfoam.org/) environment. +* `openfoam` - Shows the currently sourced [OpenFOAM](https://openfoam.org/) environment. --------------------------------------------------------------------------------- @@ -505,11 +505,6 @@ prompt itself. This only works on the left side. On the right side it does nothing. -##### openfoam - -This is for all simulation experts, which work with [OpenFOAM](https://openfoam.org/) or with the [foam-extend](https://sourceforge.net/projects/foam-extend/) project. It shows the current sourced environment. So, after specifying someting like `alias of5='source /opt/OpenFOAM/OpenFOAM-5.0/etc/bashrc'` (bashrc works also on zsh) in your `.zshrc` and doing `of5` in the terminal, then on the right prompt it will show "OF:" (for OpenFOAM) or "F-X:" (for foam-extend) with its corresponding version number behind it. To activate this segment just use it with: `openfoam` as normal. - - ##### rbenv This segment shows the version of Ruby being used when using `rbenv` to change your current Ruby stack.