From a5e7418c5f9a97d9a43dc4c3dd7d4db42f35bddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Mengu=C3=A9?= Date: Sat, 15 Jun 2013 20:06:04 +0200 Subject: [PATCH 1/4] README: fix typo (closes #202) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9420a6e..9a47cde 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ To use it everytime you start a shell add the following line to your Next up is the configuration, you can skip this step if you already like the defaults: -`cp ~/liquidpromp/liquidpromptrc-dist ~/.config/liquidpromptrc` +`cp ~/liquidprompt/liquidpromptrc-dist ~/.config/liquidpromptrc` You can also copy the file to `~/.liquidpromptrc`. Use your favorite text editor to change the defaults. From 907f9564522717098345a68c04327e8cf993e095 Mon Sep 17 00:00:00 2001 From: Olivier Le Thanh Duong Date: Fri, 7 Jun 2013 15:27:36 +0200 Subject: [PATCH 2/4] [enh] Add support for antigen autoloading --- liquidprompt.plugin.zsh | 1 + 1 file changed, 1 insertion(+) create mode 100644 liquidprompt.plugin.zsh diff --git a/liquidprompt.plugin.zsh b/liquidprompt.plugin.zsh new file mode 100644 index 0000000..4359f7e --- /dev/null +++ b/liquidprompt.plugin.zsh @@ -0,0 +1 @@ +source ${0%/*}/liquidprompt From 8624a4f6c6d300112ce519a1df97f93bda8bd42f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Lidstr=C3=B6m?= Date: Mon, 1 Jul 2013 13:42:48 +0200 Subject: [PATCH 3/4] Added OpenBSD support --- liquidprompt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/liquidprompt b/liquidprompt index 9cc75a7..e1c0341 100755 --- a/liquidprompt +++ b/liquidprompt @@ -85,6 +85,7 @@ fi case $(uname) in FreeBSD) LP_OS=FreeBSD ;; DragonFly) LP_OS=FreeBSD ;; + OpenBSD) LP_OS=OpenBSD ;; Darwin) LP_OS=Darwin ;; SunOS) LP_OS=SunOS ;; *) LP_OS=Linux ;; @@ -93,7 +94,7 @@ esac # Get cpu count case "$LP_OS" in Linux) _lp_CPUNUM=$( nproc 2>/dev/null || grep -c '^[Pp]rocessor' /proc/cpuinfo ) ;; - FreeBSD|Darwin) _lp_CPUNUM=$( sysctl -n hw.ncpu ) ;; + FreeBSD|Darwin|OpenBSD) _lp_CPUNUM=$( sysctl -n hw.ncpu ) ;; SunOS) _lp_CPUNUM=$( kstat -m cpu_info | grep -c "module: cpu_info" ) ;; esac @@ -122,6 +123,11 @@ case "$LP_OS" in } LP_DWIN_KERNEL_REL_VER=$(uname -r | cut -d . -f 1) ;; + OpenBSD) + _lp_cpu_load() { + echo "$(LANG=C sysctl -n vm.loadavg | awk '{print $2}')" + } + ;; SunOS) _lp_cpu_load () { LANG=C uptime | awk '{print substr($10,0,length($10))}' @@ -154,6 +160,9 @@ _lp_source_config() elif tput AF >/dev/null 2>&1 ; then # *BSD ti_setaf () { tput AF "$1" ; } + elif tput AF 1 >/dev/null 2>&1 ; then + # OpenBSD + ti_setaf () { tput AF "$1" ; } else echo "liquidprompt: terminal $TERM not supported" >&2 ti_setaf () { : ; } @@ -1235,7 +1244,7 @@ _lp_as_text() { # Remove colors from the computed prompt case "$LP_OS" in - Linux|FreeBSD|SunOS) local pst=$(echo $1 | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g") ;; + Linux|FreeBSD|OpenBSD|SunOS) local pst=$(echo $1 | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g") ;; Darwin) local pst=$(echo $1 | sed -E "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g") ;; esac @@ -1392,7 +1401,7 @@ _lp_set_prompt() # execute the old prompt if not on Mac OS X (Mountain) Lion case "$LP_OS" in - Linux|FreeBSD|SunOS) $LP_OLD_PROMPT_COMMAND ;; + Linux|FreeBSD|OpenBSD|SunOS) $LP_OLD_PROMPT_COMMAND ;; Darwin) case "$(LP_DWIN_KERNEL_REL_VER)" in 11|12) update_terminal_cwd ;; From 2f2f79f9d687404a79f4c3f5de56e5f8a9b039e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Lidstr=C3=B6m?= Date: Mon, 1 Jul 2013 14:01:16 +0200 Subject: [PATCH 4/4] Made _lp_cpu_load more consistent under OpenBSD --- liquidprompt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/liquidprompt b/liquidprompt index e1c0341..c23f5de 100755 --- a/liquidprompt +++ b/liquidprompt @@ -125,7 +125,9 @@ case "$LP_OS" in ;; OpenBSD) _lp_cpu_load() { - echo "$(LANG=C sysctl -n vm.loadavg | awk '{print $2}')" + local bol load eol + read one two three <<< `sysctl -n vm.loadavg` + echo "$load" } ;; SunOS)